Hydra Lightning
Project description
Quick Start:
pip install git+https://github.com/romesco/hydra-lightning/#subdirectory=hydra-configs-pytorch-lightning
from hydra_configs.pytorch_lightning.trainer import TrainerConf
What is this?
This is a collection of auto-generated configuration files to enable using Pytorch Lightning with Hydra. The emphasis on this repository is to provide a stable set of base configs that track the current versions of Lightning and Hydra. If either changes its API, these configs will update automatically as well.
Here is an example of the base config for the EarlyStopping
Callback from Pytorch Lightning:
@dataclass
class EarlyStoppingConf:
_target_: str = "pytorch_lightning.callbacks.EarlyStopping"
monitor: str = "early_stop_on"
min_delta: float = 0.0
patience: int = 3
verbose: bool = False
mode: str = "auto"
strict: bool = True
This is useful because it allows you to quickly import these configs like:
from hydra_configs.pytorch_lightning.callbacks import EarlyStoppingConf
Now you are free to use this config with its pre-set defaults and override any values programatically using one of:
- command line args
- yaml files
- structured configs (dataclasses)
Looking for torch
configs?
If you're interested in configuring Lightning classes, you're probably interested in configuring normal torch classes as well. Things like:
Adam
LRStep
Linear
Dataset
DataLoader
...
Please find those in the pytorch repository: https://github.com/pytorch/hydra-torch/
Tutorials
Configuring Pytorch with Hydra:
- Basic Tutorial
- Intermediate Tutorial (coming soon)
- Advanced Tutorial (coming soon)
Lightning
- Basic Tutorial (coming soon - for now see examples/mnist_00.py).
- Intermediate Tutorial (coming soon)
Dev Installation
poetry install
Regenerate configs
poetry run generate-configs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hydra-configs-pytorch-lightning-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a503e258e1b1660d521c1f66bc0e91c499da9416d3c1e91125a7b62ea812317 |
|
MD5 | 3254cebb87b368a1a62d0d188ce82d65 |
|
BLAKE2b-256 | e233287c3a3b3f1fc71c1b8f4751b8d1a056cef10198b68445e50144d50f2b04 |
Hashes for hydra_configs_pytorch_lightning-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acfa37e2084c9122ea8ac40fd2a2fb1553e2c14a2c6306be71a4deaa1c35bb66 |
|
MD5 | f88fde9db0d5341ce34f2c80b7f8d36a |
|
BLAKE2b-256 | 528f9ffc8ade6f00856a2ad141c6706aa2525ffdac6be18f13524b5f5d5978cb |