fitness_transformations.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:pycma 作者: CMA-ES 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号