niteshade.utils.one_hot_encoding

niteshade.utils.one_hot_encoding(y, num_classes)

Perform one hot encoding of previiously decoded data.

Parameters
  • y (np.array, torch.tensor) – labels

  • num_classes (int) – number of classes

Returns

encoded labels

Return type

enc_y (np.array or torch.tensor)