Conversation
| @@ -21,7 +21,9 @@ class DequantizedDataset(torch.utils.data.Dataset): | |||
| def __init__( | |||
| self, | |||
| dataset: T.Union[os.PathLike, torch.utils.data.Dataset, np.ndarray], | |||
There was a problem hiding this comment.
Should we also specify here that dataset can be a torch.Tensor as well?
|
|
||
| # | ||
| self.dataset = self.dataset.to(device) | ||
| if not isinstance(labels, torch.Tensor): |
There was a problem hiding this comment.
If dataset is a torch.utils.data.Dataset we don't need labels right? It automatically has a getitem method that returns the data and the label. So I would need to add a check here.
There was a problem hiding this comment.
I think The baseclass getitem method is going to fail if the dataset is only a np array or a torch.Tensor. I understand there is the correct implementation in the derived class but maybe here we would need to put a check or raise an error?
| @@ -21,8 +21,9 @@ class DequantizedDataset(torch.utils.data.Dataset): | |||
| def __init__( | |||
| self, | |||
| dataset: T.Union[os.PathLike, torch.utils.data.Dataset, np.ndarray], | |||
There was a problem hiding this comment.
Would it be better to have a dataset object like a dictionary with images/labels? Otherwise I would renamed this "images" instead of dataset since we now have the labels object as well.
PR for implementing a dataset with the right label associated to the image.
Previously the getitem method returned only the MNISt image with a dummy label always set to 0. Now the correct label is return.
Changes done for MNIST dataset.
TODO: do the same for the FashionMNist Dataset.