saealib.DuplicateElimination#

class saealib.DuplicateElimination(atol=1e-16, rtol=0.0, max_retries=100)[ソース]#

ベースクラス: object

Filter offspring that duplicate any member of the current population.

パラメータ:
  • atol (float) -- Absolute tolerance passed to numpy.isclose. Matches the atol semantics of ArchiveMixin.

  • rtol (float) -- Relative tolerance passed to numpy.isclose. Matches the rtol semantics of ArchiveMixin.

  • max_retries (int) -- Maximum number of regeneration attempts per ask() call.

Methods

__init__

contract

Return the duplicate-filter contract.

find_duplicates

Return a boolean mask of offspring that duplicate the population.

Method Details

DuplicateElimination.__init__(atol=1e-16, rtol=0.0, max_retries=100)#
パラメータ:
  • atol (float)

  • rtol (float)

  • max_retries (int)

戻り値の型:

None

DuplicateElimination.contract()[ソース]#

Return the duplicate-filter contract.

戻り値の型:

ComponentContract

DuplicateElimination.find_duplicates(off_x, pop_x)[ソース]#

Return a boolean mask of offspring that duplicate the population.

パラメータ:
  • off_x (numpy.ndarray of shape (N, dim)) -- Offspring decision vectors.

  • pop_x (numpy.ndarray of shape (M, dim)) -- Current population decision vectors.

戻り値:

True where off_x[i] is element-wise close to any row of pop_x, using the same atol / rtol as _find_idx().

戻り値の型:

numpy.ndarray of shape (N,), dtype bool