<s> import numpy as np <EOL> from neupy import algorithms , layers <EOL> from neupy . utils import asfloat <EOL> from data import xor_input_train , xor_target_train <EOL> from base import BaseTestCase <EOL> class LearningRateUpdatesTestCase ( BaseTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( LearningRateUpdatesTestCase , self ) . setUp ( ) <EOL> self . first_step = <NUM_LIT> <EOL> self . connection = [ <EOL> layers . Tanh ( <NUM_LIT:2> ) , <EOL> layers . Tanh ( <NUM_LIT:3> ) , <EOL> layers . StepOutput ( <NUM_LIT:1> , output_bounds = ( - <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> ] <EOL> def test_simple_learning_rate_minimization ( self ) : <EOL> network = algorithms . GradientDescent ( <EOL> self . connection , <EOL> step = self . first_step , <EOL> epochs_step_minimizator = <NUM_LIT:50> , <EOL> addons = [ algorithms . SimpleStepMinimization ] <EOL> ) <EOL> network . train ( xor_input_train , xor_target_train , epochs = <NUM_LIT:100> ) <EOL> self . assertAlmostEqual ( <EOL> network . variables . step . get_value ( ) , <EOL> asfloat ( self . first_step / <NUM_LIT:3> ) , <EOL> places = <NUM_LIT:5> , <EOL> ) </s>
