Loggers
- class BaseLogger[source]
Bases:
ABC
Base class for all experiment loggers.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None)[source]
Initialize the logger.
- Parameters:
experiment_name (str) – Name of the experiment
run_name (str | None) – Name of the run within the experiment
tracking_uri (str | None) – URI for the tracking server (e.g., MLflow server, W&B server)
artifact_location (str | None) – Location to store artifacts (e.g., S3 bucket, local path)
tags (Dict[str, str] | None) – Additional tags to attach to the experiment
- class MLFlowLogger[source]
Bases:
BaseLogger
MLflow implementation of the experiment logger.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None)[source]
Initialize the MLflow logger.
- Parameters:
experiment_name (str) – Name of the experiment
run_name (str | None) – Name of the run within the experiment
tracking_uri (str | None) – URI for the MLflow tracking server
artifact_location (str | None) – Location to store artifacts (e.g., S3 bucket)
tags (Dict[str, str] | None) – Additional tags to attach to the experiment
- class TensorBoardLogger[source]
Bases:
BaseLogger
TensorBoard implementation of the experiment logger.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None)[source]
Initialize the TensorBoard logger.
- Parameters:
experiment_name (str) – Name of the experiment
run_name (str | None) – Name of the run within the experiment
tracking_uri (str | None) – Not used in TensorBoard
artifact_location (str | None) – Root directory for TensorBoard logs
tags (Dict[str, str] | None) – Additional tags (added as text in TensorBoard)
- class WandbLogger[source]
Bases:
BaseLogger
Weights & Biases implementation of the experiment logger.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None, project=None, entity=None)[source]
Initialize the W&B logger.
- Parameters:
experiment_name (str) – Name of the experiment (used as group in W&B)
run_name (str | None) – Name of the run
tracking_uri (str | None) – Not used in W&B
artifact_location (str | None) – Local directory for artifacts
project (str | None) – W&B project name (required)
entity (str | None) – W&B entity (username or team name)
TensorBoard Logger
- class TensorBoardLogger[source]
Bases:
BaseLogger
TensorBoard implementation of the experiment logger.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None)[source]
Initialize the TensorBoard logger.
- Parameters:
experiment_name (str) – Name of the experiment
run_name (str | None) – Name of the run within the experiment
tracking_uri (str | None) – Not used in TensorBoard
artifact_location (str | None) – Root directory for TensorBoard logs
tags (Dict[str, str] | None) – Additional tags (added as text in TensorBoard)
- start_run()[source]
Start a new TensorBoard run by creating the writer.
- Return type:
None
- end_run()[source]
End the current TensorBoard run.
- Return type:
None
- log_params(params)[source]
Log parameters using TensorBoard.
- log_metrics(metrics, step=None)[source]
Log metrics using TensorBoard.
- log_model(model, artifact_path, metadata=None)[source]
Log a PyTorch model using TensorBoard.
MLflow Logger
- class MLFlowLogger[source]
Bases:
BaseLogger
MLflow implementation of the experiment logger.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None)[source]
Initialize the MLflow logger.
- Parameters:
experiment_name (str) – Name of the experiment
run_name (str | None) – Name of the run within the experiment
tracking_uri (str | None) – URI for the MLflow tracking server
artifact_location (str | None) – Location to store artifacts (e.g., S3 bucket)
tags (Dict[str, str] | None) – Additional tags to attach to the experiment
- start_run()[source]
Start a new MLflow run.
- end_run()[source]
End the current MLflow run.
- Return type:
None
- log_params(params)[source]
Log parameters using MLflow.
- log_metrics(metrics, step=None)[source]
Log metrics using MLflow.
- log_model(model, artifact_path, metadata=None)[source]
Log a PyTorch model using MLflow.
Weights & Biases Logger
- class WandbLogger[source]
Bases:
BaseLogger
Weights & Biases implementation of the experiment logger.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None, project=None, entity=None)[source]
Initialize the W&B logger.
- Parameters:
experiment_name (str) – Name of the experiment (used as group in W&B)
run_name (str | None) – Name of the run
tracking_uri (str | None) – Not used in W&B
artifact_location (str | None) – Local directory for artifacts
project (str | None) – W&B project name (required)
entity (str | None) – W&B entity (username or team name)
- start_run()[source]
Start a new W&B run.
- Return type:
None
- end_run()[source]
End the current W&B run.
- Return type:
None
- log_params(params)[source]
Log parameters using W&B.
- log_metrics(metrics, step=None)[source]
Log metrics using W&B.
- log_model(model, artifact_path, metadata=None)[source]
Log a PyTorch model using W&B.
Base Logger
- class BaseLogger[source]
Bases:
ABC
Base class for all experiment loggers.
- __init__(experiment_name, run_name=None, tracking_uri=None, artifact_location=None, tags=None)[source]
Initialize the logger.
- Parameters:
experiment_name (str) – Name of the experiment
run_name (str | None) – Name of the run within the experiment
tracking_uri (str | None) – URI for the tracking server (e.g., MLflow server, W&B server)
artifact_location (str | None) – Location to store artifacts (e.g., S3 bucket, local path)
tags (Dict[str, str] | None) – Additional tags to attach to the experiment
- abstract start_run()[source]
Start a new run.
- Return type:
None
- abstract end_run()[source]
End the current run.
- Return type:
None
- abstract log_params(params)[source]
Log parameters for the run.
- abstract log_metrics(metrics, step=None)[source]
Log metrics for the run.
- abstract log_model(model, artifact_path, metadata=None)[source]
Log a model artifact.