After using max_pool_2d_same_size to keep the original indices you still need map the future back from smaller map size to the original size which mean you need to use advance indexing and it'll work on CPU side. Any proposal ?
On Wednesday, April 27, 2016 at 5:10:21 PM UTC+2, Pascal Lamblin wrote: > > Hi, > > MaxPoolGrad [1] implements something similar, except that instead of the > location of the maxima, it needs the original feature map and the pooled > one. > > It works by setting elements of the output at the locations where the > original input is equal to the max-pooled version. > > An example, when the map you want to unpool is the output of the > original pooling, is max_pool_2d_same_size [2]. > > If you really need something with the indices, then you can use a > combination of zeros_like and set_subtensor, with advanced indexing. > This will not be transferred automatically to the GPU at the moment, > though. > > [1] > https://github.com/Theano/Theano/blob/c10aa5852f6b5ca984a73b43309a5a7759548da9/theano/tensor/signal/pool.py#L628 > > [2] > https://github.com/Theano/Theano/blob/c10aa5852f6b5ca984a73b43309a5a7759548da9/theano/tensor/signal/pool.py#L20 > > > On Tue, Apr 26, 2016, tmain wrote: > > Hi ! > > > > Is there an efficient way of implementing Max Unpooling in theano (a la > > Zeiler and Fergus > > > https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiw8tachqzMAhXHL6YKHYdjCyYQFgghMAA&url=https%3A%2F%2Fwww.cs.nyu.edu%2F~fergus%2Fpapers%2FzeilerECCV2014.pdf&usg=AFQjCNHCPyf6bqQhOl4jEIko2zOTo-0kfg&sig2=9O2UjIUHnk-RwcAnjKFJxw > > > )? > > > > Let me give an example of what I mean by that : > > > > Assume we went from a 4x4 feature map to a 2x2 feature map with max > pooling > > (stride 2, poolsize 2) > > > > The location of the maxima in the 4x4 feature map is > > 0,0 > > 0,3 > > 3,0 > > 3,3 > > > > The pooled 2x2 feature map is > > > > 1,2 > > 5,3 > > > > > > I want to obtain > > 1 0 0 2 > > 0 0 0 0 > > 0 0 0 0 > > 5 0 0 3 > > > > Thanks, > > > > Thibault > > > > -- > > > > --- > > You received this message because you are subscribed to the Google > Groups "theano-users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > For more options, visit https://groups.google.com/d/optout. > > > -- > Pascal > -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
