Skip to content

Commit

Permalink
fixed last tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Simone-Bordoni committed Sep 24, 2024
1 parent 3ce8a2d commit 21b08c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/qibo/models/error_mitigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def _curve_fit(
if backend.name == "pytorch":
# pytorch has some problems with the `scipy.optim.curve_fit` function
# thus we use a `torch.optim` optimizer
params = params.requires_grad_(True)
loss = lambda pred, target: backend.np.mean((pred - target) ** 2)
optimizer = backend.np.optim.LBFGS(
[params], lr=lr, max_iter=max_iter, tolerance_grad=tolerance_grad
Expand Down

0 comments on commit 21b08c1

Please sign in to comment.