Review on andrew ng's lectures

Fmincg  function

It's a OCTAVE function. It can be helped to calculate the gradient decent.
Example:

options = optimset('GradObj','on','MaxIter',number_of_iterations);
theta = fmincg((@t)cost_function_name(t,X,y),initial_theta, options);

on the above example ,the cost function should return [ J_value , grad ] and its first parametre should be theta . J_value means the cost and grad means the  derivative of the cost function.

About debuging

(1)When our algorithm's outcome is not feeling right. We can print the size of the transistion matrix.

猜你喜欢

转载自blog.csdn.net/frostmonarch/article/details/80020708