softmax: Calculate the softmax of a vector or matrix of values

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Calculate the softmax (normalized exponential) of a vector of values or a set of vectors stacked rowwise.

Usage

1

Arguments

x

numeric vector or matrix

Value

The softmax of x.

Examples

1
2
3
  dat <- matrix(runif(100, -1, 1), 25, 4)
  softmax(dat)
  softmax(dat[,1])

weecology/LDATS documentation built on March 28, 2020, 11:20 a.m.