#NEWLINE# def test_save_load( self ) : #NEWLINE# #INDENT# with tempfile . TemporaryDirectory ( ) as experiment_dir : #NEWLINE# #INDENT# self . trainer . save ( experiment_dir ) #NEWLINE# ( trainer , logger , direction_modifier ) = self . _build_experiment ( ) #NEWLINE# trainer . load ( experiment_dir ) #NEWLINE# assert_equal ( direction_modifier . _eta , self . direction_modifier . _eta ) #NEWLINE# assert_equal ( direction_modifier . _gamma , self . direction_modifier . _gamma ) #NEWLINE# assert_equal ( direction_modifier . t . get_value ( ) , self . direction_modifier . t . get_value ( ) ) #NEWLINE# assert_equal ( direction_modifier . std . get_value ( ) , self . direction_modifier . std . get_value ( ) ) #NEWLINE# assert_array_equal ( direction_modifier . _srng . rstate , self . direction_modifier . _srng . rstate ) #NEWLINE# for ( state , expected_state ) in zip ( direction_modifier . _srng . state_updates , self . direction_modifier . _srng . state_updates ) : #NEWLINE# #INDENT# assert_array_equal ( state [ 0 ] . get_value ( ) , expected_state [ 0 ] . get_value ( ) )