From 0860e0a81c42ac09fe8fe3b3e6f820bd23e5ef52 Mon Sep 17 00:00:00 2001 From: ChenXin Date: Tue, 7 May 2019 14:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=86=97=E4=BD=99=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/source/fastNLP.models.char_language_model.rst | 7 ------- docs/source/fastNLP.models.rst | 1 - docs/source/fastNLP.modules.dropout.rst | 7 ------- docs/source/fastNLP.modules.encoder.linear.rst | 7 ------- docs/source/fastNLP.modules.encoder.rst | 1 - docs/source/fastNLP.modules.other_modules.rst | 7 ------- docs/source/fastNLP.modules.utils.rst | 7 ------- fastNLP/core/callback.py | 4 +++- 8 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 docs/source/fastNLP.models.char_language_model.rst delete mode 100644 docs/source/fastNLP.modules.dropout.rst delete mode 100644 docs/source/fastNLP.modules.encoder.linear.rst delete mode 100644 docs/source/fastNLP.modules.other_modules.rst delete mode 100644 docs/source/fastNLP.modules.utils.rst diff --git a/docs/source/fastNLP.models.char_language_model.rst b/docs/source/fastNLP.models.char_language_model.rst deleted file mode 100644 index 8cfc9e6e..00000000 --- a/docs/source/fastNLP.models.char_language_model.rst +++ /dev/null @@ -1,7 +0,0 @@ -fastNLP.models.char\_language\_model module -=========================================== - -.. automodule:: fastNLP.models.char_language_model - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.models.rst b/docs/source/fastNLP.models.rst index ae4abf7a..24fca203 100644 --- a/docs/source/fastNLP.models.rst +++ b/docs/source/fastNLP.models.rst @@ -14,7 +14,6 @@ Submodules fastNLP.models.base_model fastNLP.models.bert fastNLP.models.biaffine_parser - fastNLP.models.char_language_model fastNLP.models.cnn_text_classification fastNLP.models.enas_controller fastNLP.models.enas_model diff --git a/docs/source/fastNLP.modules.dropout.rst b/docs/source/fastNLP.modules.dropout.rst deleted file mode 100644 index f525e08f..00000000 --- a/docs/source/fastNLP.modules.dropout.rst +++ /dev/null @@ -1,7 +0,0 @@ -fastNLP.modules.dropout module -============================== - -.. automodule:: fastNLP.modules.dropout - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.linear.rst b/docs/source/fastNLP.modules.encoder.linear.rst deleted file mode 100644 index 7a479ca2..00000000 --- a/docs/source/fastNLP.modules.encoder.linear.rst +++ /dev/null @@ -1,7 +0,0 @@ -fastNLP.modules.encoder.linear module -===================================== - -.. automodule:: fastNLP.modules.encoder.linear - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.modules.encoder.rst b/docs/source/fastNLP.modules.encoder.rst index 3ee246c2..e571331d 100644 --- a/docs/source/fastNLP.modules.encoder.rst +++ b/docs/source/fastNLP.modules.encoder.rst @@ -15,7 +15,6 @@ Submodules fastNLP.modules.encoder.char_encoder fastNLP.modules.encoder.conv_maxpool fastNLP.modules.encoder.embedding - fastNLP.modules.encoder.linear fastNLP.modules.encoder.lstm fastNLP.modules.encoder.star_transformer fastNLP.modules.encoder.transformer diff --git a/docs/source/fastNLP.modules.other_modules.rst b/docs/source/fastNLP.modules.other_modules.rst deleted file mode 100644 index c1bba5fb..00000000 --- a/docs/source/fastNLP.modules.other_modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -fastNLP.modules.other\_modules module -===================================== - -.. automodule:: fastNLP.modules.other_modules - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/fastNLP.modules.utils.rst b/docs/source/fastNLP.modules.utils.rst deleted file mode 100644 index b7eb672e..00000000 --- a/docs/source/fastNLP.modules.utils.rst +++ /dev/null @@ -1,7 +0,0 @@ -fastNLP.modules.utils module -============================ - -.. automodule:: fastNLP.modules.utils - :members: - :undoc-members: - :show-inheritance: diff --git a/fastNLP/core/callback.py b/fastNLP/core/callback.py index a6cc3402..0a2d052f 100644 --- a/fastNLP/core/callback.py +++ b/fastNLP/core/callback.py @@ -293,7 +293,8 @@ class CallbackManager(Callback): class GradientClipCallback(Callback): - """每次backward前,将parameter的gradient clip到某个范围。 + """ + 每次backward前,将parameter的gradient clip到某个范围。 :param None,torch.Tensor,List[torch.Tensor] parameters: 一般通过model.parameters()获得。如果为None则默认对Trainer 的model中所有参数进行clip @@ -304,6 +305,7 @@ class GradientClipCallback(Callback): 2 'value', 将gradient限制在[-clip_value, clip_value], 小于-clip_value的gradient被赋值为-clip_value; 大于clip_value的gradient被赋值为clip_value. + """ def __init__(self, parameters=None, clip_value=1, clip_type='norm'):