How to use L2 pooling in Tensorflow?

自闭症网瘾萝莉.ら 提交于 2019-12-07 14:45:01

问题


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.

However, Tensorflow seems to provide only tf.nn.ave_pool / tf.nn.max_pooling / tf.nn.max_pool_with_argmax.

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)

Will this be equivalent? Will this work well in terms of back propagation?


回答1:


For those who may wonder, when I tried as in Yaroslav Bulatov's response, I could see better performance! Thanks!



来源:https://stackoverflow.com/questions/36620995/how-to-use-l2-pooling-in-tensorflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!