Skip to main content
Uses environment variables for authentication:
  • WANDB_API_KEY: Your WandB API key (required for online logging)
  • WANDB_ENTITY: Username or team name (optional)
  • WANDB_PROJECT: Project name (optional, overrides constructor project)
If wandb is not installed, this callback will log warnings but not crash.

Parameters

project
str
required
WandB project name. Can be overridden by WANDB_PROJECT env var.
config
dict[str, Any] | None
default:"None"
Hyperparameters and configuration to log.

Methods

on_optimization_start

Initialize WandB run. Parameters
context
CallbackContext
required

on_step_end

Log metrics to WandB. Parameters
context
CallbackContext
required

on_optimization_end

Finish WandB run. Parameters
context
CallbackContext
required

Example

wandb_logger = WandBLogger(
    project="protein-design",
    config={"temperature": 1.0, "n_steps": 1000}
)