diff --git a/README.rst b/README.rst index e6faf718ac6..aca1f31446a 100644 --- a/README.rst +++ b/README.rst @@ -176,6 +176,10 @@ STL10 SVHN ~~~~ +Note: The SVHN dataset assigns the label `10` to the digit `0`. However, in this Dataset, +we assign the label `0` to the digit `0` to be compatible with PyTorch loss functions which +expect the class labels to be in the range `[0, C-1]` + ``dset.SVHN(root, split='train', transform=None, target_transform=None, download=False)`` - ``root`` : root directory of dataset where there is folder ``SVHN`` diff --git a/torchvision/datasets/svhn.py b/torchvision/datasets/svhn.py index fd444b61586..e0813851698 100644 --- a/torchvision/datasets/svhn.py +++ b/torchvision/datasets/svhn.py @@ -9,6 +9,9 @@ class SVHN(data.Dataset): """`SVHN `_ Dataset. + Note: The SVHN dataset assigns the label `10` to the digit `0`. However, in this Dataset, + we assign the label `0` to the digit `0` to be compatible with PyTorch loss functions which + expect the class labels to be in the range `[0, C-1]` Args: root (string): Root directory of dataset where directory