From f5f34bb068565bf9435ba5561aae1c9280db8bbe Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Tue, 22 Aug 2017 13:34:13 +0100 Subject: COMPMID-470: Neon Deconvolution. Implemented by up-sampling the input with zeros insertions between the input samples and convolving the Deconvolution kernels on the up-sampled result. The upsampling is performed by the function NEDeconvolutionLayerUpsample. Convolving is done by NEDirectConvolutionLayer. Change-Id: I25f7ba7c6b99cd9310797972ede40aeff4a54900 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/85319 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- arm_compute/core/Utils.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'arm_compute/core/Utils.h') diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index 06d674644b..7f53bec2c5 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -562,6 +562,38 @@ inline DataType data_type_for_convolution_matrix(const int16_t *conv, size_t siz } } +/** Returns expected shape for the deconvolution output tensor. + * + * @param[in] out_dims widht and height of the output tensor, these values can be obtained with the function deconvolution_output_dimensions. + * @param[in] input Shape of the input tensor. + * @param[in] weights Shape of the weights tensor. + * + * @return Deconvolution output tensor shape. + */ +TensorShape deconvolution_output_shape(const std::pair &out_dims, TensorShape input, TensorShape weights); + +/** Returns expected width and height of the deconvolution's output tensor. + * + * @param[in] in_width Width of input tensor (Number of columns) + * @param[in] in_height Height of input tensor (Number of rows) + * @param[in] kernel_width Kernel width. + * @param[in] kernel_height Kernel height. + * @param[in] padx X axis padding. + * @param[in] pady Y axis padding. + * @param[in] ax The number of zeros added to right edge of the input. + * @param[in] ay The number of zeros added to top edge of the input. + * @param[in] upscalex How much to scale the X axis. + * @param[in] upscaley How much to scale the Y axis. + * @param[in] round Rounding policy to be used when computing the output's dimensions. + * + * @return A pair with the new width in the first position and the new height in the second. + */ + +const std::pair deconvolution_output_dimensions(unsigned int in_width, unsigned int in_height, + unsigned int kernel_width, unsigned int kernel_height, + unsigned int padx, unsigned int pady, unsigned int ax, unsigned int ay, + float upscalex, float upscaley, DimensionRoundingType round); + /** Returns expected width and height of output scaled tensor depending on dimensions rounding mode. * * @param[in] width Width of input tensor (Number of columns) -- cgit v1.2.1