SearchSpace API#
The SearchSpace API is the public facade for candidate representations and space-specific services.
Use names from saealib.space rather than the space implementation modules.
Spaces, services, and adapters#
Search spaces#
Search spaces provide GenomeBatch representations.
Protocol for an optimization search space. |
|
Registry of services offered by a SearchSpace. |
|
The result of validating a GenomeBatch against a SearchSpace. |
|
A concrete representation: a registered kind name plus its parameters. |
|
A search space for continuous numeric vectors defined by variable bounds. |
|
A search space for arbitrary Python objects. |
|
A search space for finite-alphabet sequences with a length range. |
|
A search space whose genomes are permutations of |
SearchSpace services#
SearchSpace services such as sampling and validation are capabilities provided by a space.
Service for encoding genomes into persistable primitives and decoding back. |
|
Service for drawing new genomes from a SearchSpace. |
|
Service for checking if genomes are well-formed for a space. |
Adapters#
EvaluationAdapter is an adapter at the evaluation boundary that converts a GenomeBatch into an EvaluationPayload.
FeatureEncoder is an adapter subtype exposed as saealib.space.FeatureEncoder. It converts a GenomeBatch into a FeatureBatch and determines which features a surrogate can learn. It differs in kind from space capabilities such as SamplingService.
In the current implementation, the SurrogateManager contract declares ServiceRequirement("FeatureEncoder"), and VectorSpace registers a default encoder as a service, so numeric vector spaces resolve it without extra configuration. ObjectSpace, PermutationSpace, and SequenceSpace fail to resolve it unless the user provides a FeatureEncoder. The user decides which input is passed to the surrogate.
Service that maps opaque genomes to surrogate feature rows. |