support/models.py
def onehot(self, y):
        '''
        A function for encoding y into a one-hot vector.
        '''

        # Inputs:
        # y is a (k x 1) array, taking values in {0,1,...,nc-1}.
        # NOTE: we say "k" here because it may be the training,
        #       test, or both training/test labels together.

        nc = self.nc
        k = y.size
        C = np.zeros(nc*k, dtype=np.int16).reshape( (k,nc) )

        for i in range(k):
            print("y:", y)
            j = y[i,0] # assumes y has only one column.
            C[i,j] = 1

        return C

        A function for encoding y into a one-hot vector.
        
A function for encoding y into a one-hot vector.
A function for encoding y into a one - hot vector .
def onehot(self, y):
        nc = self.nc
        k = y.size
        C = np.zeros(nc*k, dtype=np.int16).reshape( (k,nc) )
        for i in range(k):
            print("y:", y)
            j = y[i,0] 
            C[i,j] = 1
        return C
def onehot ( self , y ) : nc = self . nc k = y . size C = np . zeros ( nc * k , dtype = np . int16 ) . reshape ( ( k , nc ) ) for i in range ( k ) : print ( "y:" , y ) j = y [ i , 0 ] C [ i , j ] = 1 return C
A function for encoding y into a one-hot vector.
A function for encoding y into a one - hot vector .
'''
        A function for encoding y into a one-hot vector.
        ''' # Inputs: # y is a (k x 1) array, taking values in {0,1,...,nc-1}. # NOTE: we say "k" here because it may be the training, #       test, or both training/test labels together. # assumes y has only one column.
self
y