완료
This commit is contained in:
@@ -20,8 +20,10 @@ grad = zeros(size(theta));
|
||||
% Note: grad should have the same dimensions as theta
|
||||
%
|
||||
|
||||
hx = sigmoid(X*theta);
|
||||
J = sum(-y.*log(hx) - (1.-y).*log(1.-hx))/m;
|
||||
|
||||
|
||||
grad = sum((hx-y).*X)/m;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user