Propel is a new JavaScript scientific computing library leveraging GPU hardware for computations to support machine learning and other scientific computing in JavaScript.
While Python is often the default language of choice for machine learning, JavaScript usage is growing in popularity. Propel strives to eliminate any computational computing gap between Python and JavaScript. Propel provides an approach similar to NumPy. Per the Propel project creator and original Node.js founder Ryan Dahl, "JavaScript is a fast, dynamic language which, we think, could act as an ideal workflow for scientific programmers of all sorts."
Dahl is not alone in this perspective, as many other projects are attempting to improve computational computing and machine learning in JavaScript including brain.js, ConvNetJS, deeplearn.js, math.js, mljs, Natural, Synaptic, and Webdnn. Propel runs in multiple environments, but for performance reasons, usage of Node.js is encouraged for computationally intensive computing.
Rather than starting from scratch, Propel leverages other foundational technologies. Propel works in the browser with WebGL and deeplearn.js. The Node.js version uses TensorFlow's C API and supports the targeting of multiple GPUs and TCP connections. The browser version of Propel is intended more for demonstration purposes or more straightforward calculations.
For machine learning usage, developers are encouraged to create machine learning models server-side and then quickly deploy them as web-based demos. The project provides an introductory neural network example. Propel is authored in TypeScript, and usage of ts-node is encouraged as it gives a TypeScript execution environment and REPL for Node.js.
Installation of Propel is straightforward. In Node.js, run the following from the command-line:
npm install propel
To see examples in Node.js, run the following from the command line:
npm install -g ts-node
./tools/build.js
ts-node ./example.ts
In browsers, include the optimized JavaScript package:
<script src="https://unpkg.com/propel@3.1.0"></script>
To use Propel within your Node.js or browser-based application source code, import the relevent modules from Propel using ES modules, e.g.:
import { grad, linspace, plot } from "propel";
Propel is early in its development lifecycle and has not yet reached a stable release. Contributions are welcome via the Propel GitHub project.