#NEWLINE# def _recursive_step( self , i , p , x ) : #NEWLINE# #INDENT# x_t = x [ i ] #NEWLINE# rep = self . _activation_func ( ( ( T . dot ( p , self . W_e1 ) + T . dot ( x_t , self . W_e2 ) ) + self . B_e ) ) #NEWLINE# if self . unfolding : #NEWLINE# #INDENT# x_decs = self . _unfold ( rep , i ) #NEWLINE# distance = T . sum ( ( ( x_decs - x [ : ( i + 1 ) ] ) ** 2 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( p_dec , x_dec ) = self . _decode_step ( rep ) #NEWLINE# distance = T . sum ( ( ( ( p_dec - p ) ** 2 ) + ( ( x_dec - x_t ) ** 2 ) ) ) #NEWLINE# #UNINDENT# return ( rep , distance )