美文网首页
tf.reduce_mean实现global average p

tf.reduce_mean实现global average p

作者: yalesaleng | 来源:发表于2018-07-16 16:25 被阅读320次
    net = tf.reduce_mean(net, [1, 2], name='pool5', keep_dims=True)
    

    利用 tf.reduce_mean(net,[1,2]) 来实现。

    具体请参见slim models zoo. https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/slim/python/slim/nets/resnet_v1.py.

    注意slim models zoo里的tf.reduce_mean已经替换成 net = math_ops.reduce_mean(net, [1, 2], name='pool5', keep_dims=True)。

    相关文章

      网友评论

          本文标题:tf.reduce_mean实现global average p

          本文链接:https://www.haomeiwen.com/subject/aqpbpftx.html