Documentation
Search…
wandb.agent
Generic agent entrypoint, used for CLI or jupyter.
1
agent(
2
sweep_id, function=None, entity=None, project=None, count=None
3
)
Copied!
Will run a function or program with configuration parameters specified by server.
Arguments
Text
sweep_id
(dict) Sweep ID generated by CLI or sweep API
function
(func, optional) A function to call instead of the "program" specifed in the config.
entity
(str, optional) W&B Entity
project
(str, optional) W&B Project
count
(int, optional) the number of trials to run.

Examples:

Run a sample sweep over a function:
1
def train():
2
with wandb.init() as run:
3
print("config:", dict(run.config))
4
for epoch in range(35):
5
print("running", epoch)
6
wandb.log({"metric": run.config.param1, "epoch": epoch})
7
time.sleep(1)
8
9
wandb.agent(sweep_id, function=train)
Copied!
Last modified 16m ago
Copy link