This file contains hidden or 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 Neuron = require("./neuron") | |
| // AND Logic Gate | |
| const dataset = [ | |
| { inputs: [0,0], outputs: [0] }, | |
| { inputs: [0,1], outputs: [0] }, | |
| { inputs: [1,0], outputs: [0] }, | |
| { inputs: [1,1], outputs: [1] } | |
| ] |
This file contains hidden or 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"); | |
| const Group = require("./group"); | |
| function Network(sizes, biases, weights) { | |
| let self = this; | |
| this.id = uid(); | |
| this.groups = sizes == undefined ? [] : sizes.map(function(size, index) { |
This file contains hidden or 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"); | |
| const Group = require("./group"); | |
| function Network(sizes, biases, weights) { | |
| let self = this; | |
| this.id = uid(); | |
| this.groups = sizes == undefined ? [] : sizes.map(function(size, index) { | |
| if(biases == undefined) return new Group(size); |
This file contains hidden or 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"); | |
| const Group = require("./group"); | |
| function Network() { | |
| // Code here... | |
| } | |
| module.exports = Network; |
This file contains hidden or 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
| // Dependencies here... | |
| function Network() { | |
| // Code here... | |
| } | |
| module.exports = Network; |
This file contains hidden or 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"); | |
| const Neuron = require("./neuron"); | |
| /** | |
| * A `Group` is an abstraction of `Neuron` and a tool for creating and manipulating a group of neurons - with `Group` we can create neural network layers and and build networks faster than neuron-by-neuron construction. | |
| * | |
| * @constructs Group | |
| * | |
| * @param {number} [size] | |
| * @param {number} [bias] |
This file contains hidden or 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"); | |
| const Neuron = require("./neuron"); | |
| function Group(size, bias) { | |
| this.id = uid(); | |
| this.neurons = size == undefined ? [] : Array.from({ length: size }, function() { | |
| return new Neuron(bias); | |
| }); | |
This file contains hidden or 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"); | |
| const Neuron = require("./neuron"); | |
| function Group() { | |
| this.id = uid(); | |
| this.neurons = size == undefined ? [] : Array.from({ length: size }, function() { | |
| return new Neuron(bias); | |
| }); | |
This file contains hidden or 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"); | |
| const Neuron = require("./neuron"); | |
| function Group() { | |
| // Code here... | |
| } | |
| module.exports = Group; |
This file contains hidden or 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
| // Dependencies here... | |
| function Group() { | |
| // Code here... | |
| } | |
| module.exports = Group; |