Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Uri Granta committed Jul 31, 2024
1 parent 003d8a7 commit 25d20ca
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions trieste/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
SearchSpaceType = TypeVar("SearchSpaceType", bound="SearchSpace")
""" A type variable bound to :class:`SearchSpace`. """

DiscreteSearchSpaceType = TypeVar("DiscreteSearchSpaceType", bound="GeneralDiscreteSearchSpace")
""" A type variable bound to :class:`GeneralDiscreteSearchSpace`. """

DEFAULT_DTYPE: tf.DType = tf.float64
""" Default dtype to use when none is provided. """

Expand Down Expand Up @@ -507,7 +504,7 @@ def __eq__(self, other: object) -> bool:

@runtime_checkable
class HasOneHotEncoder(Protocol):
"""A search space that contains default logic for one-hot encoding."""
"""A categorical search space that contains default logic for one-hot encoding."""

@property
@abstractmethod
Expand All @@ -523,7 +520,7 @@ def one_hot_encoder(space: SearchSpace) -> EncoderFunction:
class CategoricalSearchSpace(GeneralDiscreteSearchSpace, HasOneHotEncoder):
r"""
A categorical :class:`SearchSpace` representing a finite set :math:`\mathcal{C}` of categories,
or a finite Cartesian product :math:`\mathcal{C_1} \times \cdots \times \mathcal{C_n}` of
or a finite Cartesian product :math:`\mathcal{C}_1 \times \cdots \times \mathcal{C}_n` of
such sets.
For example:
Expand Down Expand Up @@ -580,7 +577,6 @@ def __init__(self, categories: int | Sequence[int] | Sequence[str] | Sequence[Se

self._tags = tags

# TODO: inherit from GridSearchSpace to avoid generating the points explicitly?
ranges = [tf.range(len(ts)) for ts in tags]
meshgrid = tf.meshgrid(*ranges, indexing="ij")
points = (
Expand Down

0 comments on commit 25d20ca

Please sign in to comment.