#NEWLINE# def __call__( self , params , cost ) : #NEWLINE# #INDENT# updates = [ ] #NEWLINE# grads = T . grad ( cost , params ) #NEWLINE# grads = clip_norms ( grads , self . clipnorm ) #NEWLINE# for ( p , g ) in zip ( params , grads ) : #NEWLINE# #INDENT# g = self . regularizer . gradient_regularize ( p , g ) #NEWLINE# acc = theano . shared ( ( p . get_value ( ) * 0.0 ) ) #NEWLINE# acc_t = ( grads + ( g ** 2 ) ) #NEWLINE# updates . append ( ( acc , acc_t ) ) #NEWLINE# p_t = ( p - ( ( self . lr / T . sqrt ( ( acc_t + self . epsilon ) ) ) * g ) ) #NEWLINE# p_t = self . regularizer . weight_regularize ( p_t ) #NEWLINE# updates . append ( ( p , p_t ) ) #NEWLINE# #UNINDENT# return updates