Skip to content

Instantly share code, notes, and snippets.

@vladimir-ivanov
Created June 27, 2016 20:22
Show Gist options
  • Save vladimir-ivanov/c1a3ec9af07e817a8f9f5b0c21562224 to your computer and use it in GitHub Desktop.
Save vladimir-ivanov/c1a3ec9af07e817a8f9f5b0c21562224 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