def __init__(self, func, noise_type, level, verify=True):
assert isinstance(func, TestFunction)
if level <= 0:
raise ValueError('Noise level must be positive, level={0}'.format(level))
super(Noisifier, self).__init__(func.dim, verify)
self.bounds, self.min_loc, self.fmax, self.fmin = func.bounds, func.min_loc, func.fmax, func.fmin
self.type = noise_type
self.level = level
self.func = func
self.classifiers = list(set(self.classifiers) | set(['noisy']))
评论列表
文章目录