Files
open_dbm/pkg/OpenFace/model_training/CCNF/CCNF/lib/CalcbCCNF.m
2020-08-04 19:12:31 -04:00

15 lines
398 B
Matlab

function b = CalcbCCNF( alpha, theta, x, resps)
%CALCBCCNF Compute the b from CCNF equation
% Either responses from the neural layers are precomputed and provided
% in resps or need to compute it yourself
if(nargin < 4)
X = [ones(size(x,1),1), x];
h1 = 1./(1 + exp(-theta * X'));
b = (2 * alpha' * h1)';
else
b = (2 * alpha' * resps)';
end
end