dqn.py 文件源码

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

项目:reinforceflow 作者: dbobrenko 项目源码 文件源码
def __init__(self, input_space, output_space, trainable=True, use_nature=True):
        if isinstance(input_space, Tuple) or isinstance(output_space, Tuple):
            raise ValueError('For tuple action and observation spaces '
                             'consider implementing custom network architecture.')
        self._input_ph = tf.placeholder('float32', shape=[None] + list(input_space.shape),
                                        name='inputs')
        if use_nature:
            net, end_points = make_dqn_body_nature(self.input_ph, trainable)
        else:
            net, end_points = make_dqn_body(self.input_ph, trainable)
        net = layers.fully_connected(net, num_outputs=512, activation_fn=tf.nn.relu,
                                     scope='fc1', trainable=trainable)
        end_points['fc1'] = net
        end_points['out'] = layers.fully_connected(net,
                                                   num_outputs=output_space.shape[0],
                                                   activation_fn=None, scope='out',
                                                   trainable=trainable)
        self.end_points = end_points
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号