code: def encode_label(label, nb_classes):
      
      encoded = np.zeros(nb_classes)
      encoded[int(label)] = 1.
      return encoded
docs: One-hot encoding of a single label
  
      :param label: class label (int or double without floating point digits)
      :param nb_classes: int, number of total classes
      :return: one-hot encoded vector