Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce run name auto composition #32

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/train/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ logging:
logger:
_target_: pytorch_lightning.loggers.WandbLogger

name: null
project: ${core.project_name}
entity: null
log_model: ${..upload.checkpoint}
Expand Down
4 changes: 4 additions & 0 deletions src/nn_template/data/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def __init__(
# example
self.val_percentage: float = val_percentage

@property
def name(self) -> str:
return "mnist_data"

def prepare_data(self) -> None:
# download only
pass
Expand Down
4 changes: 4 additions & 0 deletions src/nn_template/pl_modules/pl_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def __init__(self, *args, **kwargs) -> None:
self.val_accuracy = metric.clone()
self.test_accuracy = metric.clone()

@property
def name(self) -> str:
return "simple_cnn"

def forward(self, x: torch.Tensor) -> torch.Tensor:
"""Method for the forward pass.

Expand Down
1 change: 1 addition & 0 deletions src/nn_template/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def run(cfg: DictConfig) -> str:

storage_dir: str = cfg.core.storage_dir

cfg.train.logging.logger.name = f"{datamodule.name}-{model.name}"
logger: NNLogger = NNLogger(logging_cfg=cfg.train.logging, cfg=cfg, resume_id=resume_run_version)

pylogger.info("Instantiating the <Trainer>")
Expand Down