Skip to content

Instantly share code, notes, and snippets.

@ry
Created January 19, 2018 04:56
Show Gist options
  • Save ry/8d13366cd3ce53e7910d91cf1cc929c8 to your computer and use it in GitHub Desktop.
Save ry/8d13366cd3ce53e7910d91cf1cc929c8 to your computer and use it in GitHub Desktop.
import { grad, linspace, plot } from "propel";
f = x => x.tanh();
x = linspace(-4, 4, 200);
plot(x, f(x),
x, grad(f)(x),
x, grad(grad(f))(x),
x, grad(grad(grad(f)))(x),
x, grad(grad(grad(grad(f))))(x))
(async (__global, __import) => {
void (({_:{grad:__global.grad},_:{linspace:__global.linspace},_:{plot:__global.plot}} = {_:await __import("propel")}))
f = x => x.tanh();
x = linspace(-4, 4, 200);
return (plot(x, f(x),
x, grad(f)(x),
x, grad(grad(f))(x),
x, grad(grad(grad(f)))(x),
x, grad(grad(grad(grad(f))))(x)))
})
//# sourceURL=__cell1__.js
@geremachek
Copy link

x.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment