import tensorflow as tf

                    # TODO: test with huber loss (it would avoid too high values)
                    qf1_loss = 0.5 * tf.reduce_mean(((q_backup - qf1) ** 2)*self.weight_ph)
                    qf1_loss_col = tf.reduce_mean(((q_backup - qf1) ** 2),1)
                    qf2_loss = 0.5 * tf.reduce_mean(((q_backup - qf2) ** 2)*self.weight_ph)
                    if self.n_step:
                        q_backup_n = tf.stop_gradient(
                        self.rewards_ph_n +
                        (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)
