Sweep management: configuration builder, sweep registration, and agents. Builder for a wandb sweep configuration.
Build the configuration with the type-bound procedures, then pass it directly to wandb_sweep or call to_json() for the raw string.
type(wandb_sweep_config_type) :: cfg
call cfg%set_method("bayes")
call cfg%set_metric("val_loss", "minimize")
call cfg%add_param_range("learning_rate", 1e-5_real64, 1e-2_real64, &
distribution="log_uniform_values")
call cfg%add_param_values("hidden_size", [32, 64, 128, 256])
call cfg%add_param_values("activation", ["relu ", "tanh ", "sigmoid"])
call wandb_sweep(cfg, project="my-project", sweep_id=id)
Register a sweep — accepts either a raw JSON string or a wandb_sweep_config_type built with the helper API.
Register a hyperparameter sweep with wandb.
parameters).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | config_json |
JSON string describing the sweep (method, metric, |
||
| character(len=*), | intent(in) | :: | project |
wandb project name. |
||
| character(len=*), | intent(out) | :: | sweep_id |
Output: the sweep ID string assigned by wandb. |
||
| character(len=*), | intent(in), | optional | :: | entity |
Optional wandb entity/team. |
Register a sweep from a wandb_sweep_config_type builder object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(wandb_sweep_config_type), | intent(in) | :: | config | |||
| character(len=*), | intent(in) | :: | project | |||
| character(len=*), | intent(out) | :: | sweep_id | |||
| character(len=*), | intent(in), | optional | :: | entity |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | method_str | |||
| character(len=:), | public, | allocatable | :: | metric_goal_str | |||
| character(len=:), | public, | allocatable | :: | metric_name_str | |||
| integer, | public | :: | num_params | = | 0 | ||
| character(len=:), | public, | allocatable | :: | params_buf |
| generic, public :: add_param_range => add_range_r32, add_range_r64 | |
| generic, public :: add_param_values => add_vals_int, add_vals_r32, add_vals_r64, add_vals_str | |
| procedure, public :: set_method => swcfg_set_method | |
| procedure, public :: set_metric => swcfg_set_metric | |
| procedure, public :: to_json => swcfg_to_json |
Run a wandb sweep agent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | sweep_id |
Sweep ID returned by wandb_sweep. |
||
| character(len=*), | intent(in) | :: | project |
wandb project name. |
||
| integer, | intent(in), | optional | :: | count |
Number of runs to execute (0 = until sweep is done). |
|
| character(len=*), | intent(in), | optional | :: | entity |
Optional wandb entity/team. |
Block until the sweep agent has started the next run and populated wandb.config with the sweep-sampled hyperparameters.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(out) | :: | params_json |
Receives the sampled hyperparameters as a JSON |
||
| real(kind=c_double), | intent(in), | optional | :: | timeout_s |
Seconds to wait before giving up (default: 120.0). |
Start a wandb sweep agent in a background Python thread.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | sweep_id | |||
| character(len=*), | intent(in) | :: | project | |||
| integer, | intent(in) | :: | count | |||
| character(len=*), | intent(in), | optional | :: | entity |