mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user