Skip to content

Commit

Permalink
Update simplified examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
romesco committed Jul 19, 2020
1 parent dde7fe0 commit 625a103
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions pl_examples/hydra_examples/conf/config_simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ defaults:
- trainer: trainer
- opt: adam
- scheduler: fixed
- logger: tensorboard
- profiler: simple
- callbacks: null
- profiler: null
- logger: null
Expand Down
2 changes: 1 addition & 1 deletion pl_examples/hydra_examples/conf/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,5 @@ class FixedConf:


cs.store(
group="scheduler", name="fixed", node=ObjectConf(target="torch.optim.lr_scheduler.StepLR", params=StepConf()),
group="scheduler", name="fixed", node=ObjectConf(target="torch.optim.lr_scheduler.StepLR", params=FixedConf()),
)
5 changes: 4 additions & 1 deletion pl_examples/hydra_examples/pl_template_simple.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Pytorch Lightning training using Hydra for configuration
"""

import hydra
from omegaconf import DictConfig, OmegaConf
from pytorch_lightning import Callback, seed_everything, Trainer
Expand All @@ -10,7 +11,8 @@
import pl_examples.hydra_examples.conf.optimizer
import pl_examples.hydra_examples.conf.scheduler

from pl_examples.models.hydra_config_model import LightningTemplateModel
# Original lightning template
from pl_examples.models.lightning_template import LightningTemplateModel


@hydra.main(config_path="conf", config_name="config_simple")
Expand All @@ -19,6 +21,7 @@ def main(cfg: DictConfig):
Main training routine specific for this project
:param cfg:
"""

print(cfg.pretty())
seed_everything(cfg.model.seed)

Expand Down

0 comments on commit 625a103

Please sign in to comment.