DEV Community

Cover image for Some more JavaScript libraries for Machine Learning 🤖
amananandrai
amananandrai

Posted on

Some more JavaScript libraries for Machine Learning 🤖

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.

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

Neon Glow

Alt Text


* Painting an Image using Neural Network*

Step 1

Alt Text

Step 2

Alt Text


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 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

Target seeking AI

Alt Text


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. A demo of movie recommender system using Mindjs can be found here.

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


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. 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


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


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. 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


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

Top comments (1)

Collapse
 
shadowtime2000 profile image
shadowtime2000

I think I am "the reader". It may be worth noting that Neatapic is no longer maintained and it doesn't seem Synaptic has had much activity in the last year. I've never heard of MLJS and CovnetJS but I think I will try them out!