mindflow.core.AdaHessian ========================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindscience/blob/master/docs/api_python/mindflow/core/mindflow.core.AdaHessian.rst :alt: 查看源文件 .. py:class:: mindflow.core.AdaHessian(params, learning_rate=1e-3, beta1=0.9, beta2=0.999, eps=1e-8, use_locking=False, use_nesterov=False, weight_decay=0.0, loss_scale=1.0, use_amsgrad=False, **kwargs) 二阶优化器 AdaHessian,利用 Hessian 矩阵对角元信息进行二阶优化求解。 有关更多详细信息,请参考论文 `ADAHESSIAN: An Adaptive Second Order Optimizer for Machine Learning `_ 。 相关 Torch 版本实现可参考 `Torch 版代码 `_ 。 此处 Hessian power 固定为 1,且对 Hessian 对角元做空间平均的方法与 Torch 实现的默认行为一致,描述如下: - 对于 1D 张量:不做空间平均; - 对于 2D 张量:做行平均; - 对于 3D 张量(假设为 1D 卷积):对最后一个维度做平均; - 对于 4D 张量(假设为 2D 卷积):对最后两个维度做平均。 参数说明详见 `mindspore.nn.Adam `_ 。