models/dense_net.py
def ft_log_filters(self, b, cs_table_ls, lcs_dst, lcs_src):
        """
        Write a feature log with data concerning filters: the CS of every
        connection in a given block, the 'layer CS' (relevance or spread) for
        destinations and sources for all layers in the same block.

        Args:
            b: `int`, identifier number for the block;
            cs_table_ls: `list` of `list` of `float`, the table of CS for each
                connection to a layer l from a previous layer s;
            lcs_dst: `list` of `float`, 'layer CS' for destinations
                for all layers in the block;
            lcs_src: `list` of `float`, 'layer CS' for sources
                for all layers in the block.
        """
        # printing and saving the data to feature logs
        for l in range(self.layer_num_list[b]):
            # 'layer CS' for destinations of l-1
            print('  - %s for destinations = %f' % (
                self.layer_cs.capitalize(), lcs_dst[l]))
            # destination layer CS (sent from l-1 towards d)
            for d in range(l, self.layer_num_list[b]):
                print('  - Towards layer %d: CS = %f' % (
                    d, cs_table_ls[d][l]))
                # /max(fwd[l] for fwd in cs_table_ls if len(fwd) > l)

            print('\n* Block %d filter %d:' % (b, l))
            # source layer CS (received at l from s)
            for s in range(len(cs_table_ls[l])):
                print('  - From layer %d: CS = %f' % (
                    s, cs_table_ls[l][s]))  # /max(cs_table_ls[l])))
            # 'layer CS' for sources of l
            print('  - %s for sources = %f' % (
                self.layer_cs.capitalize(), lcs_src[l]))

            if self.should_save_ft_logs:
                # write all of the above in the feature log
                self.feature_writer.write(('%s\"%f\"' % (self.ftc, lcs_dst[l])
                                           ).replace(".", self.ftd))
                self.feature_writer.write('%s\"\"' % self.ftc)
                for d in range(l, self.layer_num_list[b]):
                    self.feature_writer.write((
                        '%s\"%f\"' % (self.ftc, cs_table_ls[d][l])).replace(
                            ".", self.ftd))
                self.feature_writer.write('%s\"\"' % self.ftc)
                for s in range(len(cs_table_ls[l])):
                    self.feature_writer.write((
                        '%s\"%f\"' % (self.ftc, cs_table_ls[l][s])).replace(
                            ".", self.ftd))
                self.feature_writer.write('%s\"\"' % self.ftc)
                self.feature_writer.write(('%s\"%f\"' % (self.ftc, lcs_src[l])
                                           ).replace(".", self.ftd))

        Write a feature log with data concerning filters: the CS of every
        connection in a given block, the 'layer CS' (relevance or spread) for
        destinations and sources for all layers in the same block.

        Args:
            b: `int`, identifier number for the block;
            cs_table_ls: `list` of `list` of `float`, the table of CS for each
                connection to a layer l from a previous layer s;
            lcs_dst: `list` of `float`, 'layer CS' for destinations
                for all layers in the block;
            lcs_src: `list` of `float`, 'layer CS' for sources
                for all layers in the block.
        
Write a feature log with data concerning filters: the CS of every
connection in a given block, the 'layer CS' (relevance or spread) for
destinations and sources for all layers in the same block.
Write a feature log with data concerning filters : the CS of every connection in a given block the ' layer CS ' ( relevance or spread ) for destinations and sources for all layers in the same block .
def ft_log_filters(self, b, cs_table_ls, lcs_dst, lcs_src):
        for l in range(self.layer_num_list[b]):
            print('  - %s for destinations = %f' % (
                self.layer_cs.capitalize(), lcs_dst[l]))
            for d in range(l, self.layer_num_list[b]):
                print('  - Towards layer %d: CS = %f' % (
                    d, cs_table_ls[d][l]))
            print('\n* Block %d filter %d:' % (b, l))
            for s in range(len(cs_table_ls[l])):
                print('  - From layer %d: CS = %f' % (
                    s, cs_table_ls[l][s]))  
            print('  - %s for sources = %f' % (
                self.layer_cs.capitalize(), lcs_src[l]))
            if self.should_save_ft_logs:
                self.feature_writer.write(('%s\"%f\"' % (self.ftc, lcs_dst[l])
                                           ).replace(".", self.ftd))
                self.feature_writer.write('%s\"\"' % self.ftc)
                for d in range(l, self.layer_num_list[b]):
                    self.feature_writer.write((
                        '%s\"%f\"' % (self.ftc, cs_table_ls[d][l])).replace(
                            ".", self.ftd))
                self.feature_writer.write('%s\"\"' % self.ftc)
                for s in range(len(cs_table_ls[l])):
                    self.feature_writer.write((
                        '%s\"%f\"' % (self.ftc, cs_table_ls[l][s])).replace(
                            ".", self.ftd))
                self.feature_writer.write('%s\"\"' % self.ftc)
                self.feature_writer.write(('%s\"%f\"' % (self.ftc, lcs_src[l])
                                           ).replace(".", self.ftd))
def ft_log_filters ( self , b , cs_table_ls , lcs_dst , lcs_src ) : for l in range ( self . layer_num_list [ b ] ) : print ( '  - %s for destinations = %f' % ( self . layer_cs . capitalize ( ) , lcs_dst [ l ] ) ) for d in range ( l , self . layer_num_list [ b ] ) : print ( '  - Towards layer %d: CS = %f' % ( d , cs_table_ls [ d ] [ l ] ) ) print ( '\n* Block %d filter %d:' % ( b , l ) ) for s in range ( len ( cs_table_ls [ l ] ) ) : print ( '  - From layer %d: CS = %f' % ( s , cs_table_ls [ l ] [ s ] ) ) print ( '  - %s for sources = %f' % ( self . layer_cs . capitalize ( ) , lcs_src [ l ] ) ) if self . should_save_ft_logs : self . feature_writer . write ( ( '%s\"%f\"' % ( self . ftc , lcs_dst [ l ] ) ) . replace ( "." , self . ftd ) ) self . feature_writer . write ( '%s\"\"' % self . ftc ) for d in range ( l , self . layer_num_list [ b ] ) : self . feature_writer . write ( ( '%s\"%f\"' % ( self . ftc , cs_table_ls [ d ] [ l ] ) ) . replace ( "." , self . ftd ) ) self . feature_writer . write ( '%s\"\"' % self . ftc ) for s in range ( len ( cs_table_ls [ l ] ) ) : self . feature_writer . write ( ( '%s\"%f\"' % ( self . ftc , cs_table_ls [ l ] [ s ] ) ) . replace ( "." , self . ftd ) ) self . feature_writer . write ( '%s\"\"' % self . ftc ) self . feature_writer . write ( ( '%s\"%f\"' % ( self . ftc , lcs_src [ l ] ) ) . replace ( "." , self . ftd ) )
Write a feature log with data concerning filters: the CS of every
connection in a given block, the 'layer CS' (relevance or spread) for
destinations and sources for all layers in the same block.
Write a feature log with data concerning filters : the CS of every connection in a given block the ' layer CS ' ( relevance or spread ) for destinations and sources for all layers in the same block .
"""
        Write a feature log with data concerning filters: the CS of every
        connection in a given block, the 'layer CS' (relevance or spread) for
        destinations and sources for all layers in the same block.

        Args:
            b: `int`, identifier number for the block;
            cs_table_ls: `list` of `list` of `float`, the table of CS for each
                connection to a layer l from a previous layer s;
            lcs_dst: `list` of `float`, 'layer CS' for destinations
                for all layers in the block;
            lcs_src: `list` of `float`, 'layer CS' for sources
                for all layers in the block.
        """ # printing and saving the data to feature logs # 'layer CS' for destinations of l-1 # destination layer CS (sent from l-1 towards d) # /max(fwd[l] for fwd in cs_table_ls if len(fwd) > l) # source layer CS (received at l from s) # /max(cs_table_ls[l]))) # 'layer CS' for sources of l # write all of the above in the feature log
self
b
`int`, identifier number for the block.
` int ` identifier number for the block .
cs_table_ls
`list` of `list` of `float`, the table of CS for each
connection to a layer l from a previous layer s.
` list ` of ` list ` of ` float ` the table of CS for each connection to a layer l from a previous layer s .
lcs_dst
`list` of `float`, 'layer CS' for destinations
for all layers in the block.
` list ` of ` float ` ' layer CS ' for destinations for all layers in the block .
lcs_src
`list` of `float`, 'layer CS' for sources
for all layers in the block.
` list ` of ` float ` ' layer CS ' for sources for all layers in the block .