(self, data_loader: FTLDataLoader)
return overlap_ub, overlap_ub_2, mapping_comp_b
compute host components
compute host components
compute host components
def batch_compute_components(self, data_loader: FTLDataLoader):

        """
        compute host components
        """

        overlap_ub = []
        for i in range(len(data_loader)):
            batch_x = data_loader[i]
            ub_batch = self.nn.predict(batch_x)
            overlap_ub.append(ub_batch)

        overlap_ub = np.concatenate(overlap_ub, axis=0)
        overlap_ub_2 = np.matmul(np.expand_dims(overlap_ub, axis=2), np.expand_dims(overlap_ub, axis=1))
        mapping_comp_b = - overlap_ub * self.constant_k

        if self.verbose:
            LOGGER.debug('overlap_ub is {}'.format(overlap_ub))
            LOGGER.debug('overlap_ub_2 is {}'.format(overlap_ub_2))

        return overlap_ub, overlap_ub_2, mapping_comp_b
def batch_compute_components ( self , data_loader : FTLDataLoader ) : overlap_ub = [ ] for i in range ( len ( data_loader ) ) : batch_x = data_loader [ i ] ub_batch = self . nn . predict ( batch_x ) overlap_ub . append ( ub_batch ) overlap_ub = np . concatenate ( overlap_ub , axis = 0 ) overlap_ub_2 = np . matmul ( np . expand_dims ( overlap_ub , axis = 2 ) , np . expand_dims ( overlap_ub , axis = 1 ) ) mapping_comp_b = - overlap_ub * self . constant_k if self . verbose : LOGGER . debug ( 'overlap_ub is {}' . format ( overlap_ub ) ) LOGGER . debug ( 'overlap_ub_2 is {}' . format ( overlap_ub_2 ) ) return overlap_ub , overlap_ub_2 , mapping_comp_b