Skip to content

Commit

Permalink
update documentation for callbacks (#4253)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchaton committed Oct 20, 2020
1 parent 829d90b commit 09c2f4a
Showing 1 changed file with 112 additions and 70 deletions.
182 changes: 112 additions & 70 deletions docs/source/callbacks.rst
Expand Up @@ -134,170 +134,212 @@ The following are best practices when using/designing callbacks.
Available Callback hooks
------------------------

on_epoch_start
setup
^^^^^

.. automethod:: pytorch_lightning.callbacks.Callback.setup
:noindex:

teardown
^^^^^^^^

.. automethod:: pytorch_lightning.callbacks.Callback.teardown
:noindex:

on_init_start
^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_epoch_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_init_start
:noindex:

on_epoch_end
^^^^^^^^^^^^
on_init_end
^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_epoch_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_init_end
:noindex:

on_fit_start
^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_fit_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_save_checkpoint
:noindex:

on_fit_end
^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_fit_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_fit_end
:noindex:

on_save_checkpoint
on_sanity_check_start
^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.callbacks.Callback.on_sanity_check_start
:noindex:

on_sanity_check_end
^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.callbacks.Callback.on_sanity_check_end
:noindex:

on_train_batch_start
^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.callbacks.Callback.on_train_batch_start
:noindex:

on_train_batch_end
^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.CheckpointHooks.on_save_checkpoint
.. automethod:: pytorch_lightning.callbacks.Callback.on_train_batch_end
:noindex:

on_load_checkpoint
on_train_epoch_start
^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.callbacks.Callback.on_train_epoch_start
:noindex:

on_train_epoch_end
^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.CheckpointHooks.on_load_checkpoint
.. automethod:: pytorch_lightning.callbacks.Callback.on_train_epoch_end
:noindex:

on_pretrain_routine_start
on_validation_epoch_start
^^^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_pretrain_routine_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_validation_epoch_start
:noindex:

on_pretrain_routine_end
on_validation_epoch_end
^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_pretrain_routine_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_validation_epoch_end
:noindex:

on_test_batch_start
on_test_epoch_start
^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_test_batch_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_test_epoch_start
:noindex:

on_test_batch_end
on_test_epoch_end
^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_test_batch_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_test_epoch_end
:noindex:

on_test_epoch_start
^^^^^^^^^^^^^^^^^^^
on_epoch_start
^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_test_epoch_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_epoch_start
:noindex:

on_test_epoch_end
^^^^^^^^^^^^^^^^^
on_epoch_end
^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_test_epoch_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_epoch_end
:noindex:

on_test_model_train
^^^^^^^^^^^^^^^^^^^
on_batch_start
^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_test_model_train
.. automethod:: pytorch_lightning.callbacks.Callback.on_batch_start
:noindex:

on_test_model_eval
^^^^^^^^^^^^^^^^^^
on_validation_batch_start
^^^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_test_model_eval
.. automethod:: pytorch_lightning.callbacks.Callback.on_validation_batch_start
:noindex:

on_train_batch_start
^^^^^^^^^^^^^^^^^^^^
on_validation_batch_end
^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_train_batch_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_validation_batch_end
:noindex:

on_train_batch_end
^^^^^^^^^^^^^^^^^^
on_test_batch_start
^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_train_batch_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_test_batch_start
:noindex:

on_train_start
^^^^^^^^^^^^^^
on_test_batch_end
^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_train_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_test_batch_end
:noindex:

on_train_end
on_batch_end
^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_train_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_batch_end
:noindex:

on_train_epoch_start
^^^^^^^^^^^^^^^^^^^^
on_train_start
^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_train_epoch_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_train_start
:noindex:

on_train_epoch_end
^^^^^^^^^^^^^^^^^^
on_train_end
^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_train_epoch_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_train_end
:noindex:

on_validation_batch_start
on_pretrain_routine_start
^^^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_validation_batch_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_pretrain_routine_start
:noindex:

on_validation_batch_end
on_pretrain_routine_end
^^^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_validation_batch_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_pretrain_routine_end
:noindex:

on_validation_epoch_start
^^^^^^^^^^^^^^^^^^^^^^^^^
on_validation_start
^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_validation_epoch_start
.. automethod:: pytorch_lightning.callbacks.Callback.on_validation_start
:noindex:

on_validation_epoch_end
^^^^^^^^^^^^^^^^^^^^^^^
on_validation_end
^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_validation_epoch_end
.. automethod:: pytorch_lightning.callbacks.Callback.on_validation_end
:noindex:

on_validation_model_eval
^^^^^^^^^^^^^^^^^^^^^^^^
on_test_start
^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_validation_model_eval
.. automethod:: pytorch_lightning.callbacks.Callback.on_test_start
:noindex:

on_validation_model_train
^^^^^^^^^^^^^^^^^^^^^^^^^
on_test_end
^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.on_validation_model_train
.. automethod:: pytorch_lightning.callbacks.Callback.on_test_end
:noindex:

setup
^^^^^
on_keyboard_interrupt
^^^^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.setup
.. automethod:: pytorch_lightning.callbacks.Callback.on_keyboard_interrupt
:noindex:

teardown
^^^^^^^^
on_save_checkpoint
^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.callbacks.Callback.on_save_checkpoint
:noindex:

on_load_checkpoint
^^^^^^^^^^^^^^^^^^

.. automethod:: pytorch_lightning.core.hooks.ModelHooks.teardown
.. automethod:: pytorch_lightning.callbacks.Callback.on_load_checkpoint
:noindex:

0 comments on commit 09c2f4a

Please sign in to comment.