* added community examples

* added community examples
This commit is contained in:
William Falcon
2020-03-03 11:39:43 -05:00
committed by GitHub
parent 2ac236ebfe
commit 1d11f61c36
5 changed files with 51 additions and 10 deletions
+24 -3
View File
@@ -35,10 +35,31 @@ Example
We successfully extended functionality without polluting our super clean LightningModule research code
Callback Class
--------------
.. automodule:: pytorch_lightning.callbacks.base
:noindex:
:exclude-members:
_del_model,
_save_model,
_abc_impl,
check_monitor_top_k,
.. automodule:: pytorch_lightning.callbacks
.. automodule:: pytorch_lightning.callbacks.early_stopping
:noindex:
:exclude-members:
_del_model,
_save_model,
_abc_impl,
check_monitor_top_k,
.. automodule:: pytorch_lightning.callbacks.model_checkpoint
:noindex:
:exclude-members:
_del_model,
_save_model,
_abc_impl,
check_monitor_top_k,
.. automodule:: pytorch_lightning.callbacks.gradient_accumulation_scheduler
:noindex:
:exclude-members:
_del_model,
+7 -6
View File
@@ -1,15 +1,16 @@
"""
Callbacks
=========
Callbacks supported by Lightning
r"""
Callback Base
==============
Abstract base class used to build new callbacks.
"""
import abc
class Callback(abc.ABC):
"""Abstract base class used to build new callbacks."""
r"""
Abstract base class used to build new callbacks.
"""
def on_init_start(self, trainer):
"""Called when the trainer initialization begins, model has not yet been set."""
@@ -1,3 +1,10 @@
r"""
Early Stopping
==============
Stop training when a monitored quantity has stopped improving.
"""
import logging as log
import warnings
@@ -8,7 +15,6 @@ from .base import Callback
class EarlyStopping(Callback):
r"""
Stop training when a monitored quantity has stopped improving.
Args:
monitor (str): quantity to be monitored. Default: ``'val_loss'``.
@@ -1,3 +1,9 @@
r"""
Gradient Accumulator
====================
Change gradient accumulation factor according to scheduling.
"""
import warnings
from .base import Callback
@@ -1,3 +1,10 @@
r"""
Model Checkpoint
==============
Save the model as often as requested.
"""
import os
import shutil
import logging as log