(self)
Set up a random NNF
        Then calculate the distances to fill up the NND
        :return:
Set up a random NNF
        Then calculate the distances to fill up the NND
        :return:
Set up a random NNF Then calculate the distances to fill up the NND : return :
def initialise_nnf(self):
        """
        Set up a random NNF
        Then calculate the distances to fill up the NND
        :return:
        """
        self.nnf[0] = np.random.randint(self.B.shape[1], size=(self.A.shape[0], self.A.shape[1]))
        self.nnf[1] = np.random.randint(self.B.shape[0], size=(self.A.shape[0], self.A.shape[1]))
        self.nnf = self.nnf.transpose((1, 2, 0))
        for i in range(self.A.shape[0]):
            for j in range(self.A.shape[1]):
                pos = self.nnf[i, j]
                self.nnd[i, j] = self.cal_dist(i, j, pos[1], pos[0])
def initialise_nnf ( self ) : self . nnf [ 0 ] = np . random . randint ( self . B . shape [ 1 ] , size = ( self . A . shape [ 0 ] , self . A . shape [ 1 ] ) ) self . nnf [ 1 ] = np . random . randint ( self . B . shape [ 0 ] , size = ( self . A . shape [ 0 ] , self . A . shape [ 1 ] ) ) self . nnf = self . nnf . transpose ( ( 1 , 2 , 0 ) ) for i in range ( self . A . shape [ 0 ] ) : for j in range ( self . A . shape [ 1 ] ) : pos = self . nnf [ i , j ] self . nnd [ i , j ] = self . cal_dist ( i , j , pos [ 1 ] , pos [ 0 ] )