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 NDArrayavgPool1d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 1-D Avg Pooling on the input.static BlockavgPool1dBlock(Shape kernelShape) Creates aLambdaBlockthat applies theavgPool1dBlockpooling function in its forward function.static BlockavgPool1dBlock(Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies theavgPool1dBlockpooling function in its forward function.static BlockavgPool1dBlock(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies theavgPool1dBlockpooling function in its forward function.static BlockavgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies theavgPool1dBlockpooling function in its forward function.static BlockavgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlockthat applies theavgPool1dBlockpooling function in its forward function.static NDArrayavgPool2d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 2-D Avg Pooling on the input.static BlockavgPool2dBlock(Shape kernelShape) Creates aLambdaBlockthat applies theavgPool2dBlockpooling function in its forward function.static BlockavgPool2dBlock(Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies theavgPool2dBlockpooling function in its forward function.static BlockavgPool2dBlock(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies theavgPool2dBlockpooling function in its forward function.static BlockavgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies theavgPool2dBlockpooling function in its forward function.static BlockavgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlockthat applies theavgPool2dBlockpooling function in its forward function.static NDArrayavgPool3d(NDArray input, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Performs 3-D Avg Pooling on the input.static BlockavgPool3dBlock(Shape kernelShape) Creates aLambdaBlockthat applies theavgPool3dBlockpooling function in its forward function.static BlockavgPool3dBlock(Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies theavgPool3dBlockpooling function in its forward function.static BlockavgPool3dBlock(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies theavgPool3dBlockpooling function in its forward function.static BlockavgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies theavgPool3dBlockpooling function in its forward function.static BlockavgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlockthat applies theavgPool3dBlockpooling function in its forward function.static NDArrayglobalAvgPool1d(NDArray input) Performs 1-D Global Avg Pooling on the input.static BlockCreates aLambdaBlockthat applies theglobalAvgPool1dpooling function.static NDArrayglobalAvgPool2d(NDArray input) Performs 2-D Global Avg Pooling on the input.static BlockCreates aLambdaBlockthat applies theglobalAvgPool2dpooling function.static NDArrayglobalAvgPool3d(NDArray input) Performs 3-D Global Avg Pooling on the input.static BlockCreates aLambdaBlockthat applies theglobalAvgPool3dpooling function.static NDArrayglobalLpPool1d(NDArray input, float normType) Performs 1-D Global LP Pooling on the input.static BlockglobalLpPool1dBlock(float normType) Creates aLambdaBlockthat applies theglobalLpPool1dpooling function.static NDArrayglobalLpPool2d(NDArray input, float normType) Performs 2-D Global LP Pooling on the input.static BlockglobalLpPool2dBlock(float normType) Creates aLambdaBlockthat applies theglobalLpPool2dpooling function.static NDArrayglobalLpPool3d(NDArray input, float normType) Performs 3-D Global LP Pooling on the input.static BlockglobalLpPool3dBlock(float normType) Creates aLambdaBlockthat applies theglobalLpPool3dpooling function.static NDArrayglobalMaxPool1d(NDArray input) Performs 1-D Global Max Pooling on the input.static BlockCreates aLambdaBlockthat applies theglobalmaxPool1dBlockpooling function.static NDArrayglobalMaxPool2d(NDArray input) Performs 2-D Global Max Pooling on the input.static BlockCreates aLambdaBlockthat applies theglobalmaxPool2dBlockpooling function.static NDArrayglobalMaxPool3d(NDArray input) Performs 3-D Global Max Pooling on the input.static BlockCreates aLambdaBlockthat applies theglobalmaxPool3dBlockpooling function.static NDArraylpPool1d(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 1-D LP Pooling on the input.static BlocklpPool1dBlock(float normType, Shape kernelShape) Creates aLambdaBlockthat applies thelpPool1dBlockpooling function in its forward function.static BlocklpPool1dBlock(float normType, Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies thelpPool1dBlockpooling function in its forward function.static BlocklpPool1dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies thelpPool1dBlockpooling function in its forward function.static NDArraylpPool2d(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 2-D LP Pooling on the input.static BlocklpPool2dBlock(float normType, Shape kernelShape) Creates aLambdaBlockthat applies thelpPool2dBlockpooling function in its forward function.static BlocklpPool2dBlock(float normType, Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies thelpPool2dBlockpooling function in its forward function.static BlocklpPool2dBlock(float normType, Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies thelpPool2dBlockpooling function in its forward function.static BlocklpPool2dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies thelpPool2dBlockpooling function in its forward function.static NDArraylpPool3d(NDArray input, float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Performs 3-D LP Pooling on the input.static BlocklpPool3dBlock(float normType, Shape kernelShape) Creates aLambdaBlockthat applies thelpPool3dBlockpooling function in its forward function.static BlocklpPool3dBlock(float normType, Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies theLpPoo3Dpooling function in its forward function.static BlocklpPool3dBlock(float normType, Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies thelpPool3dBlockpooling function in its forward function.static BlocklpPool3dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies thelpPool3dBlockpooling function in its forward function.static NDArrayPerforms 1-D Max Pooling on the input.static BlockmaxPool1dBlock(Shape kernelShape) Creates aLambdaBlockthat applies themaxPool1dBlockpooling function in its forward function.static BlockmaxPool1dBlock(Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies themaxPool1dBlockpooling function in its forward function.static BlockmaxPool1dBlock(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies themaxPool1dBlockpooling function in its forward function.static BlockmaxPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies themaxPool1dpooling function in its forward function.static NDArrayPerforms 2-D Max Pooling on the input.static BlockmaxPool2dBlock(Shape kernelShape) Creates aLambdaBlockthat applies themaxPool2dBlockpooling function in its forward function.static BlockmaxPool2dBlock(Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies themaxPool2dBlockpooling function in its forward function.static BlockmaxPool2dBlock(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies themaxPool2dBlockpooling function in its forward function.static BlockmaxPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies themaxPool2dBlockpooling function in its forward function.static NDArrayPerforms 3-D Max Pooling on the input.static BlockmaxPool3dBlock(Shape kernelShape) Creates aLambdaBlockthat applies themaxPool3dBlockpooling function in its forward function.static BlockmaxPool3dBlock(Shape kernelShape, Shape stride) Creates aLambdaBlockthat applies themaxPool3dBlockpooling function in its forward function.static BlockmaxPool3dBlock(Shape kernelShape, Shape stride, Shape padding) Creates aLambdaBlockthat applies themaxPool3dBlockpooling function in its forward function.static BlockmaxPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies themaxPool3dBlockpooling 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 aLambdaBlockthat applies themaxPool1dpooling 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
LambdaBlockthat applies themaxPool1dBlockactivation function
-
maxPool1dBlock
Creates aLambdaBlockthat applies themaxPool1dBlockpooling 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
LambdaBlockthat applies themaxPool1dBlockactivation function
-
maxPool1dBlock
Creates aLambdaBlockthat applies themaxPool1dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be usedstride- stride of pooling layer- Returns:
- the
LambdaBlockthat applies themaxPool1dBlockactivation function
-
maxPool1dBlock
Creates aLambdaBlockthat applies themaxPool1dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies themaxPool1dBlockactivation function
-
maxPool2dBlock
public static Block maxPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies themaxPool2dBlockpooling 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
LambdaBlockthat applies themaxPool2dBlockactivation function
-
maxPool2dBlock
Creates aLambdaBlockthat applies themaxPool2dBlockpooling 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
LambdaBlockthat applies themaxPool2dBlockactivation function
-
maxPool2dBlock
Creates aLambdaBlockthat applies themaxPool2dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be usedstride- stride of pooling layer- Returns:
- the
LambdaBlockthat applies themaxPool2dBlockactivation function
-
maxPool2dBlock
Creates aLambdaBlockthat applies themaxPool2dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies themaxPool2dBlockactivation function
-
maxPool3dBlock
public static Block maxPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies themaxPool3dBlockpooling 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
LambdaBlockthat applies themaxPool3dBlockactivation function
-
maxPool3dBlock
Creates aLambdaBlockthat applies themaxPool3dBlockpooling 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
LambdaBlockthat applies themaxPool3dBlockactivation function
-
maxPool3dBlock
Creates aLambdaBlockthat applies themaxPool3dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be usedstride- stride of pooling layer- Returns:
- the
LambdaBlockthat applies themaxPool3dBlockactivation function
-
maxPool3dBlock
Creates aLambdaBlockthat applies themaxPool3dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies themaxPool3dBlockactivation function
-
globalMaxPool1dBlock
Creates aLambdaBlockthat applies theglobalmaxPool1dBlockpooling function.- Returns:
- the
LambdaBlockthat applies theglobalmaxPool1dBlockpooling function
-
globalMaxPool2dBlock
Creates aLambdaBlockthat applies theglobalmaxPool2dBlockpooling function.- Returns:
- the
LambdaBlockthat applies theglobalmaxPool2dBlockpooling function
-
globalMaxPool3dBlock
Creates aLambdaBlockthat applies theglobalmaxPool3dBlockpooling function.- Returns:
- the
LambdaBlockthat applies theglobalmaxPool3dBlockpooling function
-
avgPool1dBlock
public static Block avgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlockthat applies theavgPool1dBlockpooling 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
LambdaBlockthat applies theavgPool1dBlockactivation function
-
avgPool1dBlock
public static Block avgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies theavgPool1dBlockpooling 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
LambdaBlockthat applies theavgPool1dBlockactivation function
-
avgPool1dBlock
Creates aLambdaBlockthat applies theavgPool1dBlockpooling 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
LambdaBlockthat applies theavgPool1dBlockactivation function
-
avgPool1dBlock
Creates aLambdaBlockthat applies theavgPool1dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be usedstride- stride of pooling layer- Returns:
- the
LambdaBlockthat applies theavgPool1dBlockactivation function
-
avgPool1dBlock
Creates aLambdaBlockthat applies theavgPool1dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies theavgPool1dBlockactivation function
-
avgPool2dBlock
public static Block avgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlockthat applies theavgPool2dBlockpooling 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
LambdaBlockthat applies theavgPool2dBlockactivation function
-
avgPool2dBlock
public static Block avgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies theavgPool2dBlockpooling 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
LambdaBlockthat applies theavgPool2dBlockactivation function
-
avgPool2dBlock
Creates aLambdaBlockthat applies theavgPool2dBlockpooling 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
LambdaBlockthat applies theavgPool2dBlockactivation function
-
avgPool2dBlock
Creates aLambdaBlockthat applies theavgPool2dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be usedstride- stride of pooling layer- Returns:
- the
LambdaBlockthat applies theavgPool2dBlockactivation function
-
avgPool2dBlock
Creates aLambdaBlockthat applies theavgPool2dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies theavgPool2dBlockactivation function
-
avgPool3dBlock
public static Block avgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad) Creates aLambdaBlockthat applies theavgPool3dBlockpooling 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
LambdaBlockthat applies theavgPool3dBlockactivation function
-
avgPool3dBlock
public static Block avgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies theavgPool3dBlockpooling 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
LambdaBlockthat applies theavgPool3dBlockactivation function
-
avgPool3dBlock
Creates aLambdaBlockthat applies theavgPool3dBlockpooling 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
LambdaBlockthat applies theavgPool3dBlockactivation function
-
avgPool3dBlock
Creates aLambdaBlockthat applies theavgPool3dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be usedstride- stride of pooling layer- Returns:
- the
LambdaBlockthat applies theavgPool3dBlockactivation function
-
avgPool3dBlock
Creates aLambdaBlockthat applies theavgPool3dBlockpooling function in its forward function.- Parameters:
kernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies theavgPool3dBlockactivation function
-
globalAvgPool1dBlock
Creates aLambdaBlockthat applies theglobalAvgPool1dpooling function.- Returns:
- the
LambdaBlockthat applies theglobalAvgPool1dpooling function
-
globalAvgPool2dBlock
Creates aLambdaBlockthat applies theglobalAvgPool2dpooling function.- Returns:
- the
LambdaBlockthat applies theglobalAvgPool2dpooling function
-
globalAvgPool3dBlock
Creates aLambdaBlockthat applies theglobalAvgPool3dpooling function.- Returns:
- the
LambdaBlockthat applies theglobalAvgPool3dpooling function
-
lpPool1dBlock
public static Block lpPool1dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies thelpPool1dBlockpooling 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
LambdaBlockthat applies thelpPool1dBlockactivation function
-
lpPool1dBlock
Creates aLambdaBlockthat applies thelpPool1dBlockpooling 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
LambdaBlockthat applies thelpPool1dBlockactivation function
-
lpPool1dBlock
Creates aLambdaBlockthat applies thelpPool1dBlockpooling function in its forward function.- Parameters:
normType- float value indicating normkernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies thelpPool1dBlockactivation function
-
lpPool2dBlock
public static Block lpPool2dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies thelpPool2dBlockpooling 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
LambdaBlockthat applies thelpPool2dBlockactivation function
-
lpPool2dBlock
Creates aLambdaBlockthat applies thelpPool2dBlockpooling 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
LambdaBlockthat applies thelpPool2dBlockactivation function
-
lpPool2dBlock
Creates aLambdaBlockthat applies thelpPool2dBlockpooling 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
LambdaBlockthat applies thelpPool2dBlockactivation function
-
lpPool2dBlock
Creates aLambdaBlockthat applies thelpPool2dBlockpooling function in its forward function.- Parameters:
normType- float value indicating normkernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies thelpPool2dBlockactivation function
-
lpPool3dBlock
public static Block lpPool3dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode) Creates aLambdaBlockthat applies thelpPool3dBlockpooling 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
LambdaBlockthat applies thelpPool3dBlockactivation function
-
lpPool3dBlock
Creates aLambdaBlockthat applies thelpPool3dBlockpooling 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
LambdaBlockthat applies thelpPool3dBlockactivation function
-
lpPool3dBlock
Creates aLambdaBlockthat applies theLpPoo3Dpooling 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
LambdaBlockthat applies thelpPool3dBlockactivation function
-
lpPool3dBlock
Creates aLambdaBlockthat applies thelpPool3dBlockpooling function in its forward function.- Parameters:
normType- float value indicating normkernelShape- the shape of the kernel to be used- Returns:
- the
LambdaBlockthat applies thelpPool3dBlockactivation function
-
globalLpPool1dBlock
Creates aLambdaBlockthat applies theglobalLpPool1dpooling function.- Parameters:
normType- float value indicating norm- Returns:
- the
LambdaBlockthat applies theglobalLpPool1dpooling function
-
globalLpPool2dBlock
Creates aLambdaBlockthat applies theglobalLpPool2dpooling function.- Parameters:
normType- float value indicating norm- Returns:
- the
LambdaBlockthat applies theglobalLpPool2dpooling function
-
globalLpPool3dBlock
Creates aLambdaBlockthat applies theglobalLpPool3dpooling function.- Parameters:
normType- float value indicating norm- Returns:
- the
LambdaBlockthat applies theglobalLpPool3dpooling function
-