<s> import os <EOL> from math import ceil <EOL> import matplotlib <EOL> from matplotlib import pyplot <EOL> import scipy as sp <EOL> from treehmm . static import valid_species , valid_marks <EOL> def plot_energy_comparison ( args ) : <EOL> """<STR_LIT>""" <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> pyplot . figure ( ) <EOL> names = args . cmp_energy . keys ( ) <EOL> vals = - sp . array ( [ args . cmp_energy [ n ] for n in names ] ) . T <EOL> print names <EOL> print vals <EOL> lines = pyplot . plot ( vals ) <EOL> line_types = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT::>' , '<STR_LIT:->' , '<STR_LIT>' ] * <NUM_LIT:3> <EOL> [ pyplot . setp ( l , linestyle = t ) for l , t in zip ( lines , line_types ) ] <EOL> pyplot . legend ( names , loc = '<STR_LIT>' ) <EOL> formatter = pyplot . ScalarFormatter ( useMathText = True ) <EOL> formatter . set_scientific ( True ) <EOL> formatter . set_powerlimits ( ( - <NUM_LIT:3> , <NUM_LIT:3> ) ) <EOL> pyplot . gca ( ) . yaxis . set_major_formatter ( formatter ) <EOL> pyplot . xlabel ( "<STR_LIT>" ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) ) <EOL> pyplot . close ( '<STR_LIT:all>' ) <EOL> def plot_energy ( args ) : <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) ) <EOL> pyplot . figure ( ) <EOL> pyplot . title ( '<STR_LIT>' % args . approx ) <EOL> pyplot . plot ( [ - f for f in args . free_energy ] , label = '<STR_LIT>' ) <EOL> pyplot . xlabel ( "<STR_LIT>" ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) ) <EOL> pyplot . close ( '<STR_LIT:all>' ) <EOL> if hasattr ( args , '<STR_LIT>' ) : <EOL> pyplot . figure ( ) <EOL> pyplot . title ( '<STR_LIT>' % args . approx ) <EOL> pyplot . plot ( range ( len ( args . prev_free_energy ) ) , [ - f for f in args . prev_free_energy ] , linestyle = '<STR_LIT:->' , label = '<STR_LIT>' ) <EOL> pyplot . plot ( range ( len ( args . prev_free_energy ) , len ( args . free_energy ) + len ( args . prev_free_energy ) ) , [ - f for f in args . free_energy ] , label = '<STR_LIT>' ) <EOL> pyplot . legend ( loc = '<STR_LIT>' ) <EOL> pyplot . xlabel ( "<STR_LIT>" ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) ) ) <EOL> pyplot . close ( '<STR_LIT:all>' ) <EOL> def plot_Q ( args ) : <EOL> """<STR_LIT>""" <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> print outfile <EOL> I , T , K = args . Q . shape <EOL> I , T , L = args . X . shape <EOL> fig , axs = pyplot . subplots ( I + <NUM_LIT:1> , <NUM_LIT:1> , sharex = True , sharey = True , squeeze = False ) <EOL> for i in xrange ( I ) : <EOL> axs [ i , <NUM_LIT:0> ] . plot ( args . Q [ i , : , : ] ) <EOL> mark_total = args . X . sum ( axis = <NUM_LIT:2> ) . T <EOL> axs [ I , <NUM_LIT:0> ] . plot ( mark_total / float ( L ) ) <EOL> fig . suptitle ( "<STR_LIT>" . <EOL> format ( approx = args . approx , iteration = args . iteration ) ) <EOL> fig . suptitle ( "<STR_LIT>" , x = <NUM_LIT> , y = <NUM_LIT> ) <EOL> fig . suptitle ( "<STR_LIT>" , x = <NUM_LIT> , y = <NUM_LIT> , verticalalignment = '<STR_LIT>' , rotation = <NUM_LIT> ) <EOL> fig . savefig ( os . path . join ( args . out_dir , outfile ) ) <EOL> pyplot . close ( '<STR_LIT:all>' ) <EOL> def plot_data ( args ) : <EOL> """<STR_LIT>""" <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> fig , axs = pyplot . subplots ( args . I , <NUM_LIT:1> , sharex = True , sharey = True , squeeze = False ) <EOL> fig . set_size_inches ( <NUM_LIT> , <NUM_LIT:20> ) <EOL> I , T , L = args . X . shape <EOL> extent = [ <NUM_LIT:0> , T , <NUM_LIT:0> , L ] <EOL> for i in xrange ( args . I ) : <EOL> im = axs [ i , <NUM_LIT:0> ] . imshow ( sp . flipud ( args . X [ i , : , : ] . T ) , interpolation = '<STR_LIT>' , vmin = <NUM_LIT:0> , vmax = <NUM_LIT:1> , extent = extent , aspect = '<STR_LIT>' ) <EOL> im . set_cmap ( '<STR_LIT>' ) <EOL> axs [ i , <NUM_LIT:0> ] . set_yticks ( sp . linspace ( <NUM_LIT:0> , L , L , endpoint = False ) + <NUM_LIT> ) <EOL> axs [ i , <NUM_LIT:0> ] . set_yticklabels ( valid_marks [ : L ] ) <EOL> axs [ i , <NUM_LIT:0> ] . text ( T / <NUM_LIT:2> , L + <NUM_LIT:1> , valid_species [ i ] , horizontalalignment = '<STR_LIT>' , verticalalignment = '<STR_LIT>' ) <EOL> fig . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> pyplot . close ( '<STR_LIT:all>' ) <EOL> def plot_params ( args ) : <EOL> """<STR_LIT>""" <EOL> old_err = sp . seterr ( under = '<STR_LIT:ignore>' ) <EOL> oldsize = matplotlib . rcParams [ '<STR_LIT>' ] <EOL> K , L = args . emit_probs . shape if not args . continuous_observations else args . means . shape <EOL> pyplot . figure ( ) <EOL> _ , xedges , yedges = sp . histogram2d ( [ <NUM_LIT:0> , K ] , [ <NUM_LIT:0> , K ] , bins = [ K , K ] ) <EOL> extent = [ xedges [ <NUM_LIT:0> ] , xedges [ - <NUM_LIT:1> ] , yedges [ <NUM_LIT:0> ] , yedges [ - <NUM_LIT:1> ] ] <EOL> pyplot . imshow ( args . alpha . astype ( sp . float64 ) , extent = extent , interpolation = '<STR_LIT>' , <EOL> vmin = <NUM_LIT:0> , vmax = <NUM_LIT:1> , cmap = '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> pyplot . xticks ( sp . arange ( K ) + <NUM_LIT> , sp . arange ( K ) + <NUM_LIT:1> ) <EOL> pyplot . gca ( ) . set_xticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> pyplot . yticks ( sp . arange ( K ) + <NUM_LIT> , sp . arange ( K ) + <NUM_LIT:1> ) <EOL> pyplot . gca ( ) . set_yticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> pyplot . grid ( which = '<STR_LIT>' , alpha = <NUM_LIT> ) <EOL> for line in pyplot . gca ( ) . yaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( minor = True ) + pyplot . gca ( ) . yaxis . get_ticklines ( minor = True ) : <EOL> line . set_markersize ( <NUM_LIT:0> ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . xlabel ( '<STR_LIT>' ) <EOL> pyplot . title ( r"<STR_LIT>" . <EOL> format ( approx = args . approx , iteration = args . iteration ) ) <EOL> b = pyplot . colorbar ( shrink = <NUM_LIT> ) <EOL> b . set_label ( "<STR_LIT>" ) <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> pyplot . figure ( ) <EOL> _ , xedges , yedges = sp . histogram2d ( [ <NUM_LIT:0> , K ] , [ <NUM_LIT:0> , K ] , bins = [ K , K ] ) <EOL> extent = [ xedges [ <NUM_LIT:0> ] , xedges [ - <NUM_LIT:1> ] , yedges [ <NUM_LIT:0> ] , yedges [ - <NUM_LIT:1> ] ] <EOL> pyplot . clf ( ) <EOL> pyplot . imshow ( args . beta . astype ( sp . float64 ) , extent = extent , interpolation = '<STR_LIT>' , <EOL> vmin = <NUM_LIT:0> , vmax = <NUM_LIT:1> , cmap = '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> pyplot . xticks ( sp . arange ( K ) + <NUM_LIT> , sp . arange ( K ) + <NUM_LIT:1> ) <EOL> pyplot . gca ( ) . set_xticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> pyplot . yticks ( sp . arange ( K ) + <NUM_LIT> , sp . arange ( K ) + <NUM_LIT:1> ) <EOL> pyplot . gca ( ) . set_yticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> pyplot . grid ( which = '<STR_LIT>' , alpha = <NUM_LIT> ) <EOL> for line in pyplot . gca ( ) . yaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( minor = True ) + pyplot . gca ( ) . yaxis . get_ticklines ( minor = True ) : <EOL> line . set_markersize ( <NUM_LIT:0> ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . xlabel ( '<STR_LIT>' ) <EOL> pyplot . title ( r"<STR_LIT>" . <EOL> format ( approx = args . approx , iteration = args . iteration ) ) <EOL> b = pyplot . colorbar ( shrink = <NUM_LIT> ) <EOL> b . set_label ( "<STR_LIT>" ) <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> if args . separate_theta : <EOL> theta_tmp = args . theta <EOL> for i in range ( ( args . theta . shape ) [ <NUM_LIT:0> ] ) : <EOL> setattr ( args , '<STR_LIT>' % ( i + <NUM_LIT:1> ) , args . theta [ i , : , : , : ] ) <EOL> for theta_name in [ '<STR_LIT>' ] + [ '<STR_LIT>' % i for i in range ( <NUM_LIT:20> ) ] : <EOL> if not hasattr ( args , theta_name ) : <EOL> continue <EOL> _ , xedges , yedges = sp . histogram2d ( [ <NUM_LIT:0> , K ] , [ <NUM_LIT:0> , K ] , bins = [ K , K ] ) <EOL> extent = [ xedges [ <NUM_LIT:0> ] , xedges [ - <NUM_LIT:1> ] , yedges [ <NUM_LIT:0> ] , yedges [ - <NUM_LIT:1> ] ] <EOL> if K == <NUM_LIT> : <EOL> numx_plots = <NUM_LIT:6> <EOL> numy_plots = <NUM_LIT:3> <EOL> elif K == <NUM_LIT:15> : <EOL> numx_plots = <NUM_LIT:5> <EOL> numy_plots = <NUM_LIT:3> <EOL> else : <EOL> numx_plots = int ( ceil ( sp . sqrt ( K ) ) ) <EOL> numy_plots = int ( ceil ( sp . sqrt ( K ) ) ) <EOL> matplotlib . rcParams [ '<STR_LIT>' ] = <NUM_LIT:8> <EOL> fig , axs = pyplot . subplots ( numy_plots , numx_plots , sharex = True , sharey = True , figsize = ( numx_plots * <NUM_LIT> , numy_plots * <NUM_LIT> ) ) <EOL> for k in xrange ( K ) : <EOL> pltx , plty = k // numx_plots , k % numx_plots <EOL> axs [ pltx , plty ] . imshow ( getattr ( args , theta_name ) [ : , k , : ] . astype ( sp . float64 ) , extent = extent , interpolation = '<STR_LIT>' , <EOL> vmin = <NUM_LIT:0> , vmax = <NUM_LIT:1> , cmap = '<STR_LIT>' , aspect = '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> axs [ pltx , plty ] . text ( <NUM_LIT:0> + <NUM_LIT> , K - <NUM_LIT> , '<STR_LIT>' % ( k + <NUM_LIT:1> ) , horizontalalignment = '<STR_LIT:left>' , verticalalignment = '<STR_LIT>' , fontsize = <NUM_LIT:10> ) <EOL> axs [ pltx , plty ] . set_xticks ( sp . arange ( K ) + <NUM_LIT> ) <EOL> axs [ pltx , plty ] . set_xticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> axs [ pltx , plty ] . set_xticklabels ( sp . arange ( K ) + <NUM_LIT:1> ) <EOL> axs [ pltx , plty ] . set_yticks ( sp . arange ( K ) + <NUM_LIT> ) <EOL> axs [ pltx , plty ] . set_yticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> axs [ pltx , plty ] . set_yticklabels ( sp . arange ( K ) + <NUM_LIT:1> ) <EOL> for line in axs [ pltx , plty ] . yaxis . get_ticklines ( ) + axs [ pltx , plty ] . xaxis . get_ticklines ( ) + axs [ pltx , plty ] . yaxis . get_ticklines ( minor = True ) + axs [ pltx , plty ] . xaxis . get_ticklines ( minor = True ) : <EOL> line . set_markersize ( <NUM_LIT:0> ) <EOL> axs [ pltx , plty ] . grid ( True , which = '<STR_LIT>' , alpha = <NUM_LIT> ) <EOL> fig . suptitle ( '<STR_LIT>' , y = <NUM_LIT> , fontsize = <NUM_LIT> , verticalalignment = '<STR_LIT>' ) <EOL> fig . suptitle ( '<STR_LIT>' , y = <NUM_LIT> , x = <NUM_LIT> , rotation = <NUM_LIT> , <EOL> verticalalignment = '<STR_LIT>' , fontsize = <NUM_LIT> ) <EOL> matplotlib . rcParams [ '<STR_LIT>' ] = <NUM_LIT> <EOL> fig . subplots_adjust ( wspace = <NUM_LIT> , hspace = <NUM_LIT> , left = <NUM_LIT> , right = <NUM_LIT> ) <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = theta_name , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> fig , axs = pyplot . subplots ( numy_plots , numx_plots , sharex = True , sharey = True , figsize = ( numx_plots * <NUM_LIT> , numy_plots * <NUM_LIT> ) ) <EOL> for k in xrange ( K ) : <EOL> pltx , plty = k // numx_plots , k % numx_plots <EOL> axs [ pltx , plty ] . imshow ( getattr ( args , theta_name ) [ k , : , : ] . astype ( sp . float64 ) , extent = extent , interpolation = '<STR_LIT>' , <EOL> vmin = <NUM_LIT:0> , vmax = <NUM_LIT:1> , cmap = '<STR_LIT>' , aspect = '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> axs [ pltx , plty ] . text ( <NUM_LIT:0> + <NUM_LIT> , K - <NUM_LIT> , '<STR_LIT>' % ( k + <NUM_LIT:1> ) , horizontalalignment = '<STR_LIT:left>' , verticalalignment = '<STR_LIT>' , fontsize = <NUM_LIT:10> ) <EOL> axs [ pltx , plty ] . set_xticks ( sp . arange ( K ) + <NUM_LIT> ) <EOL> axs [ pltx , plty ] . set_xticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> axs [ pltx , plty ] . set_xticklabels ( sp . arange ( K ) + <NUM_LIT:1> ) <EOL> axs [ pltx , plty ] . set_yticks ( sp . arange ( K ) + <NUM_LIT> ) <EOL> axs [ pltx , plty ] . set_yticks ( sp . arange ( K ) + <NUM_LIT:1> , minor = True ) <EOL> axs [ pltx , plty ] . set_yticklabels ( sp . arange ( K ) + <NUM_LIT:1> ) <EOL> for line in axs [ pltx , plty ] . yaxis . get_ticklines ( ) + axs [ pltx , plty ] . xaxis . get_ticklines ( ) + axs [ pltx , plty ] . yaxis . get_ticklines ( minor = True ) + axs [ pltx , plty ] . xaxis . get_ticklines ( minor = True ) : <EOL> line . set_markersize ( <NUM_LIT:0> ) <EOL> axs [ pltx , plty ] . grid ( True , which = '<STR_LIT>' , alpha = <NUM_LIT> ) <EOL> fig . suptitle ( '<STR_LIT>' , y = <NUM_LIT> , fontsize = <NUM_LIT> , verticalalignment = '<STR_LIT>' ) <EOL> fig . suptitle ( '<STR_LIT>' , y = <NUM_LIT> , x = <NUM_LIT> , rotation = <NUM_LIT> , <EOL> verticalalignment = '<STR_LIT>' , fontsize = <NUM_LIT> ) <EOL> matplotlib . rcParams [ '<STR_LIT>' ] = <NUM_LIT> <EOL> fig . subplots_adjust ( wspace = <NUM_LIT> , hspace = <NUM_LIT> , left = <NUM_LIT> , right = <NUM_LIT> ) <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = theta_name , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> if args . continuous_observations : <EOL> matplotlib . rcParams [ '<STR_LIT>' ] = <NUM_LIT:8> <EOL> pyplot . figure ( figsize = ( max ( <NUM_LIT:1> , round ( L / <NUM_LIT> ) ) , max ( <NUM_LIT:1> , round ( K / <NUM_LIT> ) ) ) ) <EOL> print ( max ( <NUM_LIT:1> , round ( L / <NUM_LIT> ) ) , max ( <NUM_LIT:1> , round ( K / <NUM_LIT> ) ) ) <EOL> pyplot . imshow ( args . means . astype ( sp . float64 ) , interpolation = '<STR_LIT>' , aspect = '<STR_LIT>' , <EOL> vmin = <NUM_LIT:0> , vmax = args . means . max ( ) , cmap = '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> for k in range ( K ) : <EOL> for l in range ( L ) : <EOL> pyplot . text ( l , k , '<STR_LIT>' % ( args . means [ k , l ] ) , horizontalalignment = '<STR_LIT>' , verticalalignment = '<STR_LIT>' , fontsize = <NUM_LIT:5> ) <EOL> pyplot . yticks ( sp . arange ( K ) , sp . arange ( K ) + <NUM_LIT:1> ) <EOL> pyplot . gca ( ) . set_yticks ( sp . arange ( K ) + <NUM_LIT> , minor = True ) <EOL> pyplot . xticks ( sp . arange ( L ) , valid_marks , rotation = <NUM_LIT:30> , horizontalalignment = '<STR_LIT:right>' ) <EOL> pyplot . gca ( ) . set_xticks ( sp . arange ( L ) + <NUM_LIT> , minor = True ) <EOL> pyplot . grid ( which = '<STR_LIT>' , alpha = <NUM_LIT> ) <EOL> for line in pyplot . gca ( ) . yaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( minor = True ) + pyplot . gca ( ) . yaxis . get_ticklines ( minor = True ) : <EOL> line . set_markersize ( <NUM_LIT:0> ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . title ( "<STR_LIT>" ) <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> pyplot . figure ( figsize = ( max ( <NUM_LIT:1> , round ( L / <NUM_LIT> ) ) , max ( <NUM_LIT:1> , round ( K / <NUM_LIT> ) ) ) ) <EOL> print ( L / <NUM_LIT:3> , K / <NUM_LIT> ) <EOL> pyplot . imshow ( args . variances . astype ( sp . float64 ) , interpolation = '<STR_LIT>' , aspect = '<STR_LIT>' , <EOL> vmin = <NUM_LIT:0> , vmax = args . variances . max ( ) , cmap = '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> for k in range ( K ) : <EOL> for l in range ( L ) : <EOL> pyplot . text ( l , k , '<STR_LIT>' % ( args . variances [ k , l ] ) , horizontalalignment = '<STR_LIT>' , verticalalignment = '<STR_LIT>' , fontsize = <NUM_LIT:5> ) <EOL> pyplot . yticks ( sp . arange ( K ) , sp . arange ( K ) + <NUM_LIT:1> ) <EOL> pyplot . gca ( ) . set_yticks ( sp . arange ( K ) + <NUM_LIT> , minor = True ) <EOL> pyplot . xticks ( sp . arange ( L ) , valid_marks , rotation = <NUM_LIT:30> , horizontalalignment = '<STR_LIT:right>' ) <EOL> pyplot . gca ( ) . set_xticks ( sp . arange ( L ) + <NUM_LIT> , minor = True ) <EOL> pyplot . grid ( which = '<STR_LIT>' , alpha = <NUM_LIT> ) <EOL> for line in pyplot . gca ( ) . yaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( minor = True ) + pyplot . gca ( ) . yaxis . get_ticklines ( minor = True ) : <EOL> line . set_markersize ( <NUM_LIT:0> ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . title ( "<STR_LIT>" ) <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> else : <EOL> matplotlib . rcParams [ '<STR_LIT>' ] = <NUM_LIT:8> <EOL> pyplot . figure ( figsize = ( max ( <NUM_LIT:1> , round ( L / <NUM_LIT> ) ) , max ( <NUM_LIT:1> , round ( K / <NUM_LIT> ) ) ) ) <EOL> print ( L / <NUM_LIT:3> , K / <NUM_LIT> ) <EOL> pyplot . imshow ( args . emit_probs . astype ( sp . float64 ) , interpolation = '<STR_LIT>' , aspect = '<STR_LIT>' , <EOL> vmin = <NUM_LIT:0> , vmax = <NUM_LIT:1> , cmap = '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> for k in range ( K ) : <EOL> for l in range ( L ) : <EOL> pyplot . text ( l , k , '<STR_LIT>' % ( args . emit_probs [ k , l ] * <NUM_LIT:100> ) , horizontalalignment = '<STR_LIT>' , verticalalignment = '<STR_LIT>' ) <EOL> pyplot . yticks ( sp . arange ( K ) , sp . arange ( K ) + <NUM_LIT:1> ) <EOL> pyplot . gca ( ) . set_yticks ( sp . arange ( K ) + <NUM_LIT> , minor = True ) <EOL> pyplot . xticks ( sp . arange ( L ) , valid_marks , rotation = <NUM_LIT:30> , horizontalalignment = '<STR_LIT:right>' ) <EOL> pyplot . gca ( ) . set_xticks ( sp . arange ( L ) + <NUM_LIT> , minor = True ) <EOL> pyplot . grid ( which = '<STR_LIT>' , alpha = <NUM_LIT> ) <EOL> for line in pyplot . gca ( ) . yaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( ) + pyplot . gca ( ) . xaxis . get_ticklines ( minor = True ) + pyplot . gca ( ) . yaxis . get_ticklines ( minor = True ) : <EOL> line . set_markersize ( <NUM_LIT:0> ) <EOL> pyplot . ylabel ( '<STR_LIT>' ) <EOL> pyplot . title ( "<STR_LIT>" ) <EOL> outfile = ( args . out_params + '<STR_LIT>' ) . format ( param = '<STR_LIT>' , ** args . __dict__ ) <EOL> pyplot . savefig ( os . path . join ( args . out_dir , outfile ) , dpi = <NUM_LIT> ) <EOL> pyplot . close ( '<STR_LIT:all>' ) <EOL> sp . seterr ( ** old_err ) <EOL> matplotlib . rcParams [ '<STR_LIT>' ] = oldsize </s>
