CookbooksCursus Cookbooks
Hyperparameter Sweep
Create a sweep, claim trials across parallel workers, and find the best hyperparameters.
- Grid search with transactional trial claiming
- Random search with log-uniform scaling
- Parallel workers on multiple machines
Time to complete: ~10 minutes
Prerequisites
pip install sagea-cursusCURSUS_API_KEYandCURSUS_BASE_URLset in your environment- A Cursus server instance (hosted or self-hosted)
Step 1: Create a sweep
Step 2: Write the worker loop
Each worker claims trials and trains until the sweep is exhausted:
Step 3: Run parallel workers
Launch one worker per machine:
Grid trials are claimed transactionally — concurrent workers never share a cell. next_trial() returns None when the grid is exhausted or the sweep is finished/cancelled.
Step 4: Review results
Open the sweep page on the dashboard to see all trials with their configs and final metrics. Compare results to find the best hyperparameter combination.
