Idris2Doc : Data.Tensor.Softargmax

Data.Tensor.Softargmax

(source)

Definitions

logSumExp : Expa=>Orda=>Nega=>Foldable (Tensor [i]) =>AllAlgebra [i] a=>Tensor [i] a->Maybea
  Numerically stable log-sum-exp operation
LSE(x) = max(x) + log(Σᵢ exp(xᵢ - max(x)))
See https://gregorygundersen.com/blog/2020/02/09/log-sum-exp/

Totality: total
Visibility: public export
logSoftargmax : Expa=>Orda=>Nega=>Foldable (Tensor [i]) =>AllAlgebra [i] a=>Tensor [i] a->Tensor [i] a
  Log(softargmax(x)), but computationally efficient and numerically stable
Used for computing cross-entropy loss
Returns empty tensor for empty input

Totality: total
Visibility: public export
softargmaxImpl : Fractionala=>Expa=>Orda=>Nega=>IsFoldable (i.cont) =>AllAlgebra [i] a=> {default1_ : a} ->Tensor [i] a->Tensor [i] a
  Commonly known as 'softmax'
When `temperature=0` it reduces to `argmax`

Totality: total
Visibility: public export