DLPrimitives
|
Public Member Functions | |
virtual void | enqueue (Tensor &, Tensor &dX, Tensor &dY, float factor, ExecutionContext const &e) |
for Avg pooling we don't need X so you can call directrly enqueue(dX,dY,factor,e) More... | |
virtual void | enqueue (Tensor &dX, Tensor &dY, float factor, ExecutionContext const &e)=0 |
actual computation, no need X for backward propogation More... | |
Public Member Functions inherited from dlprim::core::Pooling2DBackwardBase | |
virtual size_t | workspace ()=0 |
get workspace | |
Static Public Member Functions | |
static std::unique_ptr< AvgPooling2DBackward > | create (Context &ctx, int kernel[2], int pad[2], int stride[2], bool count_include_pad=false, DataType dt=float_data) |
Create average pooling with kernel. | |
static std::unique_ptr< AvgPooling2DBackward > | create_global (Context &ctx, Shape const &in_shape, DataType dt=float_data) |
Create global average pooling. | |
|
inlinevirtual |
for Avg pooling we don't need X so you can call directrly enqueue(dX,dY,factor,e)
when used with kernel based pooling (not global) dX and dY dimensions should match at batch and channels and for H/W the dimention for Y should be Y_dim = op((X_dim + 2 * pad[dim] - kernel[dim]) / stride[dim]) + 1 where op is either ceil or floor
Implements dlprim::core::Pooling2DBackwardBase.
References dlprim::core::Pooling2DForward::enqueue().
|
pure virtual |
actual computation, no need X for backward propogation
when used with kernel based pooling (not global) dX and dY dimensions should match at batch and channels and for H/W the dimention for Y should be Y_dim = op((X_dim + 2 * pad[dim] - kernel[dim]) / stride[dim]) + 1 where op is either ceil or floor