Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Limit max iterations not working on SciPy optimisers #237

Closed
BradyPlanden opened this issue Mar 13, 2024 · 0 comments · Fixed by #224
Closed

[Bug]: Limit max iterations not working on SciPy optimisers #237

BradyPlanden opened this issue Mar 13, 2024 · 0 comments · Fixed by #224
Labels
bug Something isn't working

Comments

@BradyPlanden
Copy link
Member

Python Version

3.11

Describe the bug

The SciPy solvers aren't passed optim.set_max_iterations() correctly at the moment, this is fixed in #224.

Steps to reproduce the behaviour

    @pytest.mark.unit
    def test_infeasible_solutions(self, cost):
        # Test infeasible solutions
        for optimiser in [pybop.SciPyMinimize, pybop.GradientDescent]:
            optim = pybop.Optimisation(
                cost=cost, optimiser=optimiser, allow_infeasible_solutions=False
            )
            optim.set_max_iterations(1)
            optim.run()
            assert optim._iterations == 1

stochastically returns values > 1

Relevant log output

No response

@BradyPlanden BradyPlanden added the bug Something isn't working label Mar 13, 2024
@BradyPlanden BradyPlanden linked a pull request Mar 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant