Skip to content

Commit f911e63

Browse files
Carl Hvarfnerfacebook-github-bot
authored andcommitted
Simplify task value remapping API
Summary: X-link: meta-pytorch/botorch#3146 Simplifies the get_task_value_remapping() API from 4 parameters to 2, addressing confusion reported in #3085. The observed_task_values parameter is removed because the parent diff (D90769576) now makes MultiTaskGP track observed/unobserved tasks internally via _observed_task_indices and _unobserved_task_indices. The default_task_value parameter is removed because the previous behavior—silently mapping unknown tasks to an arbitrary fallback—was confusing and error-prone; instead, unrecognized tasks now map to NaN, providing an explicit error sentinel with a clear warning message. Differential Revision: D90998243
1 parent 940092e commit f911e63

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

ax/generators/torch/botorch_modular/input_constructors/outcome_transform.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,10 @@ def _outcome_transform_argparse_stratified_standardize(
106106
dataset = assert_is_instance(dataset, MultiTaskDataset)
107107
if dataset.has_heterogeneous_features:
108108
task_feature_index = dataset.task_feature_index or -1
109-
task_values = torch.arange(len(dataset.datasets), dtype=torch.long)
110109
else:
111110
task_feature_index = dataset.task_feature_index
112-
task_values = dataset.X[..., dataset.task_feature_index].unique().long()
113111
ssd = none_throws(search_space_digest)
114-
if (ssd.target_values is not None) and (
115-
target_value := ssd.target_values.get(none_throws(task_feature_index))
116-
) is not None:
117-
outcome_transform_options.setdefault("default_task_value", int(target_value))
118112
outcome_transform_options.setdefault("stratification_idx", task_feature_index)
119-
outcome_transform_options.setdefault("observed_task_values", task_values)
120113
outcome_transform_options.setdefault(
121114
"all_task_values",
122115
torch.tensor(

0 commit comments

Comments
 (0)