-
-
Save aribornstein/511b554ac80015fdf6bb8f7742e2397f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pytorch_lighting import seed_everything | |
from pytorch_lightning.callbacks import EarlyStopping | |
from pytorch_lightning import Trainer | |
# seeding for torch, numpy, stdlib random, including DataLoader workers! | |
seed_everything(123, workers=True) | |
early_stopping = EarlyStopping( | |
monitor="val_loss", | |
stopping_threshold=1e-4, | |
divergence_threshold=9.0, | |
check_finite=True, | |
) | |
trainer = Trainer(callbacks=[early_stopping], | |
profiler="pytorch", | |
tpu_cores=8) | |
trainer.validate(model, datamodule=datamodule) | |
trainer.predict(model, datamodule=datamodule) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment