def __call__(self, x):
        res = median([self.f(x) for _ in range(int(self.resample_over))])
        if self.num_evals%self.batchsize == 0 and self.num_evals > 0:
            alt_res = median([self.f(x) for _ in range(int(self.resample_over))])
            self._adaptResampling(res, alt_res)
            res = 0.5*res+0.5*alt_res
        self.recents[self.num_evals%self.batchsize] = res
        self.num_evals += 1
        return res
dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/aptativeresampling.py/AdaptiveResampler.__call__/original