def __call__(self, x): # evaluate objective function of TV gradient EnergyValTV = TV_ENERGY(np.asarray(x.as_array(), dtype=np.float32), np.asarray(x.as_array(), dtype=np.float32), self.lambdaReg, 2) return 0.5 * EnergyValTV[0]
def __call__(self,x): in_arr = np.asarray(x.as_array(), dtype=np.float32, order='C') EnergyValTV = TV_ENERGY(in_arr, in_arr, self.alpha, 2) return 0.5*EnergyValTV[0]