From b5de8e987e41bd07db14feaf683f0d98121bc449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=A8=8B=E6=B5=A9?= Date: Fri, 29 Apr 2022 02:04:13 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AD=E8=8B=B1=E6=96=87ap?= =?UTF-8?q?i=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/api_python/nn/mindspore.nn.thor.rst | 2 +- mindspore/python/mindspore/nn/optim/thor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/api_python/nn/mindspore.nn.thor.rst b/docs/api/api_python/nn/mindspore.nn.thor.rst index 1044b4bc88c..e66e7fc4999 100644 --- a/docs/api/api_python/nn/mindspore.nn.thor.rst +++ b/docs/api/api_python/nn/mindspore.nn.thor.rst @@ -1,7 +1,7 @@ mindspore.nn.thor ================== -.. py:function:: mindspore.nn.thor(net, learning_rate, damping, momentum, weight_decay=0.0, loss_scale=1.0, batch_size=32, use_nesterov=False, decay_filter= at 0x0000029724CFA048>, split_indices=None, enable_clip_grad=False, frequency=100) +.. py:function:: mindspore.nn.thor(net, learning_rate, damping, momentum, weight_decay=0.0, loss_scale=1.0, batch_size=32, use_nesterov=False, decay_filter=lambda x: x.name not in [], split_indices=None, enable_clip_grad=False, frequency=100) 通过二阶算法THOR更新参数。 diff --git a/mindspore/python/mindspore/nn/optim/thor.py b/mindspore/python/mindspore/nn/optim/thor.py index 501db82a259..31c5a7b4c16 100644 --- a/mindspore/python/mindspore/nn/optim/thor.py +++ b/mindspore/python/mindspore/nn/optim/thor.py @@ -325,9 +325,9 @@ def thor(net, learning_rate, damping, momentum, weight_decay=0.0, loss_scale=1.0 TypeError: If `loss_scale`, `momentum` or `frequency` is not a float. TypeError: If `weight_decay` is neither float nor int. TypeError: If `use_nesterov` is not a bool. + TypeError: If `frequency` is not int. ValueError: If `loss_scale` is less than or equal to 0. ValueError: If `weight_decay` or `momentum` is less than 0. - ValueError: If `frequency` is not int. ValueError: If `frequency` is less than 2. Supported Platforms: