Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const uid = require("cuid");
- function Neuron() {
- this.id = uid(); // ID
- this.bias = bias == undefined ? Math.random() * 2 - 1 : bias; // this.bias ∈ ℝ && -1 < this.bias < 1
- // Incoming Connections
- this.incoming = {
- neurons: {}, // new Map()
- weights: {} // new Map()
- }
- // Outgoing Connections
- this.outgoing = {
- neurons: {}, // new Map()
- weights: {} // new Map()
- }
- this._output; // f'(x)
- this.output; // f(x)
- this.error; // E'(f(x))
- }
- module.exports = Neuron;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement