Azure / Azure/azureml-examples

Hyperparameter sweep YAML with configurable search space ranges

Open
#3,457 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Jupyter Notebook
Stars
2k
Forks
1.7k
Avg merge
18h 18m
Merged PRs (30d)
2

Description

### Describe your suggestion

I'd like an example of how to do a sweep job while specifying the search space range from the inputs parameters. The [example currently available](https://github.com/Azure/azureml-examples/blob/main/cli/jobs/pipelines-with-components/pipeline_with_hyperparameter_sweep/pipeline.yml ) currently does not cover this, and I've been having problems getting it to work myself.

I'd like to see something like this:

```
$schema: https://azuremlschemas.azureedge.net/latest/pipelineJob.schema.json
type: pipeline
display_name: pipeline_with_hyperparameter_sweep
description: Tune hyperparameters using TF component
settings:
default_compute: azureml:cpu-cluster

inputs:
c_value_min: 0.5
c_value_max: 0.9

jobs:
sweep_step:
type: sweep
inputs:
data:
type: uri_file
path: wasbs://datasets@azuremlexamples.blob.core.windows.net/iris.csv
degree: 3
gamma: "scale"
shrinking: False
outputs:
model_output:
test_data:
sampling_algorithm: random
trial: ./train.yml
search_space:
c_value:
type: uniform
min_value: ${{ parent.inputs.c_value_min }}
max_value: ${{ parent.inputs.c_value_max }}
objective:
goal: minimize
primary_metric: training_f1_score
limits:
max_total_trials: 5
max_concurrent_trials: 3
timeout: 7200

```

But then in a way that works; the method above unfortunately does not. The pipeline is submitted correctly, but in the sweep job itself the inputs provided are replaced with '0's as if they are missing. I have been unable to figure out the correct syntax to use here, or to find proper examples.

### Additional details

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with pipeline_with_hyperparameter_sweep/pipeline.yml, the existing sweep example linked in the issue, and compare its inputs and search_space configuration with the requested pipeline inputs. Verify the correct syntax for passing configurable ranges into the sweep job; done means the repository contains a working example that submits successfully and uses the provided range values rather than zeros.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.