Skip to content

Commit

Permalink
clean docs (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon authored Feb 27, 2020
1 parent d856989 commit b941845
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/source/hooks.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Hooks
=======
This is the order in which lightning calls the hooks. You can override each for custom behavior.
.. automodule:: pytorch_lightning.core.hooks

Full list of hooks
------------------

Training set-up
--------------------
===============
- init_ddp_connection
- init_optimizers
- configure_apex
Expand All @@ -15,7 +16,7 @@ Training set-up
- restore_weights

Training loop
--------------------
=============

- on_epoch_start
- on_batch_start
Expand All @@ -29,7 +30,7 @@ Training loop
- on_epoch_end

Validation loop
--------------------
===============

- model.zero_grad()
- model.eval()
Expand All @@ -41,7 +42,7 @@ Validation loop
- on_post_performance_check

Test loop
------------
=========

- model.zero_grad()
- model.eval()
Expand Down
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ PyTorch-Lightning Documentation
:caption: Python API

callbacks
hooks
lightning-module
loggers
trainer


.. toctree::
:maxdepth: 1
:name: Examples
Expand Down
3 changes: 3 additions & 0 deletions pytorch_lightning/core/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
To enable a hook, simply override the method in your LightningModule and the trainer will call it at the correct time.
**Contributing** If there's a hook you'd like to add, simply:
1. Fork PyTorchLightning.
2. Add the hook :py:mod:`pytorch_lightning.base_module.hooks.py`.
3. Add the correct place in the :py:mod:`pytorch_lightning.models.trainer` where it should be called.
"""
Expand Down

0 comments on commit b941845

Please sign in to comment.