syntax error >>> end with the code below

조회 수: 21 (최근 30일)
alexandre godard
alexandre godard 2018년 3월 18일
댓글: Rik 2018년 3월 18일
J = (1 / m) * sum(-y'*log(sigmoid(X * theta)) - (1-y)'*log( 1 - sigmoid(X * theta))) + (lambda/(2*m)) * sum(theta(2:length(theta)).*theta(2:length(theta))) ;
grad = (1 / m) * sum( X .* (sigmoid(X*theta) - y) ); grad (:,2:length(grad)) = grad(:,2:length(grad)) + (lambda/m)*theta(2:length(theta))';
% =============================================================
grad = grad(:) ;
end
  댓글 수: 1
Rik
Rik 2018년 3월 18일
Why would you use end here? It is reserved to close a switch block, if, for, while, classdef or function.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by