Skip to content

Commit 904010c

Browse files
committed
docs changes foor better understanding
1 parent bdcafc1 commit 904010c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/source-pytorch/common/trainer.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,9 @@ overfit_batches
759759
Uses this much data of the training & validation set.
760760
If the training & validation dataloaders have ``shuffle=True``, Lightning will automatically disable it.
761761

762+
* When set to exactly 1, the same batch is used for both training and validation steps, which is useful for debugging model implementation
763+
* For other values, sequential sampling (no shuffling) is used
764+
762765
Useful for quickly debugging or trying to overfit on purpose.
763766

764767
.. testcode::
@@ -768,9 +771,13 @@ Useful for quickly debugging or trying to overfit on purpose.
768771

769772
# use only 1% of the train & val set
770773
trainer = Trainer(overfit_batches=0.01)
771-
772-
# overfit on 10 of the same batches
774+
775+
# overfit on 10 (same) train batches & 10 (same) val batches
773776
trainer = Trainer(overfit_batches=10)
777+
778+
# debug by training and validating on exactly the same single batch
779+
# (useful for verifying model implementation)
780+
trainer = Trainer(overfit_batches=1)
774781

775782
plugins
776783
^^^^^^^

0 commit comments

Comments
 (0)