The javascript architecture-free neural network library for node.js and the browser
creature.js
var synaptic = require('synaptic');
this.network = new synaptic.Architect.Perceptron(40, 25, 3);
world.js
creatures.forEach(function(creature)
{
// move
var input = [];
for (var i in creatures)
{
input.push(creatures[i].location.x);
input.push(creatures[i].location.y);
input.push(creatures[i].velocity.x);
input.push(creatures[i].velocity.y);
}
var output = creature.network.activate(input);
creature.moveTo(output);
// learn
var learningRate = .3;
var target = [
targetX(creature),
targetY(creature),
targetAngle(creature)];
creature.network.propagate(learningRate, target);
});
Neurons are the basic unit of the neural network. They can be connected to another neuron or gate connections between other neurons. This allows you to create complex and flexible architectures.
Learn MoreNetworks can be imported/exported to JSON, converted to workers or standalone functions. They can be connected to other networks or gate connections.
Learn MoreTrainers can take any given network regardless of its architecture and use any training set. It includes built-in tasks to test networks, like learning an XOR, completing a Discrete Sequence Recall task or an Embeded Reber Grammar test.
Learn MoreThe Architect includes built-in useful architectures such as multilayer perceptrons, multilayer long short-term memory networks (LSTM), liquid state machines and Hopfield networks.
Learn More