This repository provides an example showing how to use Pytorch Lightning with Lightning CLI and Ray Tune.
Exactly the same as without Ray Tune, so it should be something like:
python main.py fit -c config.yaml
main.py
: Here is where all Ray Tune is written. See below.cli.py
: A subclass of the standardLightningCLI
class. You should not have to modify anything here. If you already have your custom implementation of CLI, just make this implementation be a subclass of yours.data.py
: A dummy example ofLightningDataModule
.model.py
: A dummy example ofLightningModule
.config.yaml
: A dummy example ofyaml
config file.
If you use LightningCLI
a standard way, there is nothing to change here.
Otherwise, e.g. if you want to do something before launching the training loop, write it down here.
Here is all the Ray Tune stuff that you can (should?) modify. There are nice tutorials to show you what the different elements mean.
Unexhaustive list: