Skip to content

Instantly share code, notes, and snippets.

@sohailalam2
Forked from vladimir-ivanov/softmax.js
Created January 18, 2017 14:51
Show Gist options
  • Save sohailalam2/b257bbfd586b55c00ae9b47bf1099dc2 to your computer and use it in GitHub Desktop.
Save sohailalam2/b257bbfd586b55c00ae9b47bf1099dc2 to your computer and use it in GitHub Desktop.
softmax function implementation in js
let softmax = (arr) => (index) => Math.exp(arr[index]) / arr.map(y => Math.exp(y)).reduce((a, b) => a + b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment