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 support for dataloader samplers #713

Merged
merged 12 commits into from
Dec 6, 2024

Conversation

nkaenzig
Copy link
Collaborator

@nkaenzig nkaenzig commented Nov 22, 2024

Closes #712

  • Adds a samplers argument to eva.DataModule, so we can enable custom samplers in the dataloaders.
    • This enables for instance label efficiency experiments, as we can reduce the number of training samples for the existing downstream tasks.
  • Adds a BalancedSampler which supports balanced class sample data loading for classification tasks.

How to use

Just add this to the init_args of the DataModule in your yaml config:

    samplers:
      train:
        class_path: eva.core.data.samplers.classification.BalancedSampler
        init_args:
          num_samples: 10

(For online mode, specify the sampler in samplers.train:, while for offline mode in samplers.predict:).

Make sure that shuffle: false for the dataloader config of the corresponding split.

@nkaenzig nkaenzig linked an issue Nov 22, 2024 that may be closed by this pull request
@nkaenzig nkaenzig marked this pull request as ready for review November 22, 2024 14:34
@nkaenzig nkaenzig self-assigned this Nov 27, 2024
@nkaenzig nkaenzig enabled auto-merge (squash) December 6, 2024 09:31
@nkaenzig nkaenzig merged commit 936e96d into main Dec 6, 2024
6 checks passed
@nkaenzig nkaenzig deleted the 712-add-support-for-label-efficiency-evals branch December 6, 2024 09:41
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.

Add support for label efficiency evals
2 participants