Javascript developers tend to look out for Javascript frameworks which can be used to train machine learning models based on different machine learning algorithms. The following are some of the machine learning algorithms using which models can be trained using different javascript frameworks listed in this article:
- Simple linear regression
- Multi-variate linrear regression
- Logistic regression
- Naive-bayesian
- K-nearest neighbour (KNN)
- K-means
- Support vector machine (SVM)
- Random forest
- Decision tree
- Feedforward neural network
- Deep learning network
In this post, you will learn about different Javascsript framework for machine learning. They are some of the following:
DeepLearn.js
Deeplearn.js is an open-source machine learning Javascript library by Google which can be used for different purpose such as as training neural networks in browser, understanding ML models, for education purpose etc. You can run pre-trained models in inference mode. One can write the code in Typescript (ES6 Javascript) or ES5 Javascript. One can get started very quickly by including following code within head tag in HTML file and write JS programs for building the model.
<script src="https://cdn.jsdelivr.net/npm/deeplearn@latest"></script> <!-- or --> <script src="https://unpkg.com/deeplearn@latest"></script>
PropelJS
Propel, a Javascrupt library, provides a GPU-backed numpy-like infrastructure for scientific computing. It could be used for both, NodeJS app as well as in browser. The following is the setup code for browser:
<script src="https://unpkg.com/propel@3.1.0"></script>
The following code can be used for NodeJS app:
npm install propel import { grad } from "propel";
Here is the documentation for PropelJS (Propel Doc). Here is the Github page for Propel
ML-JS
ML-JS provides machine learning tools for working with NodeJS and browser. The ML JS tool can be setup using following code:
<script src="https://www.lactame.com/lib/ml/2.2.0/ml.min.js"></script>
The following machine learning algorithms are supported:
- Unsupervised learning
- Supervised learning
- Artificial neural network
ConvNetJS
ConvNetJS is a Javascript library for training Deep Learning models (Neural Networks) entirely in your browser. This library can also be used in NodeJS app.
In order to get started, get the minified version of ConvNetJS from this page, ConvNetJS minified library. This is a release page for ConvNetJS.
<script src="convnet-min.js"></script>
The following are some important pages:
KerasJS
With KerasJS, you can run Keras models in the browser, with GPU support using WebGL. Models can also be run in Node.js, but only in CPU mode. Here is the Github page on Keras. The following is the list of Keras models which can be run in the browser:
- Basic Convnet for MNIST
- Convolutional Variational Autoencoder, trained on MNIST
- Auxiliary Classifier Generative Adversarial Networks (AC-GAN) on MNIST
- 50-layer Residual Network, trained on ImageNet
- Inception v3, trained on ImageNet
- DenseNet-121, trained on ImageNet
- SqueezeNet v1.1, trained on ImageNet
- Bidirectional LSTM for IMDB sentiment classification
STDLib
STDLib is a Javascript library which can be used to build advanced statistical models and machine learning libraries. It can also be used for plotting and graphics functionality for data visualization and exploratory data analysis.
The following is a list of libraries in relation to ML:
- Linear regression via Stochastic gradient descent (@stdlib/ml/online-sgd-regression)
- Binary classification via Stochastic gradient descent (@stdlib/ml/online-binary-classification)
- Natural language processing (@stdlib/nlp)
Limdu.js
Limdu.js is a machine-learning framework for Node.js. It supports some of the following:
- Binary classification
- Multi-label classification
- Feature engineering
- SVM
One can go about installing limdu.js using following command:
npm install limdu
Brain.js
Brain.js is a set of Javascript libraries for training neural networks and Naive-bayesian classifier. The following can be used to setup Brain.js:
npm install brain.js
One can also include the library in browser using the following code:
<script src="https://raw.githubusercontent.com/harthur-org/brain.js/master/browser.js"></script>
The following can be used to install Naive-bayesian classifier:
npm install classifier
Summary
In this post, you learned about different Javascript library which can be used for training machine learning models in Browser or Nodejs app. For articles on machine learning, we recommend you check out our machine learning archives.
Did you find this article useful? Do you have any questions or suggestions about this article in relation to Javascript frameworks for machine learning? Leave a comment and ask your questions and I shall do my best to address your queries.
- LLMs for Adaptive Learning & Personalized Education - October 8, 2024
- Sparse Mixture of Experts (MoE) Models: Examples - October 6, 2024
- Anxiety Disorder Detection & Machine Learning Techniques - October 4, 2024
I found it very helpful. However the differences are not too understandable for me