ExperimentTracker¶
gepa.logging.experiment_tracker.ExperimentTracker(use_wandb: bool = False, wandb_api_key: str | None = None, wandb_init_kwargs: dict[str, Any] | None = None, use_mlflow: bool = False, mlflow_tracking_uri: str | None = None, mlflow_experiment_name: str | None = None)
¶
Unified experiment tracking that supports both wandb and mlflow.
Source code in gepa/logging/experiment_tracker.py
Attributes¶
use_wandb = use_wandb
instance-attribute
¶
use_mlflow = use_mlflow
instance-attribute
¶
wandb_api_key = wandb_api_key
instance-attribute
¶
wandb_init_kwargs = wandb_init_kwargs or {}
instance-attribute
¶
mlflow_tracking_uri = mlflow_tracking_uri
instance-attribute
¶
mlflow_experiment_name = mlflow_experiment_name
instance-attribute
¶
Functions¶
__enter__()
¶
__exit__(exc_type, exc_val, exc_tb)
¶
initialize()
¶
start_run()
¶
Start a new run.
Source code in gepa/logging/experiment_tracker.py
log_config(config: dict[str, Any]) -> None
¶
Log run configuration/hyperparameters to the active backends.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any]
|
Flat dict of config key-value pairs. Non-serializable values are converted to strings. |
required |
Source code in gepa/logging/experiment_tracker.py
log_metrics(metrics: dict[str, Any], step: int | None = None)
¶
Log metrics to the active backends.
Source code in gepa/logging/experiment_tracker.py
log_summary(summary: dict[str, Any]) -> None
¶
Log run summary data (visible on the run overview page).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
summary
|
dict[str, Any]
|
Key-value pairs for the run summary. Supports strings, numbers, and other serializable values. |
required |
Source code in gepa/logging/experiment_tracker.py
log_table(table_name: str, columns: list[str], data: list[list[Any]]) -> None
¶
Log a table to the active backends.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table_name
|
str
|
Name/key for the table. |
required |
columns
|
list[str]
|
Column headers. |
required |
data
|
list[list[Any]]
|
Rows of data (each row is a list matching columns). |
required |
Source code in gepa/logging/experiment_tracker.py
log_html(html_content: str, key: str = 'candidate_tree') -> None
¶
Log an HTML string as a rich media artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
html_content
|
str
|
Self-contained HTML string. |
required |
key
|
str
|
Artifact key / name used in the dashboard. |
'candidate_tree'
|
Source code in gepa/logging/experiment_tracker.py
end_run()
¶
End the current run.
Source code in gepa/logging/experiment_tracker.py
is_active() -> bool
¶
Check if any backend has an active run.