@liquid-carrot/carrot
A Simple Node.js AI Library for Neural Network
Last updated 8 months ago by christian.george.echevarria .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @liquid-carrot/carrot 
SYNC missed versions from official npm registry.

Carrot Logo

Build Status via Travis CI Codacy Badge Coverage Status Join the chat at https://gitter.im/carrot-ai/community Carrot's License Made with love

Carrot is an architecture-free neural network library built around neuroevolution

Why / when should I use this?

Whenever you have a problem that you:

  • Don't know how-to solve
  • Don't want to design a custom network for
  • Want to discover the ideal neural-network structure for

You can use Carrot's ability to design networks of arbitrary complexity by itself to solve whatever problem you have. If you want to see Carrot designing a neural-network to play flappy-bird check here

For Documentation, visit here

Key Features

  • Simple docs & interactive examples
  • Neuro-evolution & population based training
  • Multi-threading & GPU (coming soon)
  • Preconfigured GRU, LSTM, NARX Networks
  • Mutable Neurons, Layers, Groups, and Networks
  • SVG Network Visualizations using D3.js

Demos

flappy bird neuro-evolution demo
Flappy bird neuro-evolution

Install

$ npm i @liquid-carrot/carrot

Carrot files are hosted by JSDelivr

For prototyping or learning, use the latest version here:

<script src="https://cdn.jsdelivr.net/npm/@liquid-carrot/carrot/dist/carrot.umd2.min.js"></script>

For production, link to a specific version number to avoid unexpected breakage from newer versions:

<script src="https://cdn.jsdelivr.net/npm/@liquid-carrot/carrot@0.3.17/dist/carrot.umd2.min.js"></script>

Getting Started

???? Want to be super knowledgeable about neuro-evolution in a few minutes?

Check out this article by the creator of NEAT, Kenneth Stanley

This is a simple perceptron:

perceptron.

How to build it with Carrot:

let { architect } = require('@liquid-carrot/carrot');

// The example Perceptron you see above with 4 inputs, 5 hidden, and 1 output neuron
let simplePerceptron = new architect.Perceptron(4, 5, 1);

Building networks is easy with 6 built-in networks

let { architect } = require('@liquid-carrot/carrot');

let LSTM = new architect.LSTM(4, 5, 1);

// Add as many hidden layers as needed
let Perceptron = new architect.Perceptron(4, 5, 20, 5, 10, 1);

Building custom network architectures

let architect = require('@liquid-carrot/carrot').architect
let Layer = require('@liquid-carrot/carrot').Layer

let input = new Layer.Dense(1);
let hidden1 = new Layer.LSTM(5);
let hidden2 = new Layer.GRU(1);
let output = new Layer.Dense(1);

// connect however you want
input.connect(hidden1);
hidden1.connect(hidden2);
hidden2.connect(output);

let network = architect.Construct([input, hidden1, hidden2, output]);

Networks also shape themselves with neuro-evolution

let { Network, methods } = require('@liquid-carrot/carrot');

// this network learns the XOR gate (through neuro-evolution)
async function execute () {
  // no hidden layers...
   var network = new Network(2,1);

   // XOR dataset
   var trainingSet = [
       { input: [0,0], output: [0] },
       { input: [0,1], output: [1] },
       { input: [1,0], output: [1] },
       { input: [1,1], output: [0] }
   ];

   await network.evolve(trainingSet, {
       mutation: methods.mutation.FFW,
       equal: true,
       error: 0.05,
       elitism: 5,
       mutation_rate: 0.5
   });

   // and it works!
   network.activate([0,0]); // 0.2413
   network.activate([0,1]); // 1.0000
   network.activate([1,0]); // 0.7663
   network.activate([1,1]); // 0.008
}

execute();

Build vanilla neural networks

let Network = require('@liquid-carrot/carrot').Network

let network = new Network([2, 2, 1]) // Builds a neural network with 5 neurons: 2 + 2 + 1

Or implement custom algorithms with neuron-level control

let Node = require('@liquid-carrot/carrot').Node

let A = new Node() // neuron
let B = new Node() // neuron

A.connect(B)
A.activate(0.5)
console.log(B.activate())

Try with

Data Sets

Contributors ✨

This project exists thanks to all the people who contribute. We can't do it without you! ????

Thanks goes to these wonderful people (emoji key):

Luis Carbonell
Luis Carbonell

???? ???? ???? ????
Christian Echevarria
Christian Echevarria

???? ???? ????
Daniel Ryan
Daniel Ryan

???? ????
IviieMtz
IviieMtz

⚠️
Nicholas Szerman
Nicholas Szerman

????
tracy collins
tracy collins

????

This project follows the all-contributors specification. Contributions of any kind welcome!

???? Contributing

Carrot's GitHub Issues

Your contributions are always welcome! Please have a look at the contribution guidelines first. ????

To build a community welcome to all, Carrot follows the Contributor Covenant Code of Conduct.

And finally, a big thank you to all of you for supporting! ????

<summary> Planned Features</summary> * [ ] Performance Enhancements * [ ] GPU Acceleration * [ ] Tests * [ ] Benchmarks * [ ] Matrix Multiplications * [ ] Tests * [ ] Benchmarks * [ ] Clustering | Multi-Threading * [ ] Tests * [ ] Benchmarks * [ ] Syntax Support * [ ] Callbacks * [ ] Promises * [ ] Streaming * [ ] Async/Await * [ ] Math Support * [ ] Big Numbers * [ ] Small Numbers

Patrons

Carrot's Patrons

Silver Patrons
D-Nice Profile Pitcure
D-Nice
Bronze Patrons
Kappaxbeta's Profile Pitcure
Kappaxbeta
Patrons
DollarBizClub Logo
DollarBizClub

Become a Patron

Acknowledgements

A special thanks to:

@wagenaartje for Neataptic which was the starting point for this project

@cazala for Synaptic which pioneered architecture free neural networks in javascript and was the starting point for Neataptic

@robertleeplummerjr for GPU.js which makes using GPU in JS easy and Brain.js which has inspired Carrot's development

Current Tags

  • 0.3.18                                ...           latest (8 months ago)

244 Versions

  • 0.3.18                                ...           8 months ago
  • 0.3.17                                ...           8 months ago
  • 0.3.16                                ...           8 months ago
  • 0.3.15                                ...           8 months ago
  • 0.3.14                                ...           8 months ago
  • 0.3.13                                ...           8 months ago
  • 0.3.12                                ...           8 months ago
  • 0.3.11                                ...           9 months ago
  • 0.3.10                                ...           9 months ago
  • 0.3.9                                ...           9 months ago
  • 0.3.8                                ...           9 months ago
  • 0.3.6                                ...           9 months ago
  • 0.3.5                                ...           9 months ago
  • 0.3.4                                ...           9 months ago
  • 0.3.3                                ...           9 months ago
  • 0.3.2                                ...           9 months ago
  • 0.3.1                                ...           9 months ago
  • 0.3.0                                ...           10 months ago
  • 0.2.28                                ...           10 months ago
  • 0.2.27                                ...           a year ago
  • 0.2.26                                ...           a year ago
  • 0.2.25                                ...           a year ago
  • 0.2.24                                ...           a year ago
  • 0.2.23                                ...           a year ago
  • 0.2.22                                ...           a year ago
  • 0.2.21                                ...           a year ago
  • 0.2.20                                ...           a year ago
  • 0.2.19                                ...           a year ago
  • 0.2.18                                ...           a year ago
  • 0.2.16                                ...           a year ago
  • 0.2.15                                ...           a year ago
  • 0.2.14                                ...           a year ago
  • 0.2.13                                ...           a year ago
  • 0.2.12                                ...           a year ago
  • 0.2.11                                ...           a year ago
  • 0.2.10                                ...           a year ago
  • 0.2.9                                ...           a year ago
  • 0.2.8                                ...           a year ago
  • 0.2.7                                ...           a year ago
  • 0.2.6                                ...           a year ago
  • 0.2.5                                ...           a year ago
  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.135                                ...           a year ago
  • 0.1.134                                ...           a year ago
  • 0.1.133                                ...           a year ago
  • 0.1.132                                ...           a year ago
  • 0.1.131                                ...           a year ago
  • 0.1.130                                ...           a year ago
  • 0.1.129                                ...           a year ago
  • 0.1.128                                ...           a year ago
  • 0.1.127                                ...           a year ago
  • 0.1.126                                ...           a year ago
  • 0.1.125                                ...           a year ago
  • 0.1.124                                ...           a year ago
  • 0.1.123                                ...           a year ago
  • 0.1.122                                ...           a year ago
  • 0.1.121                                ...           a year ago
  • 0.1.120                                ...           a year ago
  • 0.1.119                                ...           a year ago
  • 0.1.118                                ...           a year ago
  • 0.1.117                                ...           a year ago
  • 0.1.116                                ...           a year ago
  • 0.1.115                                ...           a year ago
  • 0.1.114                                ...           a year ago
  • 0.1.113                                ...           a year ago
  • 0.1.112                                ...           a year ago
  • 0.1.111                                ...           a year ago
  • 0.1.110                                ...           a year ago
  • 0.1.109                                ...           a year ago
  • 0.1.108                                ...           a year ago
  • 0.1.107                                ...           a year ago
  • 0.1.106                                ...           a year ago
  • 0.1.105                                ...           a year ago
  • 0.1.104                                ...           a year ago
  • 0.1.103                                ...           a year ago
  • 0.1.102                                ...           a year ago
  • 0.1.101                                ...           a year ago
  • 0.1.100                                ...           a year ago
  • 0.1.99                                ...           a year ago
  • 0.1.98                                ...           a year ago
  • 0.1.97                                ...           a year ago
  • 0.1.96                                ...           a year ago
  • 0.1.95                                ...           a year ago
  • 0.1.94                                ...           a year ago
  • 0.1.93                                ...           a year ago
  • 0.1.92                                ...           a year ago
  • 0.1.91                                ...           a year ago
  • 0.1.90                                ...           a year ago
  • 0.1.89                                ...           a year ago
  • 0.1.88                                ...           a year ago
  • 0.1.87                                ...           a year ago
  • 0.1.86                                ...           a year ago
  • 0.1.85                                ...           a year ago
  • 0.1.84                                ...           a year ago
  • 0.1.83                                ...           a year ago
  • 0.1.82                                ...           a year ago
  • 0.1.81                                ...           a year ago
  • 0.1.80                                ...           a year ago
  • 0.1.79                                ...           a year ago
  • 0.1.78                                ...           a year ago
  • 0.1.77                                ...           a year ago
  • 0.1.76                                ...           a year ago
  • 0.1.75                                ...           a year ago
  • 0.1.74                                ...           a year ago
  • 0.1.73                                ...           a year ago
  • 0.1.72                                ...           a year ago
  • 0.1.71                                ...           a year ago
  • 0.1.70                                ...           a year ago
  • 0.1.69                                ...           a year ago
  • 0.1.68                                ...           a year ago
  • 0.1.67                                ...           a year ago
  • 0.1.66                                ...           a year ago
  • 0.1.65                                ...           a year ago
  • 0.1.64                                ...           a year ago
  • 0.1.63                                ...           a year ago
  • 0.1.62                                ...           a year ago
  • 0.1.61                                ...           a year ago
  • 0.1.60                                ...           a year ago
  • 0.1.59                                ...           a year ago
  • 0.1.58                                ...           a year ago
  • 0.1.57                                ...           a year ago
  • 0.1.56                                ...           a year ago
  • 0.1.55                                ...           a year ago
  • 0.1.54                                ...           a year ago
  • 0.1.53                                ...           a year ago
  • 0.1.52                                ...           a year ago
  • 0.1.51                                ...           a year ago
  • 0.1.50                                ...           a year ago
  • 0.1.49                                ...           a year ago
  • 0.1.48                                ...           a year ago
  • 0.1.47                                ...           a year ago
  • 0.1.46                                ...           a year ago
  • 0.1.45                                ...           a year ago
  • 0.1.44                                ...           a year ago
  • 0.1.43                                ...           a year ago
  • 0.1.42                                ...           a year ago
  • 0.1.41                                ...           a year ago
  • 0.1.40                                ...           a year ago
  • 0.1.39                                ...           a year ago
  • 0.1.38                                ...           a year ago
  • 0.1.37                                ...           a year ago
  • 0.1.36                                ...           a year ago
  • 0.1.35                                ...           a year ago
  • 0.1.34                                ...           a year ago
  • 0.1.33                                ...           a year ago
  • 0.1.32                                ...           a year ago
  • 0.1.31                                ...           a year ago
  • 0.1.30                                ...           a year ago
  • 0.1.29                                ...           a year ago
  • 0.1.28                                ...           a year ago
  • 0.1.27                                ...           a year ago
  • 0.1.26                                ...           a year ago
  • 0.1.25                                ...           a year ago
  • 0.1.24                                ...           a year ago
  • 0.1.23                                ...           a year ago
  • 0.1.22                                ...           a year ago
  • 0.1.21                                ...           a year ago
  • 0.1.20                                ...           a year ago
  • 0.1.19                                ...           a year ago
  • 0.1.18                                ...           a year ago
  • 0.1.17                                ...           a year ago
  • 0.1.16                                ...           a year ago
  • 0.1.15                                ...           a year ago
  • 0.1.14                                ...           a year ago
  • 0.1.13                                ...           a year ago
  • 0.1.12                                ...           a year ago
  • 0.1.11                                ...           a year ago
  • 0.1.10                                ...           a year ago
  • 0.1.9                                ...           a year ago
  • 0.1.8                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.62                                ...           a year ago
  • 0.0.61                                ...           a year ago
  • 0.0.60                                ...           a year ago
  • 0.0.59                                ...           a year ago
  • 0.0.58                                ...           a year ago
  • 0.0.57                                ...           a year ago
  • 0.0.56                                ...           a year ago
  • 0.0.55                                ...           a year ago
  • 0.0.54                                ...           a year ago
  • 0.0.53                                ...           a year ago
  • 0.0.52                                ...           a year ago
  • 0.0.51                                ...           a year ago
  • 0.0.50                                ...           a year ago
  • 0.0.49                                ...           a year ago
  • 0.0.48                                ...           a year ago
  • 0.0.47                                ...           a year ago
  • 0.0.46                                ...           a year ago
  • 0.0.45                                ...           a year ago
  • 0.0.44                                ...           a year ago
  • 0.0.43                                ...           a year ago
  • 0.0.42                                ...           a year ago
  • 0.0.41                                ...           a year ago
  • 0.0.40                                ...           a year ago
  • 0.0.39                                ...           a year ago
  • 0.0.38                                ...           a year ago
  • 0.0.37                                ...           a year ago
  • 0.0.36                                ...           a year ago
  • 0.0.35                                ...           a year ago
  • 0.0.34                                ...           a year ago
  • 0.0.33                                ...           a year ago
  • 0.0.32                                ...           a year ago
  • 0.0.31                                ...           a year ago
  • 0.0.30                                ...           a year ago
  • 0.0.29                                ...           a year ago
  • 0.0.28                                ...           a year ago
  • 0.0.27                                ...           a year ago
  • 0.0.26                                ...           a year ago
  • 0.0.25                                ...           a year ago
  • 0.0.24                                ...           a year ago
  • 0.0.23                                ...           a year ago
  • 0.0.22                                ...           a year ago
  • 0.0.21                                ...           a year ago
  • 0.0.20                                ...           a year ago
  • 0.0.19                                ...           a year ago
  • 0.0.18                                ...           a year ago
  • 0.0.17                                ...           a year ago
  • 0.0.16                                ...           a year ago
  • 0.0.15                                ...           a year ago
  • 0.0.14                                ...           a year ago
  • 0.0.13                                ...           a year ago
  • 0.0.12                                ...           a year ago
  • 0.0.11                                ...           a year ago
  • 0.0.10                                ...           a year ago
  • 0.0.9                                ...           a year ago
  • 0.0.8                                ...           a year ago
  • 0.0.7                                ...           a year ago
  • 0.0.6                                ...           a year ago
  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
  • 0.0.0                                ...           a year ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |