import tensorflow as tf

                        (1 - self.terminals_ph_n) *( self.gamma**self.n_step_length ) * self.value_target_n)
                        qf1_loss_n = 0.5 * tf.reduce_mean(((q_backup_n - qf1) ** 2)*self.weight_ph)
                        qf1_loss_n_col = tf.reduce_mean(((q_backup_n - qf1) ** 2),1)
                        qf2_loss_n = 0.5 * tf.reduce_mean(((q_backup_n - qf2) ** 2)*self.weight_ph)
                    if self.n_step:
                        value_for_priority = qf1_loss_col + qf1_loss_n_col
                    else:
                        value_for_priority = qf1_loss_col
                    # Compute the entropy temperature loss
                    # it is used when the entropy coefficient is learned
                    ent_coef_loss, entropy_optimizer = None, None
                    if not isinstance(self.ent_coef, float):
                        ent_coef_loss = -tf.reduce_mean(
                            self.log_ent_coef * tf.stop_gradient(logp_pi + self.target_entropy)*self.weight_ph)
                        entropy_optimizer = tf.train.AdamOptimizer(learning_rate=self.learning_rate_ph)

                    # Compute the policy loss
                    # Alternative: policy_kl_loss = tf.reduce_mean(logp_pi - min_qf_pi)
                    policy_kl_loss = tf.reduce_mean((self.ent_coef * logp_pi - min_qf_pi)*self.weight_ph)
                    actor_for_priority = tf.reduce_mean(self.ent_coef * logp_pi - min_qf_pi,1)
                    # NOTE: in the original implementation, they have an additional
                    # regularization loss for the Gaussian parameters
                    # this is not used for now
                    # policy_loss = (policy_kl_loss + policy_regularization_loss)
                    min_q = tf.minimum(dtm_qf1,dtm_qf2)

