Train with only one batch in lightning?

Is there an argument in trainer.fit() to train with just one batch? I have heard lightning have this solution but I can not find how to use it.

Thank you!

Use:
trainer = Trainer(overfit_batches=0.0)

use only 1% of the train set (and use the train set for val and test)

trainer = Trainer(overfit_batches=0.01)

overfit on 10 of the same batches

trainer = Trainer(overfit_batches=10)

1 Like

To overfit to only one batch:

trainer = Trainer(overfit_batches=1)