I have Tensors that represent similarity between digits in MNIST (I computed these already by creating embeddings). E.g.
[tensor([0.1894, 0.0839, 0.0679, 0.0888, 0.1104, 0.1004, 0.0859, 0.0706, 0.0864,
0.1163]),
tensor([0.0774, 0.1747, 0.0541, 0.0795, 0.0907, 0.1100, 0.0798, 0.1180, 0.1238,
0.0922]),
tensor([0.0717, 0.0619, 0.2002, 0.1048, 0.0822, 0.0932, 0.1339, 0.0686, 0.0929,
0.0906]),
tensor([0.0856, 0.0831, 0.0956, 0.1826, 0.0759, 0.1335, 0.1026, 0.0836, 0.0900,
0.0674]),
tensor([0.1050, 0.0936, 0.0740, 0.0749, 0.1802, 0.0929, 0.0692, 0.0887, 0.0852,
0.1362]),
tensor([0.0869, 0.1032, 0.0763, 0.1198, 0.0845, 0.1639, 0.0616, 0.0975, 0.1070,
0.0992]),
tensor([0.0825, 0.0831, 0.1217, 0.1022, 0.0698, 0.0684, 0.1819, 0.1017, 0.1140,
0.0747]),
tensor([0.0680, 0.1234, 0.0626, 0.0836, 0.0899, 0.1086, 0.1021, 0.1827, 0.0974,
0.0818]),
tensor([0.0761, 0.1182, 0.0774, 0.0822, 0.0789, 0.1088, 0.1045, 0.0889, 0.1667,
0.0984]),
tensor([0.1063, 0.0914, 0.0784, 0.0639, 0.1309, 0.1048, 0.0712, 0.0776, 0.1022,
0.1732])]
In the above, as an example, the first tensor corresponds to the class ‘0’ and each value represents a measure of similarity. These tensors are normalised (so sum of elements is 1.0).
What I would like to do is to use these as labels to train a different network. So it is label smoothing, but not with a uniform distribution. The idea is that there is additional info in the labels regarding similarity between classes.
I have tried to find some way to manually assign these labels. It seems that pytorch just wants a single value for a label. Is there any way to use these labels to train with?