Skip to content

Instantly share code, notes, and snippets.

@mwitiderrick
Created July 14, 2022 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwitiderrick/7ccbaeee2863e970af49ff1f1d2537b3 to your computer and use it in GitHub Desktop.
Save mwitiderrick/7ccbaeee2863e970af49ff1f1d2537b3 to your computer and use it in GitHub Desktop.
predictions = jnp.array([0.50,0.60,0.70,0.30,0.25])
targets = jnp.array([0.20,0.30,0.10,0.20,0.2])
optax.cosine_distance(predictions,targets,epsilon=0.7)
# DeviceArray(0.4128204, dtype=float32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment