Lightning CLI
Why use a CLI
When running deep learning experiments, there are a couple of good practices that are recommended to follow:
- Separate configuration from source code
- Guarantee reproducibility of experiments
Implementing a command line interface (CLI) makes it possible to execute an experiment from a shell terminal. By having a CLI, there is a clear separation between the Python source code and what hyperparameters are used for a particular experiment. If the CLI corresponds to a stable version of the code, reproducing an experiment can be achieved by installing the same version of the code plus dependencies and running with the same configuration (CLI arguments).
Basic use
1: Control it all from the CLI — Learn to control a LightningModule and LightningDataModule from the CLI
2: Mix models, datasets and optimizers — Support multiple models, datasets, optimizers and learning rate schedulers
3: Control it all via YAML — Enable composable YAMLs
Advanced use
YAML for production — Use the Lightning CLI with YAMLs for production environments
Customize for complex projects — Learn how to implement CLIs for complex projects
Extend the Lightning CLI — Customize the Lightning CLI
Miscellaneous
- FAQ — Frequently asked questions about working with the Lightning CLI and YAML files
Was this page helpful?
Thanks for the feedback.