tfjs-special
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

TensorFlow.js Special Math

TensorFlow.js Special Math implements all the special math functions from TensorFlow, those are the Gamma, Beta, Bessel, and Error functions, as well as all the variations that TensorFlow provides.

These functions are essential in properbility distributions and for solving partial differential equations, and may other advanced mathmatical fields.

All the functions are:

  • implemented in both WebGL and JavaScript.
  • have defined gradients and supports tf.grad().
  • are TypeScript compatible with TensorFlow.js.
  • transpiled from cephes, the same library used by SciPy.

Example

const tfc = require('@tensorflow/tfjs-core');
const tfs = require('tfjs-special');

const x = tfc.tensor1d([1, 2, 3, 4]);

const gamma = (tensor) => tfs.lgamma(tensor).exp();
const gammadx = tfc.grad(gamma);
gammadx(x).print();

Documentation

Readme

Keywords

none

Package Sidebar

Install

npm i tfjs-special

Weekly Downloads

3

Version

1.0.0

License

BSD-3-Clause

Unpacked Size

2.73 MB

Total Files

191

Last publish

Collaborators

  • andreasmadsen