mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2026-05-12 18:32:30 +00:00
12 lines
256 B
Matlab
12 lines
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 |