From 461c8587e2ed63e1001eed56e2da787163399b3c Mon Sep 17 00:00:00 2001 From: Thomas M Kehrenberg Date: Tue, 3 Oct 2023 11:46:49 +0200 Subject: [PATCH] Use tags instead of group --- src/logging.py | 18 ++++++++---------- src/relay/split.py | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/logging.py b/src/logging.py index 295cd39b..82df40fa 100644 --- a/src/logging.py +++ b/src/logging.py @@ -5,7 +5,6 @@ from typing_extensions import TypeAlias from conduit.data.datasets.vision.base import CdtVisionDataset -from loguru import logger from ranzen.hydra import reconstruct_cmd import torch from torch import Tensor @@ -47,16 +46,15 @@ def init( self, raw_config: Optional[dict[str, Any]] = None, cfgs_for_group: tuple[object, ...] = (), - suffix: Optional[str] = None, + with_tag: Optional[str] = None, ) -> Run: - if self.group is None: - default_group = "_".join( - cfg_obj.__class__.__name__.lower() for cfg_obj in cfgs_for_group - ) - if suffix is not None: - default_group += f"_{suffix}" - logger.info(f"No wandb group set - using {default_group} as the inferred default.") - self.group = default_group + if self.tags is None: + self.tags = [] + self.tags.extend( + cfg_obj.__class__.__name__ for cfg_obj in cfgs_for_group + ) + if with_tag is not None: + self.tags.append(with_tag) # TODO: not sure whether `reinit` really should be hardcoded self.reinit = True kwargs = asdict(self) diff --git a/src/relay/split.py b/src/relay/split.py index c3012e5a..d73363e7 100644 --- a/src/relay/split.py +++ b/src/relay/split.py @@ -35,7 +35,7 @@ def run(self, raw_config: Optional[dict[str, Any]] = None) -> None: assert isinstance(self.split, RandomSplitter) ds = self.ds() - run = self.wandb.init(raw_config, (ds,), suffix="artgen") + run = self.wandb.init(raw_config, (ds,), with_tag="artgen") self.split.save_as_artifact = True self.split(ds) if run is not None: