
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
sweeps
Advanced tools
This repo contains the routines that generate hyperparameter sweep suggestions in the W&B backend and client local controller.
Issues are not enabled in this repository. Please open issues related to sweeps in the wandb client library github issues page.
To install:
pip install sweeps
Get next run in a sweep.
Requires two arguments, config, the config that defines the sweep, and runs, the other runs in the sweep
config:
{
"metric": {"name": "loss", "goal": "minimize"},
"method": "bayes",
"parameters": {
"v1": {"min": 1, "max": 10},
"v2": {"min": 1.0, "max": 10.0},
},
}
runs:
[
SweepRun(
name="b",
state=RunState.finished,
history=[
{"loss": 5.0},
],
config={"v1": {"value": 7}, "v2": {"value": 6}},
summary_metrics={"zloss": 1.2},
),
SweepRun(
name="b2",
state=RunState.finished,
config={"v1": {"value": 1}, "v2": {"value": 8}},
summary_metrics={"loss": 52.0},
history=[],
)
]
Codepath:
suggestion = next_run(config, runs)
next_run:
config/schema.json, if not, it raises a ValidationErrorbayes_search_next_run)bayes_search_next_run(config, runs) and returns the suggested SweepRunReturn list of runs to stop in a sweep.
Requires two arguments, config, the config that defines the sweep, and runs, the other runs in the sweep
config:
{
"method": "grid",
"metric": {"name": "loss", "goal": "minimize"},
"early_terminate": {
"type": "hyperband",
"max_iter": 5,
"eta": 2,
"s": 2,
},
"parameters": {"a": {"values": [1, 2, 3]}},
}
runs:
[
SweepRun(
name="a",
state=RunState.finished, # This is already stopped
history=[
{"loss": 10},
{"loss": 9},
],
),
SweepRun(
name="b",
state=RunState.running, # This should be stopped
history=[
{"loss": 10},
{"loss": 10},
],
),
SweepRun(
name="c",
state=RunState.running, # This passes band 1 but not band 2
history=[
{"loss": 10},
{"loss": 8},
{"loss": 8},
],
),
SweepRun(
name="d",
state=RunState.running,
history=[
{"loss": 10},
{"loss": 7},
{"loss": 7},
],
),
SweepRun(
name="e",
state=RunState.finished,
history=[
{"loss": 10},
{"loss": 6},
{"loss": 6},
],
),
]
Codepath:
to_stop = stop_runs(config, runs)
stop_runs:
config/schema.json, if not, it raises a ValidationErrorhyperband_stop_runs)hyperband_stop_runs(config, runs) and returns the SweepRuns to stopTests are run using tox, the makefile defines convenience commands for short and long tests:
make test-short
make test-full
Review the Contributing Instructions
Install the development requirements:
pip install -r requirements.dev.txt
Install the pre-commit hooks:
pre-commit install .
Run formatting and tests:
make format
make test
FAQs
Weights and Biases Hyperparameter Sweeps Engine.
We found that sweeps demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.