Skip to content

Instantly share code, notes, and snippets.

@luiscarbonell
Last active August 6, 2019 04:00
Show Gist options
  • Save luiscarbonell/c43a527fb0bfddade3a34808089d1404 to your computer and use it in GitHub Desktop.
Save luiscarbonell/c43a527fb0bfddade3a34808089d1404 to your computer and use it in GitHub Desktop.
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;
@luiscarbonell
Copy link
Author

+ neuron.v0.0.1.js
+ Properties - state, environment, and data storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment