Skip to main content

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:

  1. command line args
  2. yaml files
  3. 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:

  1. Basic Tutorial
  2. Intermediate Tutorial (coming soon)
  3. Advanced Tutorial (coming soon)

Lightning

  1. Basic Tutorial (coming soon - for now see examples/mnist_00.py).
  2. Intermediate Tutorial (coming soon)

Dev Installation

poetry install

Regenerate configs

poetry run generate-configs

Metadata

Release files for hydra-configs-pytorch-lightning 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hydra-configs-pytorch-lightning 0.1.0
File Size Uploaded
hydra-configs-pytorch-lightning-0.1.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hydra-configs-pytorch-lightning 0.1.0
File Interpreter ABI Platform
hydra_configs_pytorch_lightning-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / hydra-configs-pytorch-lightning-0.1.0.tar.gz

Download URL hydra-configs-pytorch-lightning-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1a503e258e1b1660d521c1f66bc0e91c499da9416d3c1e91125a7b62ea812317
BLAKE2b-256 checksum
How to use checksums
e233287c3a3b3f1fc71c1b8f4751b8d1a056cef10198b68445e50144d50f2b04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.6 Linux/4.15.0-136-generic

Release files / hydra_configs_pytorch_lightning-0.1.0-py3-none-any.whl

Download URL hydra_configs_pytorch_lightning-0.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acfa37e2084c9122ea8ac40fd2a2fb1553e2c14a2c6306be71a4deaa1c35bb66
BLAKE2b-256 checksum
How to use checksums
528f9ffc8ade6f00856a2ad141c6706aa2525ffdac6be18f13524b5f5d5978cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.6 Linux/4.15.0-136-generic

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page