Idris2Doc : Data.Tensor.Softargmax

Data.Tensor.Softargmax

(source)

Definitions

logSumExp : Exp a => Ord a => Neg a => Foldable (Tensor [i]) => Tensor [i] a -> Maybe a
  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 : Exp a => Ord a => Neg a => Foldable (Tensor [i]) => 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 : Fractional a => Exp a => Ord a => Neg a => IsFoldable (i .cont) => {default 1 _ : a} -> Tensor [i] a -> Tensor [i] a
  Commonly known as 'softmax'
As `temperature->0` it reduces to `argmax`
TODO fix numerics when temperature=0

Totality: total
Visibility: public export