Skip to content

Commit d1529c2

Browse files
akihironittacarmoccaawaelchli
authored
Optimization docs (#6907)
* . * . * Fix link to the section * Fix link to the section * Consistent indent * Update docs * Apply suggestions from code review Co-authored-by: Carlos Mocholí <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]> * Add note for optimizer.optimizer * . * Update hooks * Update closure docstring * Update optimizer methods * Update optimizer * Remove manopt + grad clipping (by @flukeskywalker) Co-authored-by: Carlos Mocholí <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
1 parent 2b232d3 commit d1529c2

File tree

5 files changed

+454
-320
lines changed

5 files changed

+454
-320
lines changed

docs/source/common/lightning_module.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,12 @@ log_dict
698698
.. automethod:: pytorch_lightning.core.lightning.LightningModule.log_dict
699699
:noindex:
700700

701+
manual_backward
702+
~~~~~~~~~~~~~~~
703+
704+
.. automethod:: pytorch_lightning.core.lightning.LightningModule.manual_backward
705+
:noindex:
706+
701707
print
702708
~~~~~
703709

@@ -916,7 +922,10 @@ True if using Automatic Mixed Precision (AMP)
916922

917923
automatic_optimization
918924
~~~~~~~~~~~~~~~~~~~~~~
919-
When set to ``False``, Lightning does not automate the optimization process. This means you are responsible for handling your optimizers. However, we do take care of precision and any accelerators used.
925+
When set to ``False``, Lightning does not automate the optimization process. This means you are responsible for handling
926+
your optimizers. However, we do take care of precision and any accelerators used.
927+
928+
See :ref:`manual optimization<common/optimizers:Manual optimization>` for details.
920929

921930
.. code-block:: python
922931
@@ -931,7 +940,9 @@ When set to ``False``, Lightning does not automate the optimization process. Thi
931940
self.manual_backward(loss)
932941
opt.step()
933942
934-
This is recommended only if using 2+ optimizers AND if you know how to perform the optimization procedure properly. Note that automatic optimization can still be used with multiple optimizers by relying on the ``optimizer_idx`` parameter. Manual optimization is most useful for research topics like reinforcement learning, sparse coding, and GAN research.
943+
This is recommended only if using 2+ optimizers AND if you know how to perform the optimization procedure properly. Note
944+
that automatic optimization can still be used with multiple optimizers by relying on the ``optimizer_idx`` parameter.
945+
Manual optimization is most useful for research topics like reinforcement learning, sparse coding, and GAN research.
935946

936947
.. code-block:: python
937948
@@ -1086,13 +1097,6 @@ get_progress_bar_dict
10861097
.. automethod:: pytorch_lightning.core.lightning.LightningModule.get_progress_bar_dict
10871098
:noindex:
10881099

1089-
manual_backward
1090-
~~~~~~~~~~~~~~~
1091-
1092-
.. automethod:: pytorch_lightning.core.lightning.LightningModule.manual_backward
1093-
:noindex:
1094-
1095-
10961100
on_after_backward
10971101
~~~~~~~~~~~~~~~~~
10981102

0 commit comments

Comments
 (0)