n_samples = len(idx_correct_label)
// Boolean mask for the correct class
mask = np.zeros(supports.shape, dtype=np.bool)
mask[np.arange(n_samples), idx_correct_label] = True
// Get supports for the correct class
supports_correct = supports[mask]
// Get supports for the other classes
supports_others = supports[~mask]
difference = supports_correct.reshape(-1, 1) - supports_others.reshape(supports_correct.size, -1)
C_src = np.sort(difference, axis=1)[:, 0]
return C_src
def softmax(w, theta=1.0):