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

Fix/added unique ids to model_name #760

Merged
merged 5 commits into from
Feb 4, 2022

Conversation

gdevos010
Copy link
Contributor

Fixes #759

Summary

added date and pid to name

Other Information

current_time = time.strftime("%Y-%m-%d_%H:%M:%S", time.localtime())
param_combination_dict[
"model_name"
] = f"{current_time}_{param_combination_dict['model_name']}_{os.getpid()}"
Copy link
Contributor

Choose a reason for hiding this comment

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

How about using something that allows mapping back to the parameters combination being used? Maybe instead of the current time, using the index of the currently evaluated parameters within params_cross_product would make this easier? Also do we need the process PID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed the current naming convention.

if model_name is None:
current_time = datetime.datetime.now().strftime("%Y-%m-%d_%H.%M.%S.%f")
model_name = current_time + "_torch_model_run_" + str(os.getpid())

The naming was discussed in #346

The params_cross_product is not provided to the user, so it's unclear how useful this would be. The name also needs to be unique across consecutive runs; otherwise, multiple events files will be in the same folder again. So a simple index would not surface. We could remove the PID and just use the current time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The hyperparameters could be saved to tensorboard to map them back quickly

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, so let's leave it as you propose, but without the PID, OK?
Also, could you unit-test this? Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the naming convention. I'm not sure its worth the time to unit test this since hyperparameter tuning will completely change with pytorch-lightning. I could try to do it, but work has really picked up this week.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, np :) Thanks for the fix!

@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2022

Codecov Report

Merging #760 (016321f) into master (ec6ccf8) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #760      +/-   ##
==========================================
- Coverage   90.80%   90.77%   -0.03%     
==========================================
  Files          67       67              
  Lines        6752     6756       +4     
==========================================
+ Hits         6131     6133       +2     
- Misses        621      623       +2     
Impacted Files Coverage Δ
darts/models/forecasting/forecasting_model.py 96.55% <50.00%> (-0.82%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec6ccf8...016321f. Read the comment docs.

Copy link
Contributor

@hrzn hrzn left a comment

Choose a reason for hiding this comment

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

Thanks!

@hrzn hrzn merged commit c2d91e0 into unit8co:master Feb 4, 2022
@gdevos010 gdevos010 deleted the fix/gridsearch_model_name branch May 27, 2022 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] tensorboard does not work with gridsearch when model_name is provided
3 participants