R/softmax.R

Defines functions softmax

Documented in softmax

softmax <-
function(eta,
                    X){
  Xmatrix <- as.matrix(X)
  exp_value <- exp(Xmatrix%*%eta)
  
  softmax_value <- exp_value/apply(exp_value,1,sum)
  
  return(softmax_value)
}

Try the EMSNM package in your browser

Any scripts or data that you put into this service are public.

EMSNM documentation built on May 2, 2019, 1:41 p.m.