dqn_predict.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:tensorflow 作者: airtooz 项目源码 文件源码
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())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号