Run
Stages
Lighter uses PyTorch Lightning's Trainer to manage deep learning experiments. The available stages are:
fit
: Train your model on training data.validate
: Evaluate model performance on validation datatest
: Evaluate final model performance on test datapredict
: Generate predictions on new datalr_find
: Find optimal learning ratescale_batch_size
: Find largest batch size that fits in GPU memory
For documentation on each, please refer to PyTorch Lightning: fit
, validate
, test
, predict
, lr_find
, scale_batch_size
.
Running a Stage
The basic command to run a stage of an experiment is:
Where:
<stage>
is one of the stages mentioned above (e.g.,fit
,validate
,test
,predict
,lr_find
,scale_batch_size
).config.yaml
is the configuration file that defines your experiment. You can also define multiple config files separated by commas, which will be merged (e.g.,config1.yaml,config2.yaml
).
For example, to train your model, you would use:
Passing arguments to a stage
To pass arguments to a stage, use the args
section in in your config. For example, to set the ckpt_path
argument of the fit
stage/method in your config:
or pass/override it from the command line:
Recap and Next Steps
You now know how to run different stages of your experiment using Lighter. Next, explore the Project Module to learn how to organize your project and reference custom modules in your configuration.