class nbla::MaxPooling

template<typename T>
class MaxPooling : public nbla::BasePooling<T, const vector<int>&, const vector<int>&, bool, const vector<int>&, bool>

Max pooling operator.

Inputs:

  • N-D array that has more than two dimensions.

Outputs:

  • N-D array.

Note

Only 2D pooling supported so far.

Template Parameters:

T – Data type for computation.

Param kernel:

Shapes of kernel.

Param stride:

Subsampling factors of pooling.

Param ignore_border:

If false, a kernel overlapping border is also considered for output unlike convolution.

Param pad:

Border padding values of dimensions. Padding will be added both sides of the dimension.

Public Functions

inline virtual shared_ptr<Function> copy() const

Copy another instance of Function with the same context.

inline virtual string name()

Get function name in string.

inline virtual bool grad_depends_output_data(int i, int o) const

Dependency flag for checking if in-grad depends on out-data.

Checking if i-th input’ gradient computation requires o-th output’s data or not.

Note

If any of inputs requires an output variable data when computing its gradient, this function must be overridden to return appropriate boolean value. Otherwise, backward computation will be incorrect.

Parameters:
  • i[in] Input variable index.

  • o[in] Output variable index.