#NEWLINE# def _build_experiment( self ) : #NEWLINE# #INDENT# N = 4 #NEWLINE# center = ( 5 * np . ones ( ( 1 , N ) ) . astype ( floatX ) ) #NEWLINE# param = sharedX ( np . zeros ( ( 1 , N ) ) ) #NEWLINE# cost = T . sum ( ( 0.5 * T . dot ( T . dot ( ( param - center ) , np . diag ( ( 1.0 / np . arange ( 1 , ( N + 1 ) ) ) ) ) , ( param - center ) . T ) ) ) #NEWLINE# loss = DummyLossWithGradient ( cost , param ) #NEWLINE# optimizer = SGD ( loss ) #NEWLINE# direction_modifier = DecreasingLearningRate ( lr = self . lr , dc = self . dc ) #NEWLINE# optimizer . append_direction_modifier ( trainer ) #NEWLINE# trainer = Trainer ( optimizer , DummyBatchScheduler ( ) ) #NEWLINE# logger = tasks . Logger ( views . MonitorVariable ( list ( direction_modifier . parameters . values ( ) ) [ 0 ] ) ) #NEWLINE# trainer . append_task ( logger ) #NEWLINE# return ( trainer , logger , direction_modifier )