@@ -125,6 +125,10 @@ def __post_init__(self) -> None:
125
125
"Must specify `raw_samples` when "
126
126
"`batch_initial_conditions` is None`."
127
127
)
128
+ if self .fixed_features is not None and any (
129
+ (k < 0 for k in self .fixed_features )
130
+ ):
131
+ raise ValueError ("All indices (keys) in `fixed_features` must be >= 0." )
128
132
129
133
def get_ic_generator (self ) -> TGenInitialConditions :
130
134
if self .ic_generator is not None :
@@ -467,7 +471,8 @@ def optimize_acqf(
467
471
is set to 1, which will be done automatically if not specified in
468
472
`options`.
469
473
fixed_features: A map `{feature_index: value}` for features that
470
- should be fixed to a particular value during generation.
474
+ should be fixed to a particular value during generation. All indices
475
+ should be non-negative.
471
476
post_processing_func: A function that post-processes an optimization
472
477
result appropriately (i.e., according to `round-trip`
473
478
transformations).
@@ -610,7 +615,8 @@ def optimize_acqf_cyclic(
610
615
with each tuple encoding an inequality constraint of the form
611
616
`\sum_i (X[indices[i]] * coefficients[i]) = rhs`
612
617
fixed_features: A map `{feature_index: value}` for features that
613
- should be fixed to a particular value during generation.
618
+ should be fixed to a particular value during generation. All indices
619
+ should be non-negative.
614
620
post_processing_func: A function that post-processes an optimization
615
621
result appropriately (i.e., according to `round-trip`
616
622
transformations).
@@ -758,11 +764,13 @@ def optimize_acqf_list(
758
764
Using non-linear inequality constraints also requires that `batch_limit`
759
765
is set to 1, which will be done automatically if not specified in
760
766
`options`.
761
- fixed_features: A map `{feature_index: value}` for features that
762
- should be fixed to a particular value during generation.
767
+ fixed_features: A map `{feature_index: value}` for features that should
768
+ be fixed to a particular value during generation. All indices
769
+ (`feature_index`) should be non-negative.
763
770
fixed_features_list: A list of maps `{feature_index: value}`. The i-th
764
771
item represents the fixed_feature for the i-th optimization. If
765
772
`fixed_features_list` is provided, `optimize_acqf_mixed` is invoked.
773
+ All indices (`feature_index`) should be non-negative.
766
774
post_processing_func: A function that post-processes an optimization
767
775
result appropriately (i.e., according to `round-trip`
768
776
transformations).
@@ -872,7 +880,8 @@ def optimize_acqf_mixed(
872
880
raw_samples: Number of samples for initialization. This is required
873
881
if `batch_initial_conditions` is not specified.
874
882
fixed_features_list: A list of maps `{feature_index: value}`. The i-th
875
- item represents the fixed_feature for the i-th optimization.
883
+ item represents the fixed_feature for the i-th optimization. All
884
+ indices (`feature_index`) should be non-negative.
876
885
options: Options for candidate generation.
877
886
inequality constraints: A list of tuples (indices, coefficients, rhs),
878
887
with each tuple encoding an inequality constraint of the form
0 commit comments