Propel, a new framework for machine learning: use JavaScript to do differentiable programming

Propel, a new framework for machine learning: use JavaScript to do differentiable programming

Taken from propelml.org

Machine Heart Compilation

Participation: Li Yazhou

This article introduces a new JavaScript machine learning framework Propel, which can be used in Node and in the browser. The following is an introduction to the use of this framework.

Link: http://propelml.org/

Propel provides a numpy-like infrastructure for the GPU backend in JavaScript. As a fast and dynamic language, JavaScript can be used as an ideal workflow for all scientific programmers.

Propel can run in the browser and Node. In both environments, Propel can use GPU hardware to accelerate calculations. In the browser, it can use WebG through deeplearn.js, and on Node, it can use TensorFlow's C API.

  1. import { grad, linspace, plot  } from "propel";

  2. f = x => x.tanh();

  3. x = linspace(-4, 4, 200);

  4. plot(x, f(x),

  5.     x, grad(f)(x),

  6.     x, grad(grad(f))(x),

  7.     x, grad(grad(grad(f)))(x),

  8.     x, grad(grad(grad(grad(f))))(x))

Propel has an important autograd-style API, which is different from TensorFlow. During operation, the calculation graph will be tracked, and a general gradient function provides a simple excuse for backpropagation.

The browser is a great demo, but it is not a powerful digital platform. WebGL is far from CUDA. By running Propel outside the browser, users can target multiple GPUs and make TCP connections. The model developed on the server side can be more easily deployed as an HTML demo.

The basic Propel npm package is only Javasript, there is no TensorFlow bundle. To increase speed, you can install:

  1. npm install propel_mac

  2. npm install propel_windows

  3. npm install propel_linux

  4. npm install propel_linux_gpu

Use Propel in Node:

  1. npm install propel

  2. import { grad } from "propel";

Use Propel in the browser:

  1. <script src="https://unpkg.com/propel@3.0.0"></script>

This article is compiled by the heart of the machine, please contact this official account for authorization for reprinting .

------------------------------------------------

Join the heart of the machine (full-time reporter/intern): hr@jiqizhixin.com

Contribute or seek reports: content@jiqizhixin.com

Advertising & business cooperation: bd@jiqizhixin.com