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

Improved OptimizationSolver API #176

Merged
merged 11 commits into from
Feb 1, 2023
Merged

Improved OptimizationSolver API #176

merged 11 commits into from
Feb 1, 2023

Conversation

AlessandroPierro
Copy link
Collaborator

@AlessandroPierro AlessandroPierro commented Jan 31, 2023

Issue Number: #161

Objective of pull request: update OptimizationSolver API to return a complete report of execution

Pull request checklist

Your PR fulfills the following requirements:

  • Issue created that explains the change and why it's needed
  • Tests are part of the PR (for bug fixes / features)
  • Docs reviewed and added / updated if needed (for bug fixes / features)
  • PR conforms to Coding Conventions
  • PR applys BSD 3-clause or LGPL2.1+ Licenses to all code files
  • Lint (pyb) passes locally
  • Build tests (pyb -E unit) or (python -m unittest) passes locally

Pull request type

Please check your PR type:

  • Feature

What is the new behavior?

  • The OptimizationSolver can be configured passing a SolverConfig containing all parameters related to the execution
  • The OptimizationSolver.solve method now returns a SolverReport instance containing all the results from solver execution, profiling, and the parameters used for the exection (improving reproducibility).
  • The solve method (available through from lava.lib.optimization.solvers.generic.solvers import solve) provides a simplified interface to obtain just the best solution passing a problem and, optionally, a SolverConfig instance.
  • The SolverTuner interface has been updated accordingly, enabling the definition of arbitrary fitness function in the form f : SolverReport -> float.

Does this introduce a breaking change?

  • Yes

@AlessandroPierro AlessandroPierro self-assigned this Jan 31, 2023
@AlessandroPierro AlessandroPierro linked an issue Jan 31, 2023 that may be closed by this pull request
1 task
@AlessandroPierro AlessandroPierro marked this pull request as ready for review February 1, 2023 08:46
@AlessandroPierro AlessandroPierro added the 1-feature New feature or request label Feb 1, 2023
@AlessandroPierro AlessandroPierro changed the title Solver report Improved OptimizationSolver API Feb 1, 2023
Copy link
Collaborator

@GaboFGuerra GaboFGuerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Alessandro, Please update the docstring of the fitness_fn before merging, it still has the old signature.

src/lava/lib/optimization/utils/solver_tuner.py Outdated Show resolved Hide resolved
@AlessandroPierro AlessandroPierro merged commit b7d647b into main Feb 1, 2023
@AlessandroPierro AlessandroPierro deleted the solver-report branch February 1, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OptimizationSolver to return a report of execution
2 participants