Esempio n. 1
0
    def __init__(self, sess, batch_size, num_episodes, actor_target,
                 actor_trainer, critic_target, critic_trainer,
                 trading_state_model, replay_buffer, datacontainer, gamma,
                 tau):
        self.sess = sess
        self.batch_size = batch_size
        self.num_episodes = num_episodes
        self.actor_target = actor_target
        self.actor_trainer = actor_trainer
        self.critic_target = critic_target
        self.critic_trainer = critic_trainer
        self.tsm = trading_state_model
        self.rpb = replay_buffer
        self.datacontainer = datacontainer
        self.gamma = gamma
        self.tau = tau

        self.sess.run(tf.global_variables_initializer())
        self.sess.run(
            Network.assign_target_graph("actor-trainer", "actor-target"))
        self.sess.run(
            Network.assign_target_graph("critic-trainer", "critic-target"))
Esempio n. 2
0
    def __init__(self, sess, batch_size, num_episodes, episode_length,
                 actor_target, actor_trainer, critic_target, critic_trainer,
                 env, replay_buffer, gamma, tau, actor_noise):
        self.sess = sess
        self.batch_size = batch_size
        self.num_episodes = num_episodes
        self.episode_length = episode_length
        self.actor_target = actor_target
        self.actor_trainer = actor_trainer
        self.critic_target = critic_target
        self.critic_trainer = critic_trainer
        self.env = env
        self.rpb = replay_buffer
        self.gamma = gamma
        self.tau = tau
        self.actor_noise = actor_noise

        self.sess.run(tf.global_variables_initializer())
        self.sess.run(
            Network.assign_target_graph("actor-trainer", "actor-target"))
        self.sess.run(
            Network.assign_target_graph("critic-trainer", "critic-target"))
        self.writer = tf.summary.FileWriter("./tensorboard", sess.graph)
        self.build_summaries()