8000 Create Cross-Validation example by muellerzr · Pull Request #317 · huggingface/accelerate · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Create Cross-Validation example #317

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

Merged
merged 3 commits into from
Apr 19, 2022
Merged

Create Cross-Validation example #317

merged 3 commits into from
Apr 19, 2022

Conversation

muellerzr
Copy link
Contributor

Add Cross-Validation Example + Tests

What does this add?

This adds an example to examples/by_feature for performing Cross Validation with Accelerate.

Along with this, since we cannot run Cross-Validation well on 4 examples (our test sample dataset), I have elected to move the bits over from transformers so we can have slow tests. The CV examples run under slow, and take quite a bit (even on GPU, a minute). Ideally I should come up with a better solution for this, but I think for now if it is the only one it is not the end of the world.

This also implements the "skip_example" feature mentioned in my previous PR for making sure all aspects of a test are implemented in complete_*_example.py, since cross-validation is too niche for that.

Who is it for?

Users of Accelerate, especially Kagglers, who want to perform Cross Validation with Accelerate and still have clean code

Why is it needed?

Cross-Validation has a variety of setups that need to happen, and its not always straightforward how to do so with Accelerate in those instances (such as running Accelerator.clean_memory() at the end of a fold. This example shows how to do this

What parts of the API does this impact?

User-facing:

A new cross_validation.py script, with a single added argument of num_folds

Basic Usage Example(s):

python examples/cross_validation.py --num_folds 2

Anticipated maintence burden? (What will happen in say, 3 months if something changes)

Most likely a better way of having "longer" example datasets to test will be used, and this test will need a refactor as a result

@muellerzr muellerzr added enhancement New feature or request documentation Improvements or additions to documentation labels Apr 19, 2022
@muellerzr muellerzr requested a review from sgugger April 19, 2022 17:54
@muellerzr
Copy link
Contributor Author
muellerzr commented Apr 19, 2022

Still todo is update the script docs, but code wise it's good

Done!

@HuggingFaceDocBuilderDev
Copy link
HuggingFaceDocBuilderDev commented Apr 19, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator
@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks a lot for adding this!

@muellerzr muellerzr merged commit 2d7fbbd into main Apr 19, 2022
@muellerzr muellerzr deleted the cross_validation branch April 19, 2022 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0