gunz_ml.loggers package

gunz_ml.loggers.init_logger(logger_cfg: Dict[str, Dict[str, Any]], name: str = None, tags: List[str] = None) Any | None[source]

Initialize a logger based on the provided configuration.

Parameters:
  • logger_cfg (dict) – Configuration for the logger. It should contain the logger name as key and its corresponding arguments as value.

  • name (str, optional) – Name of the experiment. Defaults to None.

  • tags (list of str, optional) – Tags for the logger. Defaults to None.

Returns:

logger – An instance of the logger class or None if the logger configuration is None.

Return type:

Any or None

Notes

This function supports multiple types of loggers, including DummyLogger, CSVLogger, MLFlowLogger, ModMLFlowLogger, TensorBoardLogger, and WandbLogger.

Submodules

gunz_ml.loggers.modmlflow module

class gunz_ml.loggers.modmlflow.ModMLFlowLogger(*args: Any, **kwargs: Any)[source]

Bases: MLFlowLogger

A modified MLFlow logger for PyTorch Lightning aligned with PL 2.6+.

log_artifact(local_path: str, artifact_path: str | None = None) None

Log a single artifact.

log_artifacts(local_dir: str, artifact_path: str | None = None) None

Log a directory of artifacts.

log_hyperparams(params: Dict[str, Any] | Namespace) None

Record hyperparameters to the experiment.

log_hyperparams_metrics(params: Dict[str, Any] | Namespace, metrics: Mapping[str, float], step: int | None = None)