import tensorflow as tf

        self.sess.run(tf.global_variables_initializer())

        # Tensorboard
        if summary_dir is not None:
            self.writer = tf.summary.FileWriter(summary_dir)
        tf.summary.scalar('Loss/Policy', loss_pg)
        tf.summary.scalar('Loss/Value', loss_vf)
        tf.summary.scalar('Loss/Entropy', loss_entropy)
        tf.summary.scalar('Loss/Total', loss)
        tf.summary.scalar('Var/Epsilon', epsilon_decay)
        tf.summary.scalar('Var/Policy Mode', tf.reduce_mean(pi.mode()))
        tf.summary.scalar('Var/Policy Sigma', tf.reduce_mean(pi.stddev()))
        tf.summary.scalar('Var/Value', tf.reduce_mean(self.vf))
        self.summarise = tf.summary.merge(tf.get_collection(tf.GraphKeys.SUMMARIES))

    # AC net
    def build_anet(self, state_in, name, reuse=False):
        reg = tf.contrib.layers.l2_regularizer(1e-3)
