import tensorflow as tf

                    Q_filter = tf.cast((qf1 > min_q)|(qf2 > min_q),tf.float32)
                    #Q_filter_1 = tf.cast(qf1 > min_q,tf.float32)
                    #Q_filter_2 = tf.cast(qf2 > min_q,tf.float32)
                    im_loss1 = tf.square(self.actions_ph - self.deterministic_actions_ph)*Q_filter*self.is_demo_ph
                    #im_loss2 = tf.square(self.actions_ph - self.deterministic_actions_ph)*Q_filter_2*self.is_demo_ph
                    #actor_loss_di1 = tf.reduce_mean(im_loss1)
                    #actor_loss_di2 = tf.reduce_mean(im_loss2)
                    self.actor_loss_di = tf.reduce_mean(im_loss1)
                    imitation_for_priority = tf.reduce_mean(im_loss1,axis=1)
                    regularizerpi = tf.contrib.layers.l1_l2_regularizer(scale_l1=0.0, scale_l2=1e-5, scope="model/pi")
                    all_trainable_weights_pi = tf.trainable_variables('model/pi')
                    regularization_penalty_pi = tf.contrib.layers.apply_regularization(regularizerpi, all_trainable_weights_pi)

                    policy_loss = policy_kl_loss + regularization_penalty_pi + self.actor_loss_di


