#NEWLINE# def updates( self , params , grads , learning_rate , momentum ) : #NEWLINE# #INDENT# updates = [ ] #NEWLINE# for ( n , ( param , grad ) ) in enumerate ( zip ( params , grads ) ) : #NEWLINE# #INDENT# memory = self . memory_ [ n ] #NEWLINE# update = ( ( momentum * memory ) - ( learning_rate * grad ) ) #NEWLINE# update2 = ( ( ( momentum * momentum ) * memory ) - ( ( ( 1 + momentum ) * learning_rate ) * grad ) ) #NEWLINE# updates . append ( ( memory , update ) ) #NEWLINE# updates . append ( ( param , ( param + update2 ) ) ) #NEWLINE# #UNINDENT# return updates