sammo.search_op
#
This module contains a variety of search operators that can be used to define a discrete search space for GridSearch or define a set of initial candidates for other search algorithms.
Module Contents#
Functions#
Search operator for selecting one of the given candidates. |
|
Search operator for n choose k. |
|
Search operator for permutating a list of components. |
|
Search operator for making a component optional. |
|
Materialize a number of points from a search space. |
|
Return the first value of the enumerated search space. |
API#
- sammo.search_op.one_of(candidates: beartype.typing.Iterable, reference_id: str | None = None) beartype.typing.Any #
Search operator for selecting one of the given candidates.
- Parameters:
candidates â The list of candidates to choose from.
reference_id â Identifier for later reference.
- sammo.search_op.many_of(num_choices: int, candidates: beartype.typing.Iterable, reference_id: str | None = None) beartype.typing.Any #
Search operator for n choose k.
- Parameters:
num_choices â The number of candidates to choose.
candidates â The list of candidates to choose from.
reference_id â Identifier for later reference.
- sammo.search_op.permutate(candidates: beartype.typing.Iterable, reference_id: str | None = None) beartype.typing.Any #
Search operator for permutating a list of components.
- Parameters:
candidates â The list of components to permute.
reference_id â Identifier for later reference.
- sammo.search_op.optional(candidate, reference_id=None) beartype.typing.Any #
Search operator for making a component optional.
- Parameters:
val â The value to include or exclude.
reference_id â Identifier for later reference.
- sammo.search_op.get_points_from_search_space(search_space: beartype.typing.Callable | sammo.base.Component | list | dict, n_points: int, sample: bool = False, seed: int = 42, return_names: bool = False) list[sammo.base.Component] #
Materialize a number of points from a search space.
- Parameters:
search_space â Search space, either represented as function or a single Output class.
n_points â Number of points to materialize.
sample â Whether to sample from the search space or enumerate and return first n_points.
seed â Random seed for sampling.
return_names â Whether to return the names of the points.
- sammo.search_op.get_first_point(search_space: beartype.typing.Callable | sammo.base.Component | list | dict) sammo.base.Component #
Return the first value of the enumerated search space.
- Parameters:
search_space â Search space, either represented as function or a single Output class.