(self)
for i, grad in enumerate(self.parameters_gradients):
            if grad is not None:
                self.parameters_gradients[i] = tf.clip_by_value(grad, -2.0,2.0)
for i, grad in enumerate(self.parameters_gradients):
            if grad is not None:
                self.parameters_gradients[i] = tf.clip_by_value(grad, -2.0,2.0)
for i grad in enumerate ( self . parameters_gradients ) : if grad is not None : self . parameters_gradients [ i ] = tf . clip_by_value ( grad - 2 . 0 2 . 0 )
def create_training_method(self):
        self.q_gradient_input = tf.placeholder("float",[None,self.action_dim])
        self.parameters_gradients = tf.gradients(self.action_output,self.net,-self.q_gradient_input)
        '''        
        for i, grad in enumerate(self.parameters_gradients):
            if grad is not None:
                self.parameters_gradients[i] = tf.clip_by_value(grad, -2.0,2.0)
        '''
        self.optimizer = tf.train.AdamOptimizer(LEARNING_RATE).apply_gradients(zip(self.parameters_gradients,self.net))
def create_training_method ( self ) : self . q_gradient_input = tf . placeholder ( "float" , [ None , self . action_dim ] ) self . parameters_gradients = tf . gradients ( self . action_output , self . net , - self . q_gradient_input ) self . optimizer = tf . train . AdamOptimizer ( LEARNING_RATE ) . apply_gradients ( zip ( self . parameters_gradients , self . net ) )