#NEWLINE# def __init__( self , layers = ( ) , loss = 'mse' , weighted = False , rng = 13 ) : #NEWLINE# #INDENT# self . _graphs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _functions = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _rng = rng #NEWLINE# self . layers = [ ] #NEWLINE# for ( i , layer ) in enumerate ( layers ) : #NEWLINE# #INDENT# self . add_layer ( layer = layer , is_output = ( i == ( len ( layers ) - 1 ) ) ) #NEWLINE# #UNINDENT# [ l . bind ( self ) for l in self . layers ] #NEWLINE# self . losses = [ ] #NEWLINE# if ( loss and self . layers ) : #NEWLINE# #INDENT# self . set_loss ( loss , weighted = weighted , target = self . OUTPUT_NDIM , output_name = self . layers [ ( - 1 ) ] . output_name )