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 _ = require('lodash'); | |
const request = require('request'); | |
// Algorithm will run every 5 seconds | |
setInterval(() => { | |
// API request to Coin Market Cap for top 20 cryptocurrencies | |
request('https://api.coinmarketcap.com/v1/ticker/', (error, response, body) => { | |
const coins = JSON.parse(body); |
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
// Dependencies here... | |
function Neuron() { | |
// Code here... | |
} | |
module.exports = Neuron; |
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() { | |
// Code here... | |
} | |
module.exports = Neuron; |
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() |
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() |
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() |
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(bias) { | |
this.id = uid(); | |
this.bias = bias == undefined ? Math.random() * 2 - 1 : bias; | |
this.squash; | |
this.cost; | |
this.incoming = { |
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"); | |
/** | |
* @typedef {string} ID A universally unique ID | |
*/ | |
/** | |
* @constructs Neuron | |
* | |
* @prop {ID} id Neuron's unique ID |
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
// Dependencies here... | |
function Group() { | |
// Code here... | |
} | |
module.exports = Group; |
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"); | |
const Neuron = require("./neuron"); | |
function Group() { | |
// Code here... | |
} | |
module.exports = Group; |
OlderNewer