Matlab优化工具箱,优化hessian

Matlab optimization toolbox, optimizing hessian

以前从未使用过这个工具箱,我有一个非常大的问题(即变量的数量)需要优化。我知道可以优化 hessian 计算,这是我的问题,因为出现错误:

Error using eye
Requested 254016x254016 (480.7GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may
take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.

但是根据这个引用(来自论坛),必须可以优化 hessian 计算:

If you are going to use the trust-region algorithm, you will need to choose some combination of the options 'Hessian', 'HessMult', and 'HessPattern' to avoid full, explicit computation of the Hessian.

我很难找到此设置的示例,有人知道吗?

我的问题是稀疏问题,如果需要此类信息。

基本上我确定有一些额外的选项可以放在一行中,例如:

option = optimoptions(@fminunc,...
    'Display','iter','GradObj','on','MaxIter',30,...
    'ObjectiveLimit',10e-10,'Algorithm','quasi-newton');

您可能需要将 'HessPattern',Hstr 添加到 optimoptions。给出一个例子here(本例中,Hstr定义在brownhstr.mat中;需要自己计算hessian稀疏模式矩阵Hstr)。