#NEWLINE# def myplot( trns , ctrns = None , tsts = None , ctsts = None , iter = 0 ) : #NEWLINE# #INDENT# plotdir = os . path . join ( os . getcwd ( ) , 'plot' ) #NEWLINE# pylab . clf ( ) #NEWLINE# try : #NEWLINE# #INDENT# assert ( len ( tsts ) > 1 ) #NEWLINE# tstsplot = True #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# tstsplot = False #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# assert ( len ( ctsts ) > 1 ) #NEWLINE# ctstsplot = True #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# ctstsplot = False #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# assert ( len ( ctrns ) > 1 ) #NEWLINE# ctrnsplot = True #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# ctrnsplot = False #NEWLINE# #UNINDENT# if tstsplot : #NEWLINE# #INDENT# pylab . plot ( tsts [ 'input' ] , tsts [ 'target' ] , c = 'b' ) #NEWLINE# #UNINDENT# pylab . scatter ( trns [ 'input' ] , trns [ 'target' ] , c = 'r' ) #NEWLINE# if ctrnsplot : #NEWLINE# #INDENT# pylab . scatter ( trns [ 'input' ] , ctrns , c = 'y' ) #NEWLINE# #UNINDENT# if ( tstsplot and ctstsplot ) : #NEWLINE# #INDENT# pylab . plot ( tsts [ 'input' ] , ctsts , c = 'g' ) #NEWLINE# #UNINDENT# pylab . xlabel ( 'x' ) #NEWLINE# pylab . ylabel ( 'y' ) #NEWLINE# pylab . title ( ( 'Neuron Number:' + str ( nneuron ) ) ) #NEWLINE# pylab . grid ( True ) #NEWLINE# plotname = os . path . join ( plotdir , ( 'jpq2layers_plot' + str ( iter ) ) ) #NEWLINE# pylab . savefig ( plotname )