A class that can format data. This class provides ways to transform data's classification label into vector.
data: The input data
n_classes: The number of classes in the classification problem.
labels: The number of labels.
label_to_vec: Mapping from label to vector.
int_to_label: Mapping from int to label.
Initialize a OneHotEncoder
Create mapping from label to vector, and vector to label.
Get vector for every element in the data array.
Get label for every element in data.
Randomly mask out one or more patches from an image. Args: n_holes (int): Number of patches to cut out of each image. length (int): The length (in pixels) of each square patch.
Args: img (Tensor): Tensor image of size (C, H, W). Returns: Tensor: Image with n_holes of dimension length x length cut out of it.