Skip to content

Commit

Permalink
Fix math in CardinalityConstraint docstring (#405)
Browse files Browse the repository at this point in the history
This PR fixes the displayed math in the docstring of the CardinalityConstraint class (see #195 ).
  • Loading branch information
AVHopp authored Oct 15, 2024
2 parents 5380bcd + acfc1db commit 1405d16
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions baybe/constraints/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,15 @@ class ContinuousConstraint(Constraint, ABC):

@define
class CardinalityConstraint(Constraint, ABC):
"""Abstract base class for cardinality constraints.
r"""Abstract base class for cardinality constraints.
Places a constraint on the set of nonzero (i.e. "active") values among the
specified parameters, bounding it between the two given integers,
``min_cardinality`` <= |{p_i : p_i != 0}| <= ``max_cardinality``
where ``{p_i}`` are the parameters specified for the constraint.
specified parameters, bounding it between the two given integers, i.e.
.. math::
\text{min_cardinality} \leq |\{p_i : p_i \neq 0\}| \leq \text{max_cardinality}
where :math:`\{p_i\}` are the parameters specified for the constraint.
Note that this can be equivalently regarded as L0-constraint on the vector
containing the specified parameters.
Expand Down

0 comments on commit 1405d16

Please sign in to comment.