File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
pytorch_lightning/trainer Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1532,7 +1532,8 @@ How often within one training epoch to check the validation set.
15321532Can specify as float or int.
15331533
15341534- pass a ``float `` in the range [0.0, 1.0] to check after a fraction of the training epoch.
1535- - pass an ``int `` to check after a fixed number of training batches.
1535+ - pass an ``int `` to check after a fixed number of training batches. An ``int `` value can only be higher than the number of training
1536+ batches when ``check_val_every_n_epoch=None ``, which validates after every ``N `` training batches across complete training.
15361537
15371538.. testcode ::
15381539
@@ -1542,10 +1543,13 @@ Can specify as float or int.
15421543 # check validation set 4 times during a training epoch
15431544 trainer = Trainer(val_check_interval=0.25)
15441545
1545- # check validation set every 1000 training batches
1546+ # check validation set every 1000 training batches in the current epoch
1547+ trainer = Trainer(val_check_interval=1000)
1548+
1549+ # check validation set every 1000 training batches across complete training
15461550 # use this when using iterableDataset and your dataset has no length
15471551 # (ie: production cases with streaming data)
1548- trainer = Trainer(val_check_interval=1000)
1552+ trainer = Trainer(val_check_interval=1000, check_val_every_n_epoch=None )
15491553
15501554
15511555.. code-block :: python
Original file line number Diff line number Diff line change @@ -405,7 +405,8 @@ def __init__(
405405 val_check_interval: How often to check the validation set. Pass a ``float`` in the range [0.0, 1.0] to check
406406 after a fraction of the training epoch. Pass an ``int`` to check after a fixed number of training
407407 batches. An ``int`` value can only be higher than the number of training batches when
408- ``check_val_every_n_epoch=None``.
408+ ``check_val_every_n_epoch=None``, which validates after every ``N`` training batches across complete
409+ training.
409410 Default: ``1.0``.
410411
411412 enable_model_summary: Whether to enable model summarization by default.
You can’t perform that action at this time.
0 commit comments