This module py_transforms is implemented basing on python. It provides common operations including OneHotOp.

class mindspore.dataset.transforms.py_transforms.OneHotOp(num_classes, smoothing_rate=0.0)[source]

Apply one hot encoding transformation to the input label, make label be more smoothing and continuous.

  • num_classes (int) – Num class of object in dataset, type is int and value over 0.

  • smoothing_rate (float) – The adjustable Hyper parameter decides the label smoothing level , 0.0 means not do it.