import tensorflow as tf

        with tf.variable_scope(name) as scope:
            conv = tf.nn.conv2d(x, W, [1, stride, stride, 1], padding='SAME')
            pre_activation = tf.nn.bias_add(conv, bias)
            output = tf.nn.relu(pre_activation, name=scope.name)

            return output

    # 定义一个池化层，默认为max_pooling
    def max_pool_2x2(self,name, x):
        with tf.variable_scope(name) as scope:
            maxpool = tf.nn.max_pool(x, [1, 2, 2, 1], [1, 2, 2, 1], padding='SAME')
            return maxpool

    # 创建DQN
    def creat_network(self):
        # 网络的参数，权重
        W_conv1 = self.weight_variable('W_conv1', [8, 8, 4, 32])  # 第一层卷积层为8x8的卷积核，输入通道为4，输出通道为32
        b_conv1 = self.bias_variable('b_conv1', [32])

        W_conv2 = self.weight_variable('W_conv2', [4, 4, 32, 64])  # 第二层卷积层为4x4的卷积核,输入通道为32，输出通道为64
