Last active
August 6, 2019 04:00
-
-
Save luiscarbonell/c43a527fb0bfddade3a34808089d1404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+ neuron.v0.0.1.js
+ Properties - state, environment, and data storage