saealib.space.VectorSpace#

class saealib.space.VectorSpace(dim, lb, ub, *, atol=1e-16, rtol=0.0)[ソース]#

ベースクラス: object

A search space for continuous numeric vectors defined by variable bounds.

パラメータ:
  • dim (int) -- Dimension of the vector space.

  • lb (Sequence[float] | np.ndarray) -- Lower bounds per dimension.

  • ub (Sequence[float] | np.ndarray) -- Upper bounds per dimension.

  • atol (float, optional) -- Absolute tolerance for approximate equivalence matching (default: 1e-16).

  • rtol (float, optional) -- Relative tolerance for approximate equivalence matching (default: 0.0).

Methods

__init__

sample

Sample n random genomes uniformly within bounds.

validate

Check if genomes batch is well-formed and within bounds.

Method Details

VectorSpace.__init__(dim, lb, ub, *, atol=1e-16, rtol=0.0)[ソース]#
パラメータ:
  • dim (int)

  • lb (Sequence[float] | ndarray)

  • ub (Sequence[float] | ndarray)

  • atol (float)

  • rtol (float)

戻り値の型:

None

VectorSpace.sample(n, rng=None)[ソース]#

Sample n random genomes uniformly within bounds.

パラメータ:
  • n (int)

  • rng (Generator | None)

戻り値の型:

DenseVectorBatch

VectorSpace.validate(genomes)[ソース]#

Check if genomes batch is well-formed and within bounds.

パラメータ:

genomes (GenomeBatch)

戻り値の型:

ValidationResult