lightning_trainer module
Full Documentation for hippynn.experiment.lightning_trainer
module.
Click here for a summary page.
Pytorch Lightning training interface.
This module is somewhat experimental. Using pytorch lightning successfully in a distributed context may require understanding and adjusting the various settings related to parallelism, e.g. multiprocessing context, torch ddp backend, and how they interact with your HPC environment.
- Some features of hippynn experiments may not be implemented yet.
The plotmaker is currently not supported.
- class HippynnDataModule(*args: Any, **kwargs: Any)
Bases:
LightningDataModule
- test_dataloader()
- Returns:
- train_dataloader()
- Returns:
- val_dataloader()
- Returns:
- class HippynnLightningModule(*args: Any, **kwargs: Any)
Bases:
LightningModule
A pytorch lightning module for running a hippynn experiment.
- classmethod from_experiment_setup(training_modules: TrainingModules, database: Database | None, setup_params: SetupParams, **kwargs)
Create a lightning module using the same arguments as for
hippynn.experiment.setup_and_train()
.- Parameters:
training_modules
database
setup_params
kwargs
- Returns:
lightning_module, database
- classmethod from_train_setup(training_modules: TrainingModules, database: Database | None, controller: Controller, metric_tracker: MetricTracker, callbacks=None, batch_callbacks=None, **kwargs)
Create a lightning module from the same arguments as for
hippynn.experiment.train_model()
.- Parameters:
training_modules
database
controller
metric_tracker
callbacks
batch_callbacks
kwargs
- Returns:
lightning_module, database
- classmethod load_from_checkpoint(checkpoint_path, map_location=None, structure_file=None, hparams_file=None, strict=True, **kwargs)
- Parameters:
checkpoint_path
map_location
structure_file
hparams_file
strict
kwargs
- Returns:
- configure_optimizers()
- Returns:
- on_load_checkpoint(checkpoint) None
- Parameters:
checkpoint
- Returns:
- on_save_checkpoint(checkpoint) None
- Parameters:
checkpoint
- Returns:
- on_test_end()
- Returns:
- on_test_epoch_end()
- Returns:
- on_train_epoch_start()
- Returns:
- on_validation_end()
- Returns:
- on_validation_epoch_end()
- Returns:
- test_step(batch, batch_idx)
- Parameters:
batch
batch_idx
- Returns:
- training_step(batch, batch_idx)
- Parameters:
batch
batch_idx
- Returns:
- validation_step(batch, batch_idx)
- Parameters:
batch
batch_idx
- Returns: