Review on andrew ng's lectures

本文介绍了Octave中的Fmincg函数,这是一个用于计算梯度下降的工具。通过设置参数,如迭代次数等,该函数可以优化成本函数,返回成本值及梯度。示例中展示了如何使用此函数进行参数优化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值