Depending on your use case you could use several different approaches:
- manipulate the internal
.targets
attribute and change some labels - derive a custom
Dataset
fromMNIST
and change some labels in the__getitem__
on the fly - manipulate some labels of the current batch in the training loop
- use a custom
collate_fn
to manipulate some targets (this seems unnecessarily complicated)