问题描述
我正在尝试实现一种使用L2池的CNN架构。该参考文件特别指出,L2池优于最大池,因此我想在tanh激活函数之后尝试L2池。
I am trying to implement one CNN architecture that uses L2 pooling. The reference paper particularly argues that L2 pooling was better than max pooling, so I would like to try L2 pooling after tanh activation function.
不过,Tensorflow似乎只提供tf.nn.ave_pool / tf.nn.max_pooling / tf.nn.max_pool_with_argmax。
However, Tensorflow seems to provide only tf.nn.ave_pool / tf.nn.max_pooling / tf.nn.max_pool_with_argmax.
是否可以在Tensorflow中实现L2池化?
Is there a way to implement L2 pooling in Tensorflow?
conv = tf.....
h = tf.nn.tanh(conv)
p = tf.pow(tf.nn.ave_pool(tf.pow(h,2)), 0.5)
这等效吗?
推荐答案
对于那些可能感到奇怪的人,当我像雅罗斯拉夫·布拉托夫(Yaroslav Bulatov)的回答那样尝试时,这会很好吗?我可以看到更好的表现!谢谢!
For those who may wonder, when I tried as in Yaroslav Bulatov's response, I could see better performance! Thanks!
这篇关于如何在Tensorflow中使用L2池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!