saealib.DuplicateElimination#
- class saealib.DuplicateElimination(atol=1e-16, rtol=0.0, max_retries=100)[source]#
Bases:
objectFilter offspring that duplicate any member of the current population.
- Parameters:
atol (float) – Absolute tolerance passed to
numpy.isclose. Matches theatolsemantics ofArchiveMixin.rtol (float) – Relative tolerance passed to
numpy.isclose. Matches thertolsemantics ofArchiveMixin.max_retries (int) – Maximum number of regeneration attempts per
ask()call.
Methods
Return the duplicate-filter contract. |
|
Return a boolean mask of offspring that duplicate the population. |
Method Details
- DuplicateElimination.__init__(atol=1e-16, rtol=0.0, max_retries=100)#
- Parameters:
atol (float)
rtol (float)
max_retries (int)
- Return type:
None
- DuplicateElimination.find_duplicates(off_x, pop_x)[source]#
Return a boolean mask of offspring that duplicate the population.
- Parameters:
off_x (numpy.ndarray of shape (N, dim)) – Offspring decision vectors.
pop_x (numpy.ndarray of shape (M, dim)) – Current population decision vectors.
- Returns:
Truewhereoff_x[i]is element-wise close to any row ofpop_x, using the sameatol/rtolas_find_idx().- Return type:
numpy.ndarray of shape (N,), dtype bool