built in operator: softmax
description:
softmax sp
implement the softmax function
algorithm:
see: https://en.wikipedia.org/wiki/Softmax_function
examples:
-- let's consider a Gaussian:
Gaussian[0.7] |age: 40>
0.017|age: 36> + 0.047|age: 37> + 0.13|age: 38> + 0.36|age: 39> + |age: 40> + 0.36|age: 41> + 0.13|age: 42> + 0.047|age: 43> + 0.017|age: 44>
bar-chart[50] Gaussian[0.7] |age: 40>
----------
age: 36 :
age: 37 : ||
age: 38 : ||||||
age: 39 : ||||||||||||||||||
age: 40 : ||||||||||||||||||||||||||||||||||||||||||||||||||
age: 41 : ||||||||||||||||||
age: 42 : ||||||
age: 43 : ||
age: 44 :
----------
-- now softmax it:
softmax Gaussian[0.7] |age: 40>
0.085|age: 36> + 0.087|age: 37> + 0.095|age: 38> + 0.12|age: 39> + 0.227|age: 40> + 0.12|age: 41> + 0.095|age: 42> + 0.087|age: 43> + 0.085|age: 44>
bar-chart[50] softmax Gaussian[0.7] |age: 40>
----------
age: 36 : ||||||||||||||||||
age: 37 : |||||||||||||||||||
age: 38 : ||||||||||||||||||||
age: 39 : ||||||||||||||||||||||||||
age: 40 : ||||||||||||||||||||||||||||||||||||||||||||||||||
age: 41 : ||||||||||||||||||||||||||
age: 42 : ||||||||||||||||||||
age: 43 : |||||||||||||||||||
age: 44 : ||||||||||||||||||
----------
softmax (|a> + 2|b> + 3|c> + 4|d> + 5|e> + 6|f>)
0.004|a> + 0.012|b> + 0.032|c> + 0.086|d> + 0.233|e> + 0.634|f>
see also:
rescale, srescale, normalize, snormalize
Home