#NEWLINE# def print_result_table( self ) : #NEWLINE# #INDENT# width = 13 #NEWLINE# table = ' ' . join ( [ '{}' for _dummy in range ( 6 ) ] ) #NEWLINE# print ( ( '-' * ( ( width * 6 ) + 5 ) ) ) #NEWLINE# print ( ( 'Modalities' . center ( ( ( width * 3 ) + 2 ) ) + 'Score: avg (std)' . center ( ( ( mod2 * 3 ) + 2 ) ) ) ) #NEWLINE# print ( ( ( ( '-' * ( ( width * 3 ) + 2 ) ) + ' ' ) + ( '-' * ( ( width * 3 ) + 2 ) ) ) ) #NEWLINE# print ( table . format ( * [ s . center ( width ) for s in [ 'Test' , 'Reference' , 'Comparison' , 'KL' , 'Euclidean' , 'Cosine' ] ] ) ) #NEWLINE# print ( ' ' . join ( ( [ ( '-' * width ) ] * 6 ) ) ) #NEWLINE# for ( mod1 , mod2 ) in [ ( 0 , 1 ) , ( 1 , 0 ) ] : #NEWLINE# #INDENT# for ( mod_comp , mod_comp_str ) in ( [ ( ( - 1 ) , 'internal' ) ] + list ( enumerate ( self . modalities ) ) ) : #NEWLINE# #INDENT# mod_str = [ self . modalities [ mod1 ] . center ( width ) , self . modalities [ mod2 ] . center ( width ) , mod_comp_str . center ( width ) ] #NEWLINE# res_str = [ ( '%.3f (%.3f)' % self . _get_result ( mod1 , mod2 , mod_comp , metr ) ) for metr in [ '' , '_frob' , '_cosine' ] ] #NEWLINE# print ( table . format ( * [ s . center ( width ) for s in ( mod_str + res_str ) ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# print ( ( '-' * ( ( width * 6 ) + 5 ) ) )