Skip to content

Fix CNN training on singleton vector batches - #1235

Open
fbonc wants to merge 2 commits into
sunlabuiuc:masterfrom
fbonc:fix-cnn-singleton-batch
Open

Fix CNN training on singleton vector batches#1235
fbonc wants to merge 2 commits into
sunlabuiuc:masterfrom
fbonc:fix-cnn-singleton-batch

Conversation

@fbonc

@fbonc fbonc commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Issue
Vector inputs crash during training when a batch contains one patient because BatchNorm receives only one value per channel.

Fix
Use BatchNorm’s running statistics for singleton inputs without changing layer training states or disabling gradients.

Notes
Updated the existing regression test to cover singleton batches, backward propagation, and unchanged normalization state.

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.

1 participant