fix typos in validation_step and test_step docs (#5438)
* fixed docs in lightning.py * few more Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
This commit is contained in:
parent
f1e28d1e43
commit
499d5031e8
|
@ -621,14 +621,14 @@ class LightningModule(
|
||||||
for val_batch in val_data:
|
for val_batch in val_data:
|
||||||
out = validation_step(val_batch)
|
out = validation_step(val_batch)
|
||||||
val_outs.append(out)
|
val_outs.append(out)
|
||||||
validation_epoch_end(val_outs)
|
validation_epoch_end(val_outs)
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
batch (:class:`~torch.Tensor` | (:class:`~torch.Tensor`, ...) | [:class:`~torch.Tensor`, ...]):
|
batch (:class:`~torch.Tensor` | (:class:`~torch.Tensor`, ...) | [:class:`~torch.Tensor`, ...]):
|
||||||
The output of your :class:`~torch.utils.data.DataLoader`. A tensor, tuple or list.
|
The output of your :class:`~torch.utils.data.DataLoader`. A tensor, tuple or list.
|
||||||
batch_idx (int): The index of this batch
|
batch_idx (int): The index of this batch
|
||||||
dataloader_idx (int): The index of the dataloader that produced this batch
|
dataloader_idx (int): The index of the dataloader that produced this batch
|
||||||
(only if multiple val datasets used)
|
(only if multiple val dataloaders used)
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
Any of.
|
Any of.
|
||||||
|
@ -677,11 +677,11 @@ class LightningModule(
|
||||||
# log the outputs!
|
# log the outputs!
|
||||||
self.log_dict({'val_loss': loss, 'val_acc': val_acc})
|
self.log_dict({'val_loss': loss, 'val_acc': val_acc})
|
||||||
|
|
||||||
If you pass in multiple val datasets, validation_step will have an additional argument.
|
If you pass in multiple val dataloaders, :meth:`validation_step` will have an additional argument.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# CASE 2: multiple validation datasets
|
# CASE 2: multiple validation dataloaders
|
||||||
def validation_step(self, batch, batch_idx, dataloader_idx):
|
def validation_step(self, batch, batch_idx, dataloader_idx):
|
||||||
# dataloader_idx tells you which dataset this is.
|
# dataloader_idx tells you which dataset this is.
|
||||||
|
|
||||||
|
@ -813,7 +813,7 @@ class LightningModule(
|
||||||
The output of your :class:`~torch.utils.data.DataLoader`. A tensor, tuple or list.
|
The output of your :class:`~torch.utils.data.DataLoader`. A tensor, tuple or list.
|
||||||
batch_idx (int): The index of this batch.
|
batch_idx (int): The index of this batch.
|
||||||
dataloader_idx (int): The index of the dataloader that produced this batch
|
dataloader_idx (int): The index of the dataloader that produced this batch
|
||||||
(only if multiple test datasets used).
|
(only if multiple test dataloaders used).
|
||||||
|
|
||||||
Return:
|
Return:
|
||||||
Any of.
|
Any of.
|
||||||
|
@ -853,17 +853,17 @@ class LightningModule(
|
||||||
# log the outputs!
|
# log the outputs!
|
||||||
self.log_dict({'test_loss': loss, 'test_acc': test_acc})
|
self.log_dict({'test_loss': loss, 'test_acc': test_acc})
|
||||||
|
|
||||||
If you pass in multiple validation datasets, :meth:`test_step` will have an additional
|
If you pass in multiple test dataloaders, :meth:`test_step` will have an additional
|
||||||
argument.
|
argument.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# CASE 2: multiple test datasets
|
# CASE 2: multiple test dataloaders
|
||||||
def test_step(self, batch, batch_idx, dataloader_idx):
|
def test_step(self, batch, batch_idx, dataloader_idx):
|
||||||
# dataloader_idx tells you which dataset this is.
|
# dataloader_idx tells you which dataset this is.
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
If you don't need to validate you don't need to implement this method.
|
If you don't need to test you don't need to implement this method.
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
When the :meth:`test_step` is called, the model has been put in eval mode and
|
When the :meth:`test_step` is called, the model has been put in eval mode and
|
||||||
|
|
Loading…
Reference in New Issue