【发布时间】:2011-10-28 03:36:14
【问题描述】:
f = @(w) sum(log(1 + exp(-t .* (phis * w'))))/size(phis, 1) + coef * w*w';
options = optimset('Display', 'notify', 'MaxFunEvals', 2e+6, 'MaxIter', 2e+6);
w = fminunc(f, ones(1, size(phis, 2)), options);
- phis 大小为 NxN+1
- t 大小为 Nx1
- coef 是 const
我正在尝试最小化函数 f,首先我使用的是 fminsearch 但它工作了很长时间,这就是我现在使用 fminunc 的原因,但有一个问题:我需要函数梯度来加速。你能帮我构造函数f的渐变吗,因为我总是收到这个警告:
Warning: Gradient must be provided for trust-region algorithm;
using line-search algorithm instead.
【问题讨论】:
标签: algorithm math matlab gradient