Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改COPY-FROM No. 15 regularizer #54926

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/paddle/regularizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class L1Decay(WeightDecayRegularizer):

Examples:
.. code-block:: python
:name: code-example1

# Example1: set Regularizer in optimizer
import paddle
Expand All @@ -84,6 +85,9 @@ class L1Decay(WeightDecayRegularizer):
momentum.step()
momentum.clear_grad()

.. code-block:: python
:name: code-example2

# Example2: set Regularizer in parameters
# Set L1 regularization in parameters.
# Global regularizer does not take effect on my_conv2d for this case.
Expand Down Expand Up @@ -172,6 +176,7 @@ class L2Decay(WeightDecayRegularizer):

Examples:
.. code-block:: python
:name: code-example1

# Example1: set Regularizer in optimizer
import paddle
Expand All @@ -190,6 +195,8 @@ class L2Decay(WeightDecayRegularizer):
momentum.step()
momentum.clear_grad()

.. code-block:: python
:name: code-example2
# Example2: set Regularizer in parameters
# Set L2 regularization in parameters.
# Global regularizer does not take effect on my_conv2d for this case.
Expand Down