This commit is contained in:
Morten Hjorth-Jensen
2023-05-03 11:48:50 -04:00
parent 356abdcde9
commit ceb79267af
3 changed files with 298 additions and 2 deletions
+9
View File
@@ -0,0 +1,9 @@
import jax.numpy as jnp
from jax import grad, jit, vmap
def sum_logistic(x):
return jnp.sum(1.0 / (1.0 + jnp.exp(-x)))
x_small = jnp.arange(3.)
derivative_fn = grad(sum_logistic)
print(derivative_fn(x_small))