#NEWLINE# def test_module_advanced_example( ) : #NEWLINE# #INDENT# profmode = theano . ProfileMode ( optimizer = 'fast_run' , linker = theano . gof . OpWiseCLinker ( ) ) #NEWLINE# profmode = PrintEverythingMode ( theano . gof . OpWiseCLinker ( ) , 'fast_run' ) #NEWLINE# data_x = N . random . randn ( 4 , 10 ) #NEWLINE# data_y = [ [ int ( x ) ] for x in ( N . random . randn ( 4 ) > 0 ) ] #NEWLINE# model = SpecifiedRegressionLayer ( regularize = False ) . make ( input_size = 10 , target_size = 1 , stepsize = 0.1 , mode = profmode ) #NEWLINE# for i in xrange ( 1000 ) : #NEWLINE# #INDENT# ( xe , gw , gb , ga ) = model . update ( data_x , data_y ) #NEWLINE# if ( ( i % 100 ) == 0 ) : #NEWLINE# #INDENT# print ( i , xe ) #NEWLINE# pass #NEWLINE# #UNINDENT# #UNINDENT# print ( 'final weights:' , model . w ) #NEWLINE# print ( 'final biases:' , model . b ) #NEWLINE# profmode . print_summary ( )