Shortcuts

Build a Callback

This module houses a collection of callbacks that can be passed into the trainer

from pl_bolts.callbacks import PrintTableMetricsCallback

trainer = pl.Trainer(callbacks=[PrintTableMetricsCallback()])

# loss│train_loss│val_loss│epoch
# ──────────────────────────────
# 2.2541470527648926│2.2541470527648926│2.2158432006835938│0

What is a Callback

A callback is a self-contained program that can be intertwined into a training pipeline without polluting the main research logic.


Create a Callback

Creating a callback is simple:

from pytorch_lightning.callbacks import Callback

class MyCallback(Callback)
    def on_epoch_end(self, trainer, pl_module):
        # do something

Please refer to Callback docs for a full list of the 20+ hooks available.

Read the Docs v: latest
Versions
latest
stable
0.3.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.