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

feat: Add method to get the best configuration directly from Tuner, add com… #767

Merged
merged 7 commits into from
Oct 12, 2023

Conversation

geoalgo
Copy link
Contributor

@geoalgo geoalgo commented Oct 9, 2023

…ments on how to rerun the best configuration found

Also updates metric_name_mode to:

  1. test the logic as it is quite tricky with union types
  2. stop returning metric argument which is an input
  3. don’t pass verbose which is always set to true and overlaps logging verbosity
  4. move to an util where it can be imported to multiple places without creating import conflicts

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ments on how to rerun the best configuration found
@geoalgo geoalgo requested a review from wesk October 9, 2023 07:14
@geoalgo geoalgo changed the title Add method to get the best configuration directly from Tuner, add com… feat: Add method to get the best configuration directly from Tuner, add com… Oct 9, 2023
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (2bc3343) 64.06% compared to head (d647877) 62.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #767      +/-   ##
==========================================
- Coverage   64.06%   62.98%   -1.09%     
==========================================
  Files         436      437       +1     
  Lines       29136    28904     -232     
==========================================
- Hits        18666    18204     -462     
- Misses      10470    10700     +230     
Files Coverage Δ
tst/experiments/test_metric_name_mode.py 100.00% <100.00%> (ø)
syne_tune/util.py 74.48% <94.11%> (+1.04%) ⬆️
syne_tune/experiments/experiment_result.py 27.00% <57.14%> (-2.91%) ⬇️
syne_tune/tuner.py 82.88% <28.57%> (-1.61%) ⬇️

... and 118 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

syne_tune/util.py Outdated Show resolved Hide resolved
Comment on lines +710 to +711
f"```tuner.trial_backend.start_trial(config={config}, checkpoint_trial_id={trial_id})``` to start from "
f"last checkpoint (your script should have stored a checkpoint)"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here or in the FAQ entry, would it make sense to explain when you would use best_config() versus a checkpoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not really versus, you can only restart from a checkpoint if your script supports checkpointing which may not be the case.

I do not think it would make sense to explain checkpointing there as it has its own set of FAQ items, for instance:

Comment on lines 74 to 76
# Print the best configuration found from the tuner and retrain it
trial_id, best_config = tuner.best_config()
tuner.trial_backend.start_trial(config=best_config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe plot again, and hopefully show improvement? Or consider splitting out into a separate retraining example?

Otherwise it feels a bit random - why train again and then do nothing with it after?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One use-case could be to run with a larger budget, I do not have one use-case personally but I know some people asks for this so it probably have an example showing how it can be done.

Co-authored-by: Wes Kendrick <jkkndr@amazon.com>
wesk
wesk previously approved these changes Oct 11, 2023
@geoalgo geoalgo merged commit e017ee9 into main Oct 12, 2023
34 checks passed
@geoalgo geoalgo deleted the checkpoint branch October 12, 2023 09:56
@wesk wesk added the feature label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants