Skip to content

Commit

Permalink
Use tags instead of group
Browse files Browse the repository at this point in the history
  • Loading branch information
tmke8 committed Oct 3, 2023
1 parent 700382e commit 461c858
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/relay/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 461c858

Please sign in to comment.