def gradient(self, x): return pg.estimate_gradient_h(lambda x: self.fitness(x), x)
def gradient(self, x): """ Method for gradient calculation, as demanded by the pygmo package for some pygmo optimizers. """ return pygmo.estimate_gradient_h(lambda x: self.fitness(x), x)
def gradient(self, x): """PyGMO function - estimate gradient""" return pg.estimate_gradient_h(lambda x: self.fitness(x), x)
def gradient(self, x): import pygmo as pg return pg.estimate_gradient_h(self.fitness, x)