def binarize_labels(self, y):
        """
        Turns discrete labels into binary vector labels.

        Parameters
        ----------
        y : numpy array of N integers from 0 to C-1
        
        Returns
        -------
        b : numpy array of shape Nx(C-1) s.t. b[i,j]=1 if y[i]==j, and b[i,k] for all k!=j
        """
        binary_y = np.zeros((len(y), self.num_classes))
        for c in xrange(self.num_classes):
            binary_y[y==c,c] = 1

        return binary_y
dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/convnet.py/SoftmaxNet.binarize_labels/original