2016年1月1日金曜日

Cousera Machine Learning / week5-5 めも

Gradient Checking

epsilon = 1e-4;
for i = 1:n,
  thetaPlus = theta;
  thetaPlus(i) += epsilon;
  thetaMinus = theta;
  thetaMinus(i) -= epsilon;
  gradApprox(i) = (J(thetaPlus) - J(thetaMinus))/(2*epsilon)
end;

次をチェックする
gradApprox ≈ DVec

0 件のコメント:

コメントを投稿