#NEWLINE# def step( self , param , state ) : #NEWLINE# #INDENT# ( m , v , t ) = state #NEWLINE# grad = param . grad ( ) #NEWLINE# t += 1 #NEWLINE# t = int ( t ) #NEWLINE# m *= self . beta1 #NEWLINE# tmp = ( ( 1 - self . beta1 ) * grad ) #NEWLINE# m += tmp #NEWLINE# v *= self . beta2 #NEWLINE# ca . power ( grad , 2 , state ) #NEWLINE# tmp *= ( 1 - self . beta2 ) #NEWLINE# v += tmp #NEWLINE# alpha = ( ( self . learn_rate * np . sqrt ( ( 1 - ( self . beta2 ** t ) ) ) ) / ( 1 - ( self . beta1 ** t ) ) ) #NEWLINE# ca . sqrt ( v , tmp ) #NEWLINE# tmp += self . eps #NEWLINE# ca . divide ( m , tmp , tmp ) #NEWLINE# tmp *= ( - alpha ) #NEWLINE# param . step ( tmp )