You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add support for conditional search spaces in the tuner (#172)
# Summary
Allows a custom function to be specified as the definition for the
`Tuner` search space. This allows for more complex search space
definitions, e.g. branching, looping. See
https://docs.ray.io/en/latest/tune/examples/optuna_example.html#conditional-search-spaces
for more information on how Ray provides this (via Optuna).
# Changes
* New `space` attribute on the `OptunaSpec` algorithm definition.
* Implementation and tests.
Copy file name to clipboardExpand all lines: docs/examples/tutorials/tuning-a-process.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,3 +73,31 @@ Plugboard's YAML config supports an optional `tune` section, allowing you to def
73
73
3. Parameters need to reference a type, so that Plugboard knows the type of parameter to build.
74
74
75
75
Now run `plugboard process tune model-with-tuner.yaml` to execute the optimisation job from the CLI.
76
+
77
+
## Advanced usage: complex search spaces
78
+
79
+
Occasionally you may need to define more complex search spaces, which go beyond what can be defined with a simple parameter configuration. For example:
80
+
81
+
* Conditional parameters, e.g. where parameter `a` must be greater than parameter `b`; or
82
+
* Looping, e.g. building up a list of tunable parameters that is of variable length.
83
+
84
+
These conditional search space functions are supported by Ray Tune and can be defined as described in the [Ray documentation](https://docs.ray.io/en/latest/tune/examples/optuna_example.html#conditional-search-spaces). To use such a function you will need to:
85
+
86
+
1. Setup the [`Tuner`][plugboard.tune.Tuner], defining your parameters as usual;
87
+
2. Write a custom function to define the search space, where each tunable parameter has a name of the form `"{component_name.field_or_arg_name}"`; then
88
+
3. Supply your custom function to the `OptunaSpec` algorithm configuration.
89
+
90
+
For example, the following search space makes the velocity depend on the angle:
0 commit comments