def __init__(self,env):
# experience replay
self.replay_buffer = deque()
# initialize parameters
self.epsilon = INITIAL_EPSILON
self.action_dim = 3 # Totally three actions
self.create_Q_network()
self.create_training_method()
# create session, used for launching tensorflow and tensorboard
self.t_session = tf.InteractiveSession()
self.R = tf.placeholder("float", shape = None)
self.T = tf.placeholder("float", shape = None)
R_summ = tf.scalar_summary(tags = "testing_reward", values = self.R)
T_summ = tf.scalar_summary(tags = "training_reward", values = self.T)
self.merged_summ = tf.merge_all_summaries()
self.writer = tf.train.SummaryWriter(logdir = "/home/airchen/Documents/coding/stock", graph = self.t_session.graph) # The logdir is the directory you want to log your tensorboard event files, please feel free to change it, and remember you want to always add: /home/USERNAME/ before the directory.
self.t_session.run(tf.initialize_all_variables())
评论列表
文章目录