#NEWLINE# def print_result_table( self ) : #NEWLINE# #INDENT# width = 15 #NEWLINE# table = ' ' . join ( [ '{}' for _dummy in range ( 5 ) ] ) #NEWLINE# print ( ( '-' * ( ( width * 5 ) + 5 ) ) ) #NEWLINE# print ( ( 'Modalities' . center ( ( ( width * 2 ) + 2 ) ) + 'Score: avg (std)' . center ( ( ( width * 3 ) + 2 ) ) ) ) #NEWLINE# print ( ( ( ( '-' * ( ( width * 2 ) + 1 ) ) + ' ' ) + ( '-' * ( ( width * 3 ) + 2 ) ) ) ) #NEWLINE# print ( table . format ( * [ s . center ( width ) for s in [ 'Test' , 'Reference' , 'KL' , 'Euclidean' , 'Cosine' ] ] ) ) #NEWLINE# print ( ' ' . join ( ( [ ( '-' * width ) ] * 5 ) ) ) #NEWLINE# for ( mods1 , mods2 ) in self . _tested_combinations ( ) : #NEWLINE# #INDENT# mod_str = [ ' & ' . join ( ( self . modalities [ m ] for m in mods1 ) ) . center ( width ) , ' & ' . join ( ( self . modalities [ m ] for m in mods2 ) ) . center ( width ) ] #NEWLINE# res_str = [ '{:.3f} ({:.3f})' . format ( self . _get_result ( mods1 , mods2 , metr ) ) for metr in [ '' , '_frob' , '_cosine' ] ] #NEWLINE# print ( table . format ( * [ s . center ( width ) for s in ( mod_str + res_str ) ] ) ) #NEWLINE# #UNINDENT# print ( ( '-' * ( ( width * 5 ) + 5 ) ) )