- Before you initialize a sweep, make sure you have a sweep configuration defined either in a YAML file or a nested Python dictionary object in your script. For more information, see Define sweep configuration.
- Both the W&B Sweep and the W&B Run must be in the same project. Therefore, the name you provide when you initialize W&B (
wandb.init()
) must match the name of the project you provide when you initialize a W&B Sweep (wandb.sweep()
).
- Python script or notebook
- CLI
Use the W&B SDK to initialize a sweep. Pass the sweep configuration dictionary to the The
sweep
parameter. Optionally provide the name of the project for the project parameter (project
) where you want the output of the W&B Run to be stored. If the project is not specified, the run is put in an “Uncategorized” project.wandb.sweep()
function returns the sweep ID. The sweep ID includes the entity name and the project name. Make a note of the sweep ID.