Skip to content

Instantly share code, notes, and snippets.

View luiscarbonell's full-sized avatar
😜
Focusing

Luis Carbonell luiscarbonell

😜
Focusing
View GitHub Profile
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);
});
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);
});
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]
// Dependencies here...
function Network() {
// Code here...
}
module.exports = Network;
const uid = require("cuid");
const Group = require("./group");
function Network() {
// Code here...
}
module.exports = Network;
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);
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) {
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] }
]
const Group = require("./group")
// 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] }
]
const Network = require("./network");
// 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] }
]