1 hot encoding in pytorch

You could map the current class indices from [0, 24] to the expected range [0, 18] for 19 classes, since your use case would otherwise work with 25 classes where some might never be used.

1 Like