Some more JavaScript libraries for Machine Learning 🤖
Tags: javascript, machinelearning, datascience
Published: 2020-12-19 18:18:41

Javascript is the "Jack of all trades" in programming languages. It can be praised just for its versatility. It powers the frontend, the back end, and even launch spacecraft in space. I wrote a post about famous Javascript libraries a few weeks ago which can be used for Machine Learning.

{% link https://dev.to/amananandrai/10-famous-javascript-libraries-for-machine-learning-38fa %}
 
One of the readers pointed out that this list includes libraries from large organizations. It was not my intention to bring a list of libraries backed by Google and such large companies and so I searched about some more libraries which can be used for Machine Learning. Some of these are suggested by the reader mentioned above. Here is a list of some more JS libraries for Machine Learning.

 
## Synaptic Js
It is a Javascript library for node.js and browsers. It can be used to make any type of ML architectures even second order neural networks that have higher-order weights. The core components of this library are neurons, layers, and networks along with trainers and architect.  The architect contains built-in architectures like multilayer perceptrons, multilayer long-short term memory networks (LSTM), liquid state machines or Hopfield networks.

**Link-** http://caza.la/synaptic

### Examples

### *Different type of Image Filters*

### Grayscale
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0wuo0yi7cbqch23zbzqe.PNG)

### Neon Glow
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0wuo0yi7cbqch23zbzqe.PNG)
<hr>

### * Painting an Image using Neural Network*

#### Step 1
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1yvfzs43vogn1kh7jbkx.gif)

#### Step 2
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/315otiy3q4vhs8pulwlc.gif)


<hr>

## Neataptic Js
**"Neuro-evolution on steroids, right in the browser"** this is what is written on the homepage of Neataptic. It is basically a JS library with neuroevolution as its building block. Neuroevolution means that evolutionary algorithms are used to train the neural network. [Instinct](https://towardsdatascience.com/neuro-evolution-on-steroids-82bd14ddc2f6) algorithm is used as the neuroevolution algorithm of this framework.

Neataptic offers 6 pre-configured networks-

* GRU
* Hopfield
* LSTM
* NARX
* Perceptron
* Random

**Link-** https://wagenaartje.github.io/neataptic/
### Examples

### *Agar.io using Neuroevolution*
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e8qmeltvrzyvfkocrdzr.gif)

### *Target seeking AI*
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xew3fplyl666bbdq4tuv.gif)

<hr>

## Mind Js
It is a very light JS framework for ML which can be used to customize the network topology. It uses matrix implementation to train data. The tutorial of Mind can be found [here](http://stevenmiller888.github.io/mind-how-to-build-a-neural-network/). A demo of **movie recommender system** using Mindjs can be found [here](http://stevenmiller888.github.io/mindjs.net/).

**Link-** https://github.com/stevenmiller888/mind

<hr> 

## Liquid Carrot
It is another Javascript framework based on neuroevolution. It is inspired by NeatapticJs for neuroevolution for neural training and SynapticJs for architecture free neural networks. It can be used for both node.js and browser. A demo for Flappy bird can be seen [here](https://liquidcarrot.io/example.flappy-bird/). It has pre-configured architectures for GRU, LSTM, NARX, and Hopfield Network. Multithreading and GPU support for training is coming soon.

**Link-** https://liquidcarrot.io/
### Example

### *Flappy Bird using Population based Evolutionary Algorithm*

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q7izc0d03eprrz60odrf.gif)
<hr>

## Ml js
This library is a compilation of the tools developed in the mljs organization. It is mainly maintained for use in the browser.
To include the ml.js library in a web page:

`<script src="https://www.lactame.com/lib/ml/4.0.0/ml.min.js"></script>`

It has tools for a lot of Machine Learning algorithms. For unsupervised learning it has 
* Principal component analysis (PCA)
* Hierarchical clustering
* K-means clustering

It has many supervised learning algorithms like-
* Naive Bayes
* K-Nearest Neighbor (KNN)
* Decision tree classifier
* Random forest classifier

It is a gem of a library for Regression with varied type of regression algorithms.
* Simple linear regression
* Polynomial regression
* Multivariate linear regression
* Power regression
* Exponential regression
* Theil-Sen regression
* Robust polynomial regression
* Decision tree regression
* Random forest regression

**Link-** https://github.com/mljs/ml

<hr>
## Convnet Js
`ConvNetJS is a Javascript library for training Deep Learning models (Neural Networks) entirely in your browser. Open a tab and you're training. No software requirements, no compilers, no installations, no GPUs, no sweat.`
The description above on the homepage of ConvnetJs aptly describes this framework. This library is developed by a Ph.D. student at Stanford University. It was originally having support for Convolutional Neural Networks, but now it supports Common Neural Networks, Classification using SVM, L2 regularisation, and also Reinforcement Learning.

A very good visualization of CNN on CIFAR-10 dataset can be found [here](https://cs.stanford.edu/people/karpathy/convnetjs/demo/cifar10.html). It is done using JS and on your browser. It will help you better understand CNN.

**Link-** https://cs.stanford.edu/people/karpathy/convnetjs/

### Example

### *MNIST dataset digit recognition*

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8036pwq4wxbavnzjh5ae.PNG)
<hr>

Hope you all liked this article and will try some of these libraries for training your own neural networks.