📄 loglikelihood.m
字号:
function ll = loglikelihood(theta, features, h, center_point, cp_target)
% Used by the polynomial fitting algorithm
[c,r] = size(features);
features = center_point * ones(1,r) - features;
K = exp(-(features(1,:).^2+features(2,:).^2)/(2*h))/(2*pi*h);
f = 1./(1 + exp(-theta(1:2)'*features - theta(3)));
if isempty(find(f==0))
L = log(f);
ll = -sum(K.*(cp_target.*L+~cp_target.*(1-L)));
else
ll = nan;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -