#NEWLINE# def save( self , path ) : #NEWLINE# #INDENT# self . loss . save ( path ) #NEWLINE# state = self . getstate ( ) #NEWLINE# state [ '__name__' ] = type ( self ) . __name__ #NEWLINE# np . savez ( pjoin ( path , 'optimizer.npz' ) , ** state ) #NEWLINE# direction_modifiers_savedir = utils . create_folder ( pjoin ( path , 'direction_modifiers' ) ) #NEWLINE# for ( i , direction_modifier ) in enumerate ( self . _direction_modifiers ) : #NEWLINE# #INDENT# direction_modifier_savedir = utils . create_folder ( pjoin ( direction_modifiers_savedir , 'direction_modifier_{}' . format ( i ) ) ) #NEWLINE# direction_modifier . save ( direction_modifier_savedir ) #NEWLINE# #UNINDENT# param_modifiers_savedir = utils . create_folder ( pjoin ( path , 'param_modifiers' ) ) #NEWLINE# for ( i , param_modifier ) in enumerate ( self . _param_modifiers ) : #NEWLINE# #INDENT# param_modifier_savedir = utils . create_folder ( pjoin ( param_modifiers_savedir , 'param_modifier_{}' . format ( i ) ) ) #NEWLINE# param_modifier . save ( param_modifier_savedir )