-
Couldn't load subscription status.
- Fork 1
Add a log for the minimizers #59
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
Draft
santisoler
wants to merge
18
commits into
main
Choose a base branch
from
minimizer-log
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add an optional `callback` argument to the `GaussNewtonConjugateGradient` minimizer that gets called before yielding any model. The callback function takes a new `MinimizerResult` data class with some information about the minimization process.
Use the Log protocol in the Inversion class.
Revert this commit if not good. I pushed it by the end of the day.
The `InversionLog` now holds a `get_minimizer_callback` method that returns a function that can be passed to `Minimizer`'s as the `callback` argument. The `InversionLog` creates a new `MinimizerLog` every time the `get_minimizer_callback` is called, appends it to a running list of `minimizer_logs`, and returns the `update` method of the newly created one. The `Inversion` then passes this callable to the `Minimizer` when called. This way the logs of all minimization steps are being stored inside the `InversionLog`.
It's best to build the Rich renderables and store them in memory rather than rebuilding them every time the `__rich__` method is called. This is to avoid async issues that might happen when the `Live` wants to update the renderable, but some pieces of the code required to build it is still running (filling the log for example). So it's better to always have one renderable ready to be shown.
We better keep it flexible rather than having it as a dataclass. Update the MinimizerLog so it can add any column in the result to the logger.
Print the inversion log table first and then each of the minimizer logs in a tree structure. This way we simplify the `__rich__` method of the `InversionLogRich`: we don't need to worry about it having minimizer logs or not.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.