mxnet
|
Functions | |
mkldnn_status_t MKLDNN_API | mkldnn_pooling_forward_desc_init (mkldnn_pooling_desc_t *pool_desc, mkldnn_prop_kind_t prop_kind, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *src_desc, const mkldnn_memory_desc_t *dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t kernel, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r, mkldnn_padding_kind_t padding_kind) |
mkldnn_status_t MKLDNN_API | mkldnn_pooling_backward_desc_init (mkldnn_pooling_desc_t *pool_desc, mkldnn_alg_kind_t alg_kind, const mkldnn_memory_desc_t *diff_src_desc, const mkldnn_memory_desc_t *diff_dst_desc, const mkldnn_dims_t strides, const mkldnn_dims_t kernel, const mkldnn_dims_t padding_l, const mkldnn_dims_t padding_r, mkldnn_padding_kind_t padding_kind) |
A primitive to perform max or average pooling.
Max pooling:
Average pooling:
where are padding_l
and padding_r
respectively, and output spatial dimensions are calculated similarly to how they are done in convolution.
During training, max pooling requires a workspace on forward (mkldnn_forward_training) and backward (mkldnn_backward) passes to save indices where maximum was found. The workspace layout is opaque, and the indices cannot be restored from it. However, one can use backward pooling to perform up-sampling (used in some detection topologies).
mkldnn_status_t MKLDNN_API mkldnn_pooling_backward_desc_init | ( | mkldnn_pooling_desc_t * | pool_desc, |
mkldnn_alg_kind_t | alg_kind, | ||
const mkldnn_memory_desc_t * | diff_src_desc, | ||
const mkldnn_memory_desc_t * | diff_dst_desc, | ||
const mkldnn_dims_t | strides, | ||
const mkldnn_dims_t | kernel, | ||
const mkldnn_dims_t | padding_l, | ||
const mkldnn_dims_t | padding_r, | ||
mkldnn_padding_kind_t | padding_kind | ||
) |
Initializes a pooling descriptor pool_desc
for backward propagation using alg_kind
, memory descriptors, and pooling parameters in the spatial domain: strides
, kernel
sizes, padding_l
, padding_r
, and padding_kind
.
padding_r
is NULL
, the padding is supposed to be symmetric.Order of inputs:
alg_kind
= mkldnn_pooling_maxOrder of outputs:
mkldnn_status_t MKLDNN_API mkldnn_pooling_forward_desc_init | ( | mkldnn_pooling_desc_t * | pool_desc, |
mkldnn_prop_kind_t | prop_kind, | ||
mkldnn_alg_kind_t | alg_kind, | ||
const mkldnn_memory_desc_t * | src_desc, | ||
const mkldnn_memory_desc_t * | dst_desc, | ||
const mkldnn_dims_t | strides, | ||
const mkldnn_dims_t | kernel, | ||
const mkldnn_dims_t | padding_l, | ||
const mkldnn_dims_t | padding_r, | ||
mkldnn_padding_kind_t | padding_kind | ||
) |
Initializes a pooling descriptor pool_desc
for forward propagation using prop_kind
(possible values are mkldnn_forward_training and mkldnn_forward_inference), alg_kind
, memory descriptors, and pooling parameters in the spatial domain: strides
, kernel
sizes, padding_l
, padding_r
, and padding_kind
.
padding_r
is NULL
, the padding is supposed to be symmetric.Order of inputs:
Order of outputs:
alg_kind
= mkldnn_pooling_max and prop_kind
= mkldnn_forward_training