gitmyhub

synaptic

JavaScript ★ 6.9k updated 5y ago

architecture-free neural network library for node.js and the browser

Synaptic is a JavaScript library for building and training neural networks in the browser or Node.js, wire layers of artificial neurons together yourself, or use ready-made templates like LSTM and perceptron.

JavaScriptNode.jssetup: easycomplexity 3/5

Synaptic is a JavaScript library for building and training neural networks, usable both in a browser and in Node.js. A neural network is a type of software that learns patterns from examples rather than following explicit programmed rules. Synaptic lets developers create these networks by connecting together layers of artificial neurons, then training the result on data until it can recognize patterns or make predictions.

The library is described as architecture-free, meaning it does not lock you into a specific network shape. You can wire neurons and layers together however you choose, building standard designs like a multilayer perceptron (a basic feedforward network) or more complex recurrent designs that can retain memory across a sequence of inputs. For common architectures, the library includes ready-made templates so you do not need to build from scratch: multilayer perceptrons, LSTM (long short-term memory) networks for sequence learning, liquid state machines, and Hopfield networks are all available.

Training is handled by a built-in Trainer class. The library includes several standard test tasks, such as learning the XOR logic operation (a classic first test for neural networks), a sequence recall task, and an Embedded Reber Grammar test, which lets you measure and compare how well different network designs learn. The underlying training algorithm is based on a published academic paper on generalized training for second-order recurrent networks.

The README links to interactive browser demos, including a version that learns to apply image filters, a self-organizing map, and a network that reads from Wikipedia. Installation is through npm for Node.js or a CDN script tag for browser use. The project began in Buenos Aires, Argentina, and accepts code contributions. A discussion of a major version 2 rewrite was open in the repository at the time the README was written.

Where it fits