Commit 8121938
Re-index TorchOptConfig.objective_thresholds from (n_outcomes,) to (n_objectives,)
Summary:
Re-index `objective_thresholds` in `TorchOptConfig` from `(n_outcomes,)` with NaN
for non-objective outcomes to `(n_objectives,)` or `None`. This is a prerequisite
for supporting `ScalarizedObjective` as a sub-objective of `MultiObjective`.
Key changes:
- `extract_objective_thresholds` returns `(n_objectives,)` maximization-aligned
array (sign-flipped for minimize objectives), or `None` for single-objective.
- `_untransform_objective_thresholds` indexes by objective index and un-flips
the sign when converting back to raw `ObjectiveThreshold.bound`.
- Replaced `get_weighted_mc_objective_and_objective_thresholds` with
`get_weighted_mc_objective`, which only returns the objective (thresholds
no longer need transformation so callers use them directly).
- `infer_objective_thresholds` returns `(n_objectives,)` maximization-aligned.
- Removed `objective_thresholds` from `SubsetModelData` and `subset_model`
(thresholds are per-objective, not per-outcome, so subsetting doesn't apply).
- Simplified `_objective_threshold_to_outcome_constraints` and pruning logic.
- Merged `_full_objective_thresholds` and `_objective_thresholds` into single
`_objective_thresholds` in the `Acquisition` class.
- Pass thresholds directly as `ref_point` to BoTorch input constructors (using
the new `ref_point` parameter from D96473523), avoiding the need to convert
back to outcome space.
Differential Revision: D963919351 parent 1e48d0f commit 8121938
File tree
15 files changed
+203
-285
lines changed- ax
- adapter
- tests
- generators
- tests
- torch
- botorch_modular
- tests
15 files changed
+203
-285
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | | - | |
211 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
212 | 213 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
224 | | - | |
| 227 | + | |
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
| |||
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
250 | 261 | | |
251 | 262 | | |
252 | 263 | | |
| |||
743 | 754 | | |
744 | 755 | | |
745 | 756 | | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
| 757 | + | |
| 758 | + | |
750 | 759 | | |
751 | 760 | | |
752 | 761 | | |
| |||
911 | 920 | | |
912 | 921 | | |
913 | 922 | | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
918 | 926 | | |
919 | 927 | | |
920 | 928 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
| 195 | + | |
194 | 196 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
162 | 192 | | |
163 | | - | |
164 | | - | |
| 193 | + | |
| 194 | + | |
165 | 195 | | |
166 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
167 | 200 | | |
168 | | - | |
169 | | - | |
| 201 | + | |
170 | 202 | | |
171 | 203 | | |
172 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
1114 | | - | |
| 1114 | + | |
1115 | 1115 | | |
| 1116 | + | |
| 1117 | + | |
1116 | 1118 | | |
1117 | 1119 | | |
1118 | 1120 | | |
1119 | | - | |
| 1121 | + | |
1120 | 1122 | | |
1121 | 1123 | | |
1122 | 1124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
216 | | - | |
| 215 | + | |
217 | 216 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 217 | + | |
223 | 218 | | |
224 | | - | |
225 | 219 | | |
226 | 220 | | |
227 | 221 | | |
228 | | - | |
229 | 222 | | |
230 | 223 | | |
231 | 224 | | |
| |||
255 | 248 | | |
256 | 249 | | |
257 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
258 | 255 | | |
259 | 256 | | |
260 | 257 | | |
| |||
282 | 279 | | |
283 | 280 | | |
284 | 281 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
289 | 285 | | |
290 | 286 | | |
291 | 287 | | |
| |||
295 | 291 | | |
296 | 292 | | |
297 | 293 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 294 | + | |
| 295 | + | |
302 | 296 | | |
303 | 297 | | |
304 | 298 | | |
| |||
312 | 306 | | |
313 | 307 | | |
314 | 308 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
| 309 | + | |
| 310 | + | |
319 | 311 | | |
320 | 312 | | |
321 | 313 | | |
| |||
350 | 342 | | |
351 | 343 | | |
352 | 344 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
| 345 | + | |
| 346 | + | |
357 | 347 | | |
358 | 348 | | |
359 | 349 | | |
| |||
0 commit comments