sustaining_gazes/matlab_version/face_validation/DeepLearnToolbox/util/softmax.m

12 lines
256 B
Mathematica
Raw Normal View History

2016-04-28 21:40:36 +02:00
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