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

Add progress hook (and example usage in test) for calibrate #445

Merged
merged 3 commits into from
Jan 2, 2024

Conversation

SamWitty
Copy link
Contributor

@SamWitty SamWitty commented Jan 2, 2024

This small PR addresses a comment in #444 by @fivegrant about how the progress hook for calibrate went missing after the refactoring PR in #431 . Here, we implement a progress hook by calling a user-provided function of the iteration id i and the loss, which the user can make stateful. In the tests we show an example of a progress hook that logs the iteration ids and losses, and stores them as an attribute.

@SamWitty SamWitty added awaiting review PR submitter awaiting code review from reviewer integration Tasks for integration with TA4 labels Jan 2, 2024
@SamWitty SamWitty self-assigned this Jan 2, 2024
Copy link
Collaborator

@fivegrant fivegrant left a comment

Choose a reason for hiding this comment

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

Looks good to me. NOTE: The service will need to be updated to handle the loss as well.

@SamWitty SamWitty merged commit 550902f into main Jan 2, 2024
5 checks passed
@SamWitty SamWitty deleted the sw-calibrate-progress-hook branch January 2, 2024 16:15
fivegrant added a commit to fivegrant/pyciemss that referenced this pull request Jan 3, 2024
* Add `ensemble` dir to `setup.cfg`

* Align return type of `calibrate`

* Change "parameters" -> "inferred_parameters"

* added pyciemss logging wrapper to calibrate (ciemss#444)

* Add progress hook (and example usage in test) for `calibrate` (ciemss#445)

* added progress hook for calibrate

* added test with simple logging

* lint

* Fix formatting, linting, etc

---------

Co-authored-by: Sam Witty <samawitty@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review PR submitter awaiting code review from reviewer integration Tasks for integration with TA4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants