Skip to content

Commit

Permalink
disable=too-many-arguments in optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
edoaltamura committed Sep 25, 2024
1 parent 286e775 commit 4da0fb2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qiskit_machine_learning/optimizers/spsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ def __call__(self, nfev, parameters, value, stepsize, accepted) -> bool:
"""

# pylint: disable=too-many-arguments
def __init__(

def __init__( # pylint: disable=too-many-arguments
self,
maxiter: int = 100,
blocking: bool = False,
Expand Down Expand Up @@ -282,7 +282,7 @@ def __init__(
self._smoothed_hessian: np.ndarray | None = None # smoothed average of the Hessians

@staticmethod
def calibrate(
def calibrate( # pylint: disable=too-many-arguments
loss: Callable[[np.ndarray], float],
initial_point: np.ndarray,
c: float = 0.2,
Expand Down Expand Up @@ -414,7 +414,7 @@ def settings(self) -> dict[str, Any]:
"termination_checker": self.termination_checker,
}

def _point_sample(self, loss, x, eps, delta1, delta2):
def _point_sample(self, loss, x, eps, delta1, delta2): # pylint: disable=too-many-arguments
"""A single sample of the gradient at position ``x`` in direction ``delta``."""
# points to evaluate
points = [x + eps * delta1, x - eps * delta1]
Expand Down Expand Up @@ -479,7 +479,7 @@ def _point_estimate(self, loss, x, eps, num_samples):
hessian_estimate / num_samples,
)

def _compute_update(self, loss, x, k, eps, lse_solver):
def _compute_update(self, loss, x, k, eps, lse_solver): # pylint: disable=too-many-arguments
# compute the perturbations
if isinstance(self.resamplings, dict):
num_samples = self.resamplings.get(k, 1)
Expand Down

0 comments on commit 4da0fb2

Please sign in to comment.