# maxout¶

paddle.nn.functional. maxout ( x, groups, axis=1, name=None ) [source]

maxout activation.

Assumed the input shape is (N, Ci, H, W). The output shape is (N, Co, H, W). Then Co = Ci/groups and the operator formula is as follows:

$\begin{split}&out_{si+j} = \\max_{k} x_{gsi + sk + j} \\\\ &g = groups \\\\ &s = \\frac{input.size}{num\\_channels} \\\\ &0 \\le i < \\frac{num\\_channels}{groups} \\\\ &0 \\le j < s \\\\ &0 \\le k < groups\end{split}$
Parameters
• x (Tensor) – The input is 4-D Tensor with shape [N, C, H, W] or [N, H, W, C], the data type of input is float32 or float64.

• groups (int, optional) – The groups number of maxout. groups specifies the index of channel dimension where maxout will be performed. This must be a factor of number of features. Default is 1.

• axis (int, optional) – The axis along which to perform maxout calculations. It should be 1 when data format is NCHW, be -1 or 3 when data format is NHWC. If axis < 0, it works the same way as $$axis + D$$ , where D is the dimensions of x . axis only supports 1, 3 or -1. Default is 1.

• name (str, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

A Tensor with the same data type as x .

Examples

import paddle