Create a project
First, create a baseline project by training the example model at least once. This baseline gives the sweep something to configure against in later steps. Download the PyTorch MNIST dataset example model from the W&B examples GitHub repository. Next, train the model. The training script is within theexamples/pytorch/pytorch-cnn-fashion directory.
To download and train the example model, follow these steps:
- Clone the repository:
git clone https://github.com/wandb/examples.git. - Open the example directory:
cd examples/pytorch/pytorch-cnn-fashion. - Run the training script manually:
python train.py.
Create a sweep
With a baseline project in place, you can configure a sweep over its runs. From your project page, open the Sweep tab in the project sidebar and select Create Sweep.

Launch agents
After you configure the sweep, launch one or more agents locally to execute the runs. To distribute the work and finish the sweep job more quickly, launch up to 20 agents on different machines in parallel. The agent prints out the next set of parameters to use.

Seed a new sweep with existing runs
You can also launch a new sweep using existing runs that you’ve previously logged, which lets you reuse earlier results as a starting point. To seed a new sweep with existing runs, follow these steps:- Open your project table.
- Select the runs you want to use by enabling their row checkboxes.
- Select the dropdown to create a new sweep.

If you start the new sweep as a Bayesian sweep, the selected runs also seed the Gaussian Process.