Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


torch (version 0.0.2)

nn_max_unpool3d: Computes a partial inverse of MaxPool3d.

Description

MaxPool3d is not fully invertible, since the non-maximal values are lost. MaxUnpool3d takes in as input the output of MaxPool3d including the indices of the maximal values and computes a partial inverse in which all non-maximal values are set to zero.

Usage

nn_max_unpool3d(kernel_size, stride = NULL, padding = 0)

Arguments

kernel_size

(int or tuple): Size of the max pooling window.

stride

(int or tuple): Stride of the max pooling window. It is set to kernel_size by default.

padding

(int or tuple): Padding that was added to the input

Inputs

  • input: the input Tensor to invert

  • indices: the indices given out by nn_max_pool3d()

  • output_size (optional): the targeted output size

Shape

  • Input: (N,C,Din,Hin,Win)

  • Output: (N,C,Dout,Hout,Wout), where

Dout=(Din1)×stride[0]2×padding[0]+kernel\_size[0] Hout=(Hin1)×stride[1]2×padding[1]+kernel\_size[1] Wout=(Win1)×stride[2]2×padding[2]+kernel\_size[2]

or as given by output_size in the call operator

Examples

Run this code
# NOT RUN {
if (torch_is_installed()) {
  
# pool of square window of size=3, stride=2
pool <- nn_max_pool3d(3, stride=2, return_indices=TRUE)
unpool <- nn_max_unpool3d(3, stride=2)
out <- pool(torch_randn(20, 16, 51, 33, 15))
unpooled_output <- unpool(out[[1]], out[[2]])
unpooled_output$size()

}
# }

Run the code above in your browser using DataLab