Depending on your use case you could use several different approaches:
- manipulate the internal
.targetsattribute and change some labels - derive a custom
DatasetfromMNISTand change some labels in the__getitem__on the fly - manipulate some labels of the current batch in the training loop
- use a custom
collate_fnto manipulate some targets (this seems unnecessarily complicated)