-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Example of K-fold Cross Validation with Fabric
#16909
Conversation
Fabric
Instead of having the k-folds in outer loop, it would be better to loop over the folds in each epoch. Otherwise you will not be able to things like early stopping or pruning doing hyperparameter sweeps.
|
That makes sense. I'm looking into it. |
@peterchristofferholm I made the changes accordingly. I believe I saw K-Fold implemented in both ways, one where the k-fold loop is the outermost one and one where the epoch loop is. Not sure if there is one correct one, because eventually, you would want to aggregate validation score across the models. @awaelchli Can you maybe also review how Fabric has been used? |
The downside of this is, that with the current implementation you have K-times your model in GPU-memory (which often fits only a single model), or you have to do manual device management |
@awaelchli @justusschock @peterchristofferholm I guess I have both the implementations in the git history. Let me know which one is preferred, and I'll keep that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comments.
Thanks for jumping on this so quickly. Impressive!
What does this PR do?
Resolves #16902
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist