def __init__(self, fitness_function, multipliers=None, zero=None):
"""
:param fitness_function: a `callable` object
:param multipliers: coordinate-wise multipliers.
:param zero: defines a new zero in preimage space, that is,
calling the `ScaleCoordinates` instance returns
``fitness_function(multipliers * (x - zero))``.
For both arguments, ``multipliers`` and ``zero``, to fit in
case the length of the given input, superfluous trailing
elements are ignored or the last element is recycled.
"""
ComposedFunction.__init__(self,
[fitness_function, self.scale_and_offset])
self.multiplier = multipliers
if self.multiplier is not None:
self.multiplier = np.asarray(self.multiplier, dtype=float)
self.zero = zero
if zero is not None:
self.zero = np.asarray(zero, dtype=float)
评论列表
文章目录