patrick-kidger / patrick-kidger/optimistix

Question about `BestSoFar` wrapper and handling of `max_steps`

Open
#147 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
623
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Hi,

First, I'd like to say thank you for this fantastic package! The active development and quality of the documentation are truly appreciated and inspiring. I am a recent user of jax and this type of work makes you appreciate even more how incredible it is.

I have two questions:

  1. Understanding the BestSoFar wrapper: As I understand it, this wrapper returns the parameters that achieved the best objective value during the entire search, rather than the parameters from the final step. For example, if a search evaluated three points, x_1, x_2, and x_3, with objective values f(x_2) < f(x_3) < f(x_1), the BestSoFar wrapper would return x_2. Is this understanding correct?

  2. Behavior upon reaching max_steps: I've noticed that when an optimization reaches max_steps, an error is raised. This seems to differ from a library like SciPy, which would simply stop and return the last state. Is this correct? For my use case, it would be very useful to get the best result found, even if the optimization terminated by reaching max_steps. Is there a recommended way to achieve this and avoid the error?

Thank you again for your time and effort on this project.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the implementation and documentation for the BestSoFar wrapper and max_steps handling, then inspect how termination errors are surfaced. Clarify whether the wrapper retains the best result at the step limit and document or define the recommended behavior for that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.