Move super.optimize() call to first validate params
@@ -113,12 +113,11 @@ class SPSA(Optimizer):
self._skip_calibration = skip_calibration
def optimize(self, num_vars, objective_function, gradient_function=None, variable_bounds=None, initial_point=None):
+ super().optimize(num_vars, objective_function, gradient_function, variable_bounds, initial_point)
if not isinstance(initial_point, np.ndarray):
initial_point = np.asarray(initial_point)
- super().optimize(num_vars, objective_function, gradient_function, variable_bounds, initial_point)
-
logger.debug('Parameters: {}'.format(self._parameters))
if not self._skip_calibration:
# at least one calibration, at most 25 calibrations
