syntax error >>> end with the code below

2 ビュー (過去 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 Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by