Skip to content

Commit 8d6d0af

Browse files
paschaifacebook-github-bot
authored andcommitted
Add MOO recipe (#3528)
Summary: as titled - any edits are greatly appreciated! Differential Revision: D71397358
1 parent cc8e3a7 commit 8d6d0af

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Multi-Objective Optimization with Ax
2+
3+
Multi-objective optimization (MOO) allows you to optimize multiple objectives simultaneously, which is particularly useful when you have competing objectives. In this recipe, we will explore how to perform multi-objective optimization using the Ax Client.
4+
5+
Note that while MOO can handle multiple objectives, it's generally recommended to keep the number of objectives relatively small. Having too many objectives can lead decreased optimization performance and difficulties in interpreting the results.
6+
7+
## Prerequisites
8+
9+
We will assume you are already familiar with [using Ax for ask-tell optimization](#)
10+
11+
## Setup
12+
13+
Before we begin you must instantiate the `Client` and configure it with your
14+
experiment and metrics.
15+
16+
```python
17+
client = Client()
18+
19+
client.configure_experiment(...)
20+
client.configure_metrics(...)
21+
```
22+
23+
## Steps
24+
25+
1. Configure an optimization with multiple objectives
26+
2. Continue with iterating over trials and evaluating them
27+
28+
### 1. Configure an optimization with multiple objectives
29+
We can leverage the Client's `configure_optimization` method to configure a multi-objective optimization. This method takes in an objective goal as a string, and can be used to specify single-objective, scalarized-objective, and multi-objective goals. For this recipe, we will use a multi-objective goal:
30+
31+
```
32+
client.configure_optimization(objectives="-min_objective, max_objective")
33+
```
34+
35+
By default, objectives are assumed to be maximized. If you want to minimize an objective, you can prepend the objective with a `-`.
36+
37+
### 2. Continue with iterating over trials and evaluating them
38+
Now that your experiment has been configured for a multi-objective optimization, you can simply continue with iterating over trials and evaluating them as you typically would.
39+
40+
```python
41+
trial_idx, parameters = client.get_next_trials().popitem()
42+
client.complete_trial(...)
43+
```
44+
45+
## Learn more
46+
47+
Take a look at these other resources to continue your learning:
48+
49+
- [Set scalarized-objective optimizations](#)
50+
- [Set outcome constraints](#)

website/sidebars.js

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default {
5656
'recipes/tracking-metrics',
5757
'recipes/experiment-to-json',
5858
'recipes/experiment-to-sqlite',
59+
'recipes/multi-objective-optimization',
5960
],
6061
},
6162
};

0 commit comments

Comments
 (0)