Skip to content

Commit 6a2086b

Browse files
committed
Add section on interpoint constraints to userguide
1 parent 46102fb commit 6a2086b

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docs/userguide/constraints.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,45 @@ ContinuousLinearConstraint(
8282
A more detailed example can be found
8383
[here](../../examples/Constraints_Continuous/linear_constraints).
8484

85+
### Continuous Interpoint Constraints
86+
87+
The constraints discussed in the previous paragraph belong to the class of so called
88+
"intrapoint constraints". That is, they impose conditions on each individual point of a batch.
89+
In contrast to this, interpoint constraints do so **across** the points of the batch.
90+
That is, an interpoint constraint of the form ``x_1 + x_2 <= 1`` enforces that the sum of all
91+
``x_1`` values plus the sum of all ``x_2`` values in the batch must not exceed 1.
92+
A possible relevant constraint might be that only 100ml of a given solvent are available for
93+
a full batch, but there is no limit for the amount of solvent to use for a single experiment
94+
within that batch.
95+
96+
They can be defined by using the `interpoint` keyword of the [`ContinuousLinearConstraint`](baybe.constraints.continuous.ContinuousLinearConstraint)
97+
class.
98+
```python
99+
from baybe.constraints import ContinuousLinearConstraint
100+
101+
ContinuousLinearConstraint(
102+
parameters=["SolventAmount[ml]"],
103+
operator="<=",
104+
coefficients=[1.0],
105+
rhs=100,
106+
interpoint=True,
107+
)
108+
```
109+
110+
```{admonition} Experimental feature
111+
:class: warning
112+
Interpoint constraints are currently considered an *experimental feature* and are still
113+
under active development. This means that there are some limitations, and that the
114+
usage as well as the implementation of interpoint constraints might change in the future.
115+
The currently know main limitatations are the following:
116+
- BayBE does not support to use both interpoint and cardinality constraints
117+
within the same search space.
118+
- When using interpoint constraints, the optimization will not be done sequentially,
119+
potentially increasing the runtime.
120+
- Interpoint constraints are only supported in purely continuous spaces and are not
121+
available in hybrid spaces.
122+
```
123+
85124
### ContinuousCardinalityConstraint
86125
The {class}`~baybe.constraints.continuous.ContinuousCardinalityConstraint` gives you a
87126
tool to control the number of active factors (i.e. parameters that take a non-zero

0 commit comments

Comments
 (0)