This post is also available in: العربية (Arabic)
What is a Framework?
A framework is a platform for developing software applications. It provides a foundation on which software developers can build programs for a specific platform. For example, a framework may include predefined classes and functions that can be used to process input, manage hardware devices, and interact with system software. This helps in streamlining the development process since programmers don’t need to rewrite the code each time they develop a new application.
Feedforward Neural Network: A Feedforward Neural Network is an artificial neural network wherein connections between the nodes do not form a cycle. As such, it is different from its descendent recurrent neural networks.
The Feedforward neural network was the first and simplest type of neural network devised. In this network, the information moves in only one direction – forward – from the input nodes, through the hidden nodes (if any) and to the output nodes. There are no cycles or loops in the network.
Long Short-Term Memory (LSTM): Long Short-Term Memory (LSTM) network is an artificial recurrent neural network (RNN) architecture used in the field of Deep Learning. Unlike standard Feedforward neural networks, LSTM has feedback connections. It can not only process single data points (such as images), but also entire sequences of data (such as speech or video). For example, LSTM is applicable to tasks such as unsegmented, connected handwriting recognition, speech recognition and anomaly detection in network traffic or IDSs (Intrusion Detection Systems).
A common LSTM unit is composed of a cell, an input gate, an output gate and a forget gate. The cell remembers values over arbitrary time intervals and the three gates regulate the flow of information into and out of the cell.
LSTM networks are well-suited to classifying, processing and making predictions based on time series data, since there can be lags of unknown durations between important events in a time series. LSTMs were developed to deal with the vanishing gradient problem that can be encountered when training traditional RNNs. Relative insensitivity to gap length is an advantage of LSTM over RNNs
Recurrent Neural Network (RNN): A Recurrent Neural Network is a class of artificial neural networks where connections between nodes form a directed graph along a temporal sequence. This allows it to exhibit temporal dynamic behaviour. Derived from Feedforward Neural Networks, RNNs can use their internal state (memory) to process variable length sequences of inputs. This makes them applicable to tasks such as unsegmented, connected handwriting recognition, or speech recognition.
The term “Recurrent Neural Network” is used indiscriminately to refer to two broad classes of networks with a similar general structure, where one is finite impulse and the other is infinite impulse. Both classes of networks exhibit temporal dynamic behaviour. A finite recurrent network is a directed acyclic graph that can be unrolled and replaced with a strictly feedforward neural network, while an infinite recurrent network is a directed cyclic graph that cannot be unrolled.
Both finite impulse and infinite impulse recurrent networks can have traditional stored states, and the storage can be under direct control by the neural network. The storage can also be replaced by another network or graph, if that incorporates time delays or has feedback loops. Such controlled states are referred to as gated state or gated memory, and are part of Long Short-Term Memory Networks (LSTMs) and gated recurrent units. This is also called Feedback Neural Network (FNN).
The framework greatly simplifies building and training Neural Networks to just a few lines of code eliminating much of the math and jargon needed to fully understand the theoretical aspect of the model.
Brain.js supports a few different Neural Network types like Feedforward (ANN) and LSTM (Long Short Term Memory) network.
It is well suited for creating and training your network. You can build a network by specifying layers of various types. As one of the types is convolutional, you can build networks that recognize images. However, convolutional image recognizers aren’t the only possibility and you can create general classifiers, regression prediction networks, and more.
Once you have the network definition you can train it using backprop or to minimize a sum of squared errors to learn arbitrary data in regression applications.
There is also a MagicNet training class that handles the training automatically for you. If you want to be cutting edge then you could even try out the Deep Q reinforcement learning class to see if you learn to play games given only the outcome.
If you just want to see neural networks in action there are nine demos that you can run in your browser. They are also very well presented. You get a graph of the error (Loss) as the network trains and you can change the usual learning parameters dynamically. Scrolling down reveals a section that provides insights into how the network is doing the job. You can see the features being used to distinguish between the examples. Finally you get a sample of the network’s performance based on what it does to a number of test series.
It is a framework aiming to be a compromise between speed and accuracy. The aim is to have a client-side parsing library so fast that it can run as you’re typing while still providing relevant results.
The ml5.js provides immediate access in the browser to pre-trained models for detecting human poses, generating text, styling an image with another, composing music, pitch detection, and common English language word relationships, and much more.
Which of these frameworks will you use in your next ML project?