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(train): in case of last batch <=2, move to validation if possible #3036

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ori-kron-wis
Copy link
Collaborator

@ori-kron-wis ori-kron-wis commented Oct 31, 2024

In case that train_size is None and the size of the last batch during training is <=2 , we adaptively move those samples from training to validation if possible. If train_size is set by user we do no fix this error and let the user change its train_size, selected indices or use drop last batch option.
close #3035

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.30%. Comparing base (38e1d65) to head (ad1e1b0).

Files with missing lines Patch % Lines
src/scvi/dataloaders/_data_splitting.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3036      +/-   ##
==========================================
- Coverage   84.80%   84.30%   -0.51%     
==========================================
  Files         173      173              
  Lines       14797    14804       +7     
==========================================
- Hits        12549    12480      -69     
- Misses       2248     2324      +76     
Files with missing lines Coverage Δ
...ernal/contrastivevi/_contrastive_data_splitting.py 89.28% <ø> (ø)
src/scvi/dataloaders/_data_splitting.py 95.39% <91.66%> (-0.26%) ⬇️

... and 6 files with indirect coverage changes

@ori-kron-wis ori-kron-wis changed the title fix: in case of last batch ==1 during train, move one sample if possible fix(train): in case of last batch <=2, move to validation if possible Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-merge: backport to 1.2.x on-merge: backport to 1.2.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Training fails with mini-batch size of one sample
2 participants