models/dense_net.py
def process_block_filters(self, b, epoch):
        """
        Process a given block's filters. Return values for features related to
        the filters' kernel weights: connection strengths, 'layer CS' for
        destinations, and 'layer CS' for sources. The 'layer CS' can be either
        relevance or spread, depending on what is required by the algorithm.

        Args:
            b: `int`, identifier number for the block;
            epoch: `int`, current training epoch (or batch).
        """
        cs_table_ls = []
        # process each filter separately (except BC bottlenecks),
        # get the conection strength between each layer l and any past layer s
        for f in range(len(self.filter_ref_list[b+1])):
            if not self.bc_mode or not f % 2:
                cs_table_ls.append(self.process_filter(
                    self.filter_ref_list[b+1][f], b, f, epoch))

        # if the required 'layer CS' is relevance
        if self.layer_cs == 'relevance':
            # relevance for destinations: what portion of all the connections
            # sent from a layer l-1 are relevant for their destination layers?
            lcs_dst = self.get_relev_dst(b, cs_table_ls)

            # relevance for sources: what portion of all the connections
            # received by a layer l are relevant for their source layers?
            lcs_src = self.get_relev_src(b, cs_table_ls)

        # else (if the required 'layer CS' is spread)
        else:
            # spread of emission (for destinations): what portion of all the
            # connections sent from a layer l-1 are relevant for l-1?
            lcs_dst = self.get_spread_emi(b, cs_table_ls)

            # spread of reception (for sources): what portion of all the
            # connections received by a layer l are relevant for l?
            lcs_src = self.get_spread_rec(b, cs_table_ls)

        return(cs_table_ls, lcs_dst, lcs_src)

        Process a given block's filters. Return values for features related to
        the filters' kernel weights: connection strengths, 'layer CS' for
        destinations, and 'layer CS' for sources. The 'layer CS' can be either
        relevance or spread, depending on what is required by the algorithm.

        Args:
            b: `int`, identifier number for the block;
            epoch: `int`, current training epoch (or batch).
        
Process a given block's filters.
Process a given block ' s filters .
def process_block_filters(self, b, epoch):
        cs_table_ls = []
        for f in range(len(self.filter_ref_list[b+1])):
            if not self.bc_mode or not f % 2:
                cs_table_ls.append(self.process_filter(
                    self.filter_ref_list[b+1][f], b, f, epoch))
        if self.layer_cs == 'relevance':
            lcs_dst = self.get_relev_dst(b, cs_table_ls)
            lcs_src = self.get_relev_src(b, cs_table_ls)
        else:
            lcs_dst = self.get_spread_emi(b, cs_table_ls)
            lcs_src = self.get_spread_rec(b, cs_table_ls)
        return(cs_table_ls, lcs_dst, lcs_src)
def process_block_filters ( self , b , epoch ) : cs_table_ls = [ ] for f in range ( len ( self . filter_ref_list [ b + 1 ] ) ) : if not self . bc_mode or not f % 2 : cs_table_ls . append ( self . process_filter ( self . filter_ref_list [ b + 1 ] [ f ] , b , f , epoch ) ) if self . layer_cs == 'relevance' : lcs_dst = self . get_relev_dst ( b , cs_table_ls ) lcs_src = self . get_relev_src ( b , cs_table_ls ) else : lcs_dst = self . get_spread_emi ( b , cs_table_ls ) lcs_src = self . get_spread_rec ( b , cs_table_ls ) return ( cs_table_ls , lcs_dst , lcs_src )
Process a given block's filters.
Process a given block ' s filters .
"""
        Process a given block's filters. Return values for features related to
        the filters' kernel weights: connection strengths, 'layer CS' for
        destinations, and 'layer CS' for sources. The 'layer CS' can be either
        relevance or spread, depending on what is required by the algorithm.

        Args:
            b: `int`, identifier number for the block;
            epoch: `int`, current training epoch (or batch).
        """ # process each filter separately (except BC bottlenecks), # get the conection strength between each layer l and any past layer s # if the required 'layer CS' is relevance # relevance for destinations: what portion of all the connections # sent from a layer l-1 are relevant for their destination layers? # relevance for sources: what portion of all the connections # received by a layer l are relevant for their source layers? # else (if the required 'layer CS' is spread) # spread of emission (for destinations): what portion of all the # connections sent from a layer l-1 are relevant for l-1? # spread of reception (for sources): what portion of all the # connections received by a layer l are relevant for l?
self
b
`int`, identifier number for the block.
` int ` identifier number for the block .
epoch
`int`, current training epoch (or batch).
` int ` current training epoch ( or batch ) .