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 18 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 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.53%. Comparing base (54ba452) to head (12a4719).

Files with missing lines Patch % Lines
src/scvi/dataloaders/_data_splitting.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3036      +/-   ##
==========================================
- Coverage   84.96%   84.53%   -0.44%     
==========================================
  Files         178      178              
  Lines       15048    15061      +13     
==========================================
- Hits        12786    12732      -54     
- Misses       2262     2329      +67     
Files with missing lines Coverage Δ
src/scvi/external/cellassign/_model.py 92.30% <ø> (ø)
...ernal/contrastivevi/_contrastive_data_splitting.py 89.28% <ø> (ø)
src/scvi/external/contrastivevi/_model.py 79.50% <ø> (ø)
src/scvi/external/gimvi/_model.py 91.70% <ø> (ø)
src/scvi/external/mrvi/_model.py 7.85% <ø> (ø)
src/scvi/external/scbasset/_model.py 48.43% <ø> (ø)
src/scvi/external/solo/_model.py 94.80% <ø> (ø)
src/scvi/external/velovi/_model.py 75.47% <ø> (ø)
src/scvi/model/_multivi.py 72.26% <ø> (ø)
src/scvi/model/_peakvi.py 87.09% <ø> (ø)
... and 6 more

... and 1 file 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