Swapping labels

Depending on your use case you could use several different approaches:

  • manipulate the internal .targets attribute and change some labels
  • derive a custom Dataset from MNIST 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)
1 Like