Package ai.djl.nn.pooling
Class Pool
java.lang.Object
ai.djl.nn.pooling.Pool
Utility class that provides
Block
and methods for different pooling functions.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic NDArray
avgPool1d
(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 1-D Avg Pooling on the input.static Block
avgPool1dBlock
(Shape kernelShape) Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.static Block
avgPool1dBlock
(Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.static Block
avgPool1dBlock
(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.static Block
avgPool1dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.static Block
avgPool1dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.static NDArray
avgPool2d
(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 2-D Avg Pooling on the input.static Block
avgPool2dBlock
(Shape kernelShape) Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.static Block
avgPool2dBlock
(Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.static Block
avgPool2dBlock
(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.static Block
avgPool2dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.static Block
avgPool2dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.static NDArray
avgPool3d
(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 3-D Avg Pooling on the input.static Block
avgPool3dBlock
(Shape kernelShape) Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.static Block
avgPool3dBlock
(Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.static Block
avgPool3dBlock
(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.static Block
avgPool3dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.static Block
avgPool3dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.static NDArray
globalAvgPool1d
(NDArray input) Performs 1-D Global Avg Pooling on the input.static Block
Creates aLambdaBlock
that applies theglobalAvgPool1d
pooling function.static NDArray
globalAvgPool2d
(NDArray input) Performs 2-D Global Avg Pooling on the input.static Block
Creates aLambdaBlock
that applies theglobalAvgPool2d
pooling function.static NDArray
globalAvgPool3d
(NDArray input) Performs 3-D Global Avg Pooling on the input.static Block
Creates aLambdaBlock
that applies theglobalAvgPool3d
pooling function.static NDArray
globalLpPool1d
(NDArray input, float normType) Performs 1-D Global LP Pooling on the input.static Block
globalLpPool1dBlock
(float normType) Creates aLambdaBlock
that applies theglobalLpPool1d
pooling function.static NDArray
globalLpPool2d
(NDArray input, float normType) Performs 2-D Global LP Pooling on the input.static Block
globalLpPool2dBlock
(float normType) Creates aLambdaBlock
that applies theglobalLpPool2d
pooling function.static NDArray
globalLpPool3d
(NDArray input, float normType) Performs 3-D Global LP Pooling on the input.static Block
globalLpPool3dBlock
(float normType) Creates aLambdaBlock
that applies theglobalLpPool3d
pooling function.static NDArray
globalMaxPool1d
(NDArray input) Performs 1-D Global Max Pooling on the input.static Block
Creates aLambdaBlock
that applies theglobalmaxPool1dBlock
pooling function.static NDArray
globalMaxPool2d
(NDArray input) Performs 2-D Global Max Pooling on the input.static Block
Creates aLambdaBlock
that applies theglobalmaxPool2dBlock
pooling function.static NDArray
globalMaxPool3d
(NDArray input) Performs 3-D Global Max Pooling on the input.static Block
Creates aLambdaBlock
that applies theglobalmaxPool3dBlock
pooling function.static NDArray
lpPool1d
(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 1-D LP Pooling on the input.static Block
lpPool1dBlock
(float normType, Shape kernelShape) Creates aLambdaBlock
that applies thelpPool1dBlock
pooling function in its forward function.static Block
lpPool1dBlock
(float normType, Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies thelpPool1dBlock
pooling function in its forward function.static Block
lpPool1dBlock
(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies thelpPool1dBlock
pooling function in its forward function.static NDArray
lpPool2d
(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 2-D LP Pooling on the input.static Block
lpPool2dBlock
(float normType, Shape kernelShape) Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.static Block
lpPool2dBlock
(float normType, Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.static Block
lpPool2dBlock
(float normType, Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.static Block
lpPool2dBlock
(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.static NDArray
lpPool3d
(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 3-D LP Pooling on the input.static Block
lpPool3dBlock
(float normType, Shape kernelShape) Creates aLambdaBlock
that applies thelpPool3dBlock
pooling function in its forward function.static Block
lpPool3dBlock
(float normType, Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies theLpPoo3D
pooling function in its forward function.static Block
lpPool3dBlock
(float normType, Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies thelpPool3dBlock
pooling function in its forward function.static Block
lpPool3dBlock
(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies thelpPool3dBlock
pooling function in its forward function.static NDArray
Performs 1-D Max Pooling on the input.static Block
maxPool1dBlock
(Shape kernelShape) Creates aLambdaBlock
that applies themaxPool1dBlock
pooling function in its forward function.static Block
maxPool1dBlock
(Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies themaxPool1dBlock
pooling function in its forward function.static Block
maxPool1dBlock
(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies themaxPool1dBlock
pooling function in its forward function.static Block
maxPool1dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies themaxPool1d
pooling function in its forward function.static NDArray
Performs 2-D Max Pooling on the input.static Block
maxPool2dBlock
(Shape kernelShape) Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.static Block
maxPool2dBlock
(Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.static Block
maxPool2dBlock
(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.static Block
maxPool2dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.static NDArray
Performs 3-D Max Pooling on the input.static Block
maxPool3dBlock
(Shape kernelShape) Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.static Block
maxPool3dBlock
(Shape kernelShape, Shape stride) Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.static Block
maxPool3dBlock
(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.static Block
maxPool3dBlock
(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.
-
Method Details
-
maxPool1d
public static NDArray maxPool1d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 1-D Max Pooling on the input.- Parameters:
input
- the NDArray on which max pooling is performedkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the NDArray after applying max pooling
-
maxPool2d
public static NDArray maxPool2d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 2-D Max Pooling on the input.- Parameters:
input
- the NDArray on which max pooling is performedkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the NDArray after applying max pooling
-
maxPool3d
public static NDArray maxPool3d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 3-D Max Pooling on the input.- Parameters:
input
- the NDArray on which max pooling is performedkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the NDArray after applying max pooling
-
globalMaxPool1d
Performs 1-D Global Max Pooling on the input.- Parameters:
input
- the NDArray on which max pooling is performed- Returns:
- the NDArray after applying global max pooling
-
globalMaxPool2d
Performs 2-D Global Max Pooling on the input.- Parameters:
input
- the NDArray on which max pooling is performed- Returns:
- the NDArray after applying global max pooling
-
globalMaxPool3d
Performs 3-D Global Max Pooling on the input.- Parameters:
input
- the NDArray on which max pooling is performed- Returns:
- the NDArray after applying global max pooling
-
avgPool1d
public static NDArray avgPool1d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 1-D Avg Pooling on the input.- Parameters:
input
- the NDArray on which average pooling is performedkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.countIncludePad
- whether to include padding for calculations- Returns:
- the NDArray after applying avg pooling
-
avgPool2d
public static NDArray avgPool2d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 2-D Avg Pooling on the input.- Parameters:
input
- the NDArray on which average pooling is performedkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.countIncludePad
- whether to include padding for calculations- Returns:
- the NDArray after applying avg pooling
-
avgPool3d
public static NDArray avgPool3d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 3-D Avg Pooling on the input.- Parameters:
input
- the NDArray on which average pooling is performedkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.countIncludePad
- whether to include padding for calculations- Returns:
- the NDArray after applying avg pooling
-
globalAvgPool1d
Performs 1-D Global Avg Pooling on the input.- Parameters:
input
- the NDArray on which average pooling is performed- Returns:
- the NDArray after applying global avg pooling
-
globalAvgPool2d
Performs 2-D Global Avg Pooling on the input.- Parameters:
input
- the NDArray on which average pooling is performed- Returns:
- the NDArray after applying global avg pooling
-
globalAvgPool3d
Performs 3-D Global Avg Pooling on the input.- Parameters:
input
- the NDArray on which average pooling is performed- Returns:
- the NDArray after applying global avg pooling
-
lpPool1d
public static NDArray lpPool1d(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 1-D LP Pooling on the input.- Parameters:
input
- the NDArray on which LP pooling is performednormType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the NDArray after applying lp pooling
-
lpPool2d
public static NDArray lpPool2d(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 2-D LP Pooling on the input.- Parameters:
input
- the NDArray on which LP pooling is performednormType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the NDArray after applying lp pooling
-
lpPool3d
public static NDArray lpPool3d(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 3-D LP Pooling on the input.- Parameters:
input
- the NDArray on which LP pooling is performednormType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- the stride to be used for each dimensionpadding
- the padding to be set in each dimensionceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the NDArray after applying lp pooling
-
globalLpPool1d
Performs 1-D Global LP Pooling on the input.- Parameters:
input
- the NDArray on which LP pooling is performednormType
- float value indicating norm- Returns:
- the NDArray after applying global lp pooling
-
globalLpPool2d
Performs 2-D Global LP Pooling on the input.- Parameters:
input
- the NDArray on which LP pooling is performednormType
- float value indicating norm- Returns:
- the NDArray after applying global lp pooling
-
globalLpPool3d
Performs 3-D Global LP Pooling on the input.- Parameters:
input
- the NDArray on which LP pooling is performednormType
- float value indicating norm- Returns:
- the NDArray after applying global lp pooling
-
maxPool1dBlock
public static Block maxPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies themaxPool1d
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies themaxPool1dBlock
activation function
-
maxPool1dBlock
Creates aLambdaBlock
that applies themaxPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies themaxPool1dBlock
activation function
-
maxPool1dBlock
Creates aLambdaBlock
that applies themaxPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies themaxPool1dBlock
activation function
-
maxPool1dBlock
Creates aLambdaBlock
that applies themaxPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies themaxPool1dBlock
activation function
-
maxPool2dBlock
public static Block maxPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies themaxPool2dBlock
activation function
-
maxPool2dBlock
Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies themaxPool2dBlock
activation function
-
maxPool2dBlock
Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies themaxPool2dBlock
activation function
-
maxPool2dBlock
Creates aLambdaBlock
that applies themaxPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies themaxPool2dBlock
activation function
-
maxPool3dBlock
public static Block maxPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies themaxPool3dBlock
activation function
-
maxPool3dBlock
Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies themaxPool3dBlock
activation function
-
maxPool3dBlock
Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies themaxPool3dBlock
activation function
-
maxPool3dBlock
Creates aLambdaBlock
that applies themaxPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies themaxPool3dBlock
activation function
-
globalMaxPool1dBlock
Creates aLambdaBlock
that applies theglobalmaxPool1dBlock
pooling function.- Returns:
- the
LambdaBlock
that applies theglobalmaxPool1dBlock
pooling function
-
globalMaxPool2dBlock
Creates aLambdaBlock
that applies theglobalmaxPool2dBlock
pooling function.- Returns:
- the
LambdaBlock
that applies theglobalmaxPool2dBlock
pooling function
-
globalMaxPool3dBlock
Creates aLambdaBlock
that applies theglobalmaxPool3dBlock
pooling function.- Returns:
- the
LambdaBlock
that applies theglobalmaxPool3dBlock
pooling function
-
avgPool1dBlock
public static Block avgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.countIncludePad
- Boolean indicating whether to include padding for calculations- Returns:
- the
LambdaBlock
that applies theavgPool1dBlock
activation function
-
avgPool1dBlock
public static Block avgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies theavgPool1dBlock
activation function
-
avgPool1dBlock
Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies theavgPool1dBlock
activation function
-
avgPool1dBlock
Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies theavgPool1dBlock
activation function
-
avgPool1dBlock
Creates aLambdaBlock
that applies theavgPool1dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies theavgPool1dBlock
activation function
-
avgPool2dBlock
public static Block avgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.countIncludePad
- Boolean indicating whether to include padding for calculations- Returns:
- the
LambdaBlock
that applies theavgPool2dBlock
activation function
-
avgPool2dBlock
public static Block avgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies theavgPool2dBlock
activation function
-
avgPool2dBlock
Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies theavgPool2dBlock
activation function
-
avgPool2dBlock
Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies theavgPool2dBlock
activation function
-
avgPool2dBlock
Creates aLambdaBlock
that applies theavgPool2dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies theavgPool2dBlock
activation function
-
avgPool3dBlock
public static Block avgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.countIncludePad
- Boolean indicating whether to include padding for calculations- Returns:
- the
LambdaBlock
that applies theavgPool3dBlock
activation function
-
avgPool3dBlock
public static Block avgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies theavgPool3dBlock
activation function
-
avgPool3dBlock
Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies theavgPool3dBlock
activation function
-
avgPool3dBlock
Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies theavgPool3dBlock
activation function
-
avgPool3dBlock
Creates aLambdaBlock
that applies theavgPool3dBlock
pooling function in its forward function.- Parameters:
kernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies theavgPool3dBlock
activation function
-
globalAvgPool1dBlock
Creates aLambdaBlock
that applies theglobalAvgPool1d
pooling function.- Returns:
- the
LambdaBlock
that applies theglobalAvgPool1d
pooling function
-
globalAvgPool2dBlock
Creates aLambdaBlock
that applies theglobalAvgPool2d
pooling function.- Returns:
- the
LambdaBlock
that applies theglobalAvgPool2d
pooling function
-
globalAvgPool3dBlock
Creates aLambdaBlock
that applies theglobalAvgPool3d
pooling function.- Returns:
- the
LambdaBlock
that applies theglobalAvgPool3d
pooling function
-
lpPool1dBlock
public static Block lpPool1dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies thelpPool1dBlock
pooling function in its forward function.- Parameters:
normType
- integer indicating pValuekernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- padding of pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies thelpPool1dBlock
activation function
-
lpPool1dBlock
Creates aLambdaBlock
that applies thelpPool1dBlock
pooling function in its forward function.- Parameters:
normType
- integer indicating pValuekernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- padding of pooling layer- Returns:
- the
LambdaBlock
that applies thelpPool1dBlock
activation function
-
lpPool1dBlock
Creates aLambdaBlock
that applies thelpPool1dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies thelpPool1dBlock
activation function
-
lpPool2dBlock
public static Block lpPool2dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies thelpPool2dBlock
activation function
-
lpPool2dBlock
Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies thelpPool2dBlock
activation function
-
lpPool2dBlock
Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies thelpPool2dBlock
activation function
-
lpPool2dBlock
Creates aLambdaBlock
that applies thelpPool2dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies thelpPool2dBlock
activation function
-
lpPool3dBlock
public static Block lpPool3dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlock
that applies thelpPool3dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layerceilMode
- when true, will use ceil instead of floor in the formula to compute the output shape. The formula isf(x, k, p, s) = floor((x+2*p-k)/s)+1
.- Returns:
- the
LambdaBlock
that applies thelpPool3dBlock
activation function
-
lpPool3dBlock
Creates aLambdaBlock
that applies thelpPool3dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- stride of pooling layerpadding
- pad of the pooling layer- Returns:
- the
LambdaBlock
that applies thelpPool3dBlock
activation function
-
lpPool3dBlock
Creates aLambdaBlock
that applies theLpPoo3D
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be usedstride
- stride of pooling layer- Returns:
- the
LambdaBlock
that applies thelpPool3dBlock
activation function
-
lpPool3dBlock
Creates aLambdaBlock
that applies thelpPool3dBlock
pooling function in its forward function.- Parameters:
normType
- float value indicating normkernelShape
- the shape of the kernel to be used- Returns:
- the
LambdaBlock
that applies thelpPool3dBlock
activation function
-
globalLpPool1dBlock
Creates aLambdaBlock
that applies theglobalLpPool1d
pooling function.- Parameters:
normType
- float value indicating norm- Returns:
- the
LambdaBlock
that applies theglobalLpPool1d
pooling function
-
globalLpPool2dBlock
Creates aLambdaBlock
that applies theglobalLpPool2d
pooling function.- Parameters:
normType
- float value indicating norm- Returns:
- the
LambdaBlock
that applies theglobalLpPool2d
pooling function
-
globalLpPool3dBlock
Creates aLambdaBlock
that applies theglobalLpPool3d
pooling function.- Parameters:
normType
- float value indicating norm- Returns:
- the
LambdaBlock
that applies theglobalLpPool3d
pooling function
-