feat(val_sanity): enable skipping validation sanity (#176)

* feat(val_sanity): enable skipping validation sanity when self.nb_sanity_val_steps is 0

* docs: elaborate on skipping
This commit is contained in:
Ir1dXD
2019-08-28 06:41:31 -04:00
committed by William Falcon
parent 67c314272b
commit c2247350bb
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -5,8 +5,6 @@ Below are all the things lightning automates for you in the validation loop.
Lightning will run 5 steps of validation in the beginning of training as a sanity check so you don't have to wait until a full epoch to catch possible validation issues.
---
#### Check validation every n epochs
If you have a small dataset you might want to check validation every n epochs
@@ -60,4 +58,6 @@ Lightning runs a few steps of validation in the beginning of training. This avoi
``` {.python}
# DEFAULT
trainer = Trainer(nb_sanity_val_steps=5)
```
```
You can use `Trainer(nb_sanity_val_steps=0)` to skip the sanity check.
+1 -1
View File
@@ -780,7 +780,7 @@ class Trainer(TrainerIO):
# run tiny validation (if validation defined) to make sure program won't crash during val
ref_model.on_sanity_check_start()
if self.val_dataloader is not None:
if self.val_dataloader is not None and self.nb_sanity_val_steps > 0:
for ds_i, dataloader in enumerate(self.val_dataloader):
# reset progress_bar limit for sanity check