recurrent-js-gpu
v1.4.9
Published
GPU-accelerated Deep Recurrent Neural Networks and LSTMs in Typescript. Ported, object-oriented and refactored version of Andrej Karpathy's recurrent-js (https://github.com/karpathy/recurrentjs)
Downloads
23
Maintainers
Readme
RECURRENT-js-GPU
RECURRENT-js-GPU is a GPU-supported, object-oriented Javascript library (baked with Typescript). It is a refactored port of Andrej Karpathy's RecurrentJS library that implements the following:
- Deep Recurrent Neural Networks (RNN)
- Long Short-Term Memory networks (LSTM)
- In fact, the library is more general because it has functionality to construct arbitrary expression graphs over which the library can perform automatic differentiation similar to what you may find in Theano for Python, or in Torch etc. Currently, the code uses this very general functionality to implement RNN/LSTM, but one can build arbitrary Neural Networks and do automatic backprop.
For further Information see the recurrentjs repository.
For Production Use
How to install as dependency
Download available @npm
: recurrent-js-gpu
Install via command line:
npm install --save recurrent-js-gpu
How To use the Library in Production
Currently exposed Classes:
Utility Classes:
- R - Collection of Utility functions
- Mat - Sophisticated Matrix Structure for Weights in Networks.
- RandMat -
Mat
populated with random gaussian distributed values - Graph - Graph holding the Operations
- NNModel - Genralized Class containing the Weights (and
Graph
) forRNN
andLSTM
- PreviousOutputs - Standardized Interface for parameter injection in forward-pass of
NNModel
s.
Network Classes:
- Net - Simple Neural Network
- RNN - Recurrent Neural Network. Extends
NNModel
. - LSTM - Long Short Term Memory Network. Extends
NNModel
.
These classes can be imported from this npm
module, e.g.:
import { Graph, Net } from 'recurrent-js-gpu';
For JavaScript usage require
classes from this npm
module as follows:
const Graph = require('recurrent-js-gpu').Graph;
const Net = require('recurrent-js-gpu').Net;
GPU-Accelerated Matrix-Operations
This project uses GPU-accelerated Matrix-Operations. The GPU-Kernel-functions are stored in a registry to optimize initialization timings and to ensure single-initialization.
Further Info for Production Usage
The transpiled Javascript-target is ES6
, with a CommonJS
module format.
For Contributors
Clone
this project to a working directory.npm install
to setup the development dependencies.- To compile the codebase:
tsc -p .
This project relies on Visual Studio Codes built-in Typescript linting facilities. It primarily follows the Google TypeScript Style-Guide through the provided tslint-google.json configuration file.
License
As of License-File: MIT