sustaining_gazes/matlab_version/face_validation/DeepLearnToolbox/util/softmax.m
2016-04-28 15:40:36 -04:00

12 lines
No EOL
256 B
Matlab

function mu = softmax(eta)
% Softmax function
% mu(i,c) = exp(eta(i,c))/sum_c' exp(eta(i,c'))
% This file is from matlabtools.googlecode.com
c = 3;
tmp = exp(c*eta);
denom = sum(tmp, 2);
mu = bsxfun(@rdivide, tmp, denom);
end