Class Pool

java.lang.Object
ai.djl.nn.pooling.Pool

public final class Pool extends Object
Utility class that provides Block and methods for different pooling functions.
See Also:
  • 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 performed
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 performed
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 performed
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the NDArray after applying max pooling
    • globalMaxPool1d

      public static NDArray globalMaxPool1d(NDArray input)
      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

      public static NDArray globalMaxPool2d(NDArray input)
      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

      public static NDArray globalMaxPool3d(NDArray input)
      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 performed
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 performed
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 performed
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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

      public static NDArray globalAvgPool1d(NDArray input)
      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

      public static NDArray globalAvgPool2d(NDArray input)
      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

      public static NDArray globalAvgPool3d(NDArray input)
      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 performed
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 performed
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 performed
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - the stride to be used for each dimension
      padding - the padding to be set in each dimension
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the NDArray after applying lp pooling
    • globalLpPool1d

      public static NDArray globalLpPool1d(NDArray input, float normType)
      Performs 1-D Global LP Pooling on the input.
      Parameters:
      input - the NDArray on which LP pooling is performed
      normType - float value indicating norm
      Returns:
      the NDArray after applying global lp pooling
    • globalLpPool2d

      public static NDArray globalLpPool2d(NDArray input, float normType)
      Performs 2-D Global LP Pooling on the input.
      Parameters:
      input - the NDArray on which LP pooling is performed
      normType - float value indicating norm
      Returns:
      the NDArray after applying global lp pooling
    • globalLpPool3d

      public static NDArray globalLpPool3d(NDArray input, float normType)
      Performs 3-D Global LP Pooling on the input.
      Parameters:
      input - the NDArray on which LP pooling is performed
      normType - 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 a LambdaBlock that applies the maxPool1d pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the maxPool1dBlock activation function
    • maxPool1dBlock

      public static Block maxPool1dBlock(Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the maxPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the maxPool1dBlock activation function
    • maxPool1dBlock

      public static Block maxPool1dBlock(Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the maxPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the maxPool1dBlock activation function
    • maxPool1dBlock

      public static Block maxPool1dBlock(Shape kernelShape)
      Creates a LambdaBlock that applies the maxPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the maxPool1dBlock activation function
    • maxPool2dBlock

      public static Block maxPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the maxPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the maxPool2dBlock activation function
    • maxPool2dBlock

      public static Block maxPool2dBlock(Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the maxPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the maxPool2dBlock activation function
    • maxPool2dBlock

      public static Block maxPool2dBlock(Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the maxPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the maxPool2dBlock activation function
    • maxPool2dBlock

      public static Block maxPool2dBlock(Shape kernelShape)
      Creates a LambdaBlock that applies the maxPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the maxPool2dBlock activation function
    • maxPool3dBlock

      public static Block maxPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the maxPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the maxPool3dBlock activation function
    • maxPool3dBlock

      public static Block maxPool3dBlock(Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the maxPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the maxPool3dBlock activation function
    • maxPool3dBlock

      public static Block maxPool3dBlock(Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the maxPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the maxPool3dBlock activation function
    • maxPool3dBlock

      public static Block maxPool3dBlock(Shape kernelShape)
      Creates a LambdaBlock that applies the maxPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the maxPool3dBlock activation function
    • globalMaxPool1dBlock

      public static Block globalMaxPool1dBlock()
      Creates a LambdaBlock that applies the globalmaxPool1dBlock pooling function.
      Returns:
      the LambdaBlock that applies the globalmaxPool1dBlock pooling function
    • globalMaxPool2dBlock

      public static Block globalMaxPool2dBlock()
      Creates a LambdaBlock that applies the globalmaxPool2dBlock pooling function.
      Returns:
      the LambdaBlock that applies the globalmaxPool2dBlock pooling function
    • globalMaxPool3dBlock

      public static Block globalMaxPool3dBlock()
      Creates a LambdaBlock that applies the globalmaxPool3dBlock pooling function.
      Returns:
      the LambdaBlock that applies the globalmaxPool3dBlock pooling function
    • avgPool1dBlock

      public static Block avgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad)
      Creates a LambdaBlock that applies the avgPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 the avgPool1dBlock activation function
    • avgPool1dBlock

      public static Block avgPool1dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the avgPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the avgPool1dBlock activation function
    • avgPool1dBlock

      public static Block avgPool1dBlock(Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the avgPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the avgPool1dBlock activation function
    • avgPool1dBlock

      public static Block avgPool1dBlock(Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the avgPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the avgPool1dBlock activation function
    • avgPool1dBlock

      public static Block avgPool1dBlock(Shape kernelShape)
      Creates a LambdaBlock that applies the avgPool1dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the avgPool1dBlock activation function
    • avgPool2dBlock

      public static Block avgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad)
      Creates a LambdaBlock that applies the avgPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 the avgPool2dBlock activation function
    • avgPool2dBlock

      public static Block avgPool2dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the avgPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the avgPool2dBlock activation function
    • avgPool2dBlock

      public static Block avgPool2dBlock(Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the avgPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the avgPool2dBlock activation function
    • avgPool2dBlock

      public static Block avgPool2dBlock(Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the avgPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the avgPool2dBlock activation function
    • avgPool2dBlock

      public static Block avgPool2dBlock(Shape kernelShape)
      Creates a LambdaBlock that applies the avgPool2dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the avgPool2dBlock activation function
    • avgPool3dBlock

      public static Block avgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode, boolean countIncludePad)
      Creates a LambdaBlock that applies the avgPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(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 the avgPool3dBlock activation function
    • avgPool3dBlock

      public static Block avgPool3dBlock(Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the avgPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the avgPool3dBlock activation function
    • avgPool3dBlock

      public static Block avgPool3dBlock(Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the avgPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the avgPool3dBlock activation function
    • avgPool3dBlock

      public static Block avgPool3dBlock(Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the avgPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the avgPool3dBlock activation function
    • avgPool3dBlock

      public static Block avgPool3dBlock(Shape kernelShape)
      Creates a LambdaBlock that applies the avgPool3dBlock pooling function in its forward function.
      Parameters:
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the avgPool3dBlock activation function
    • globalAvgPool1dBlock

      public static Block globalAvgPool1dBlock()
      Creates a LambdaBlock that applies the globalAvgPool1d pooling function.
      Returns:
      the LambdaBlock that applies the globalAvgPool1d pooling function
    • globalAvgPool2dBlock

      public static Block globalAvgPool2dBlock()
      Creates a LambdaBlock that applies the globalAvgPool2d pooling function.
      Returns:
      the LambdaBlock that applies the globalAvgPool2d pooling function
    • globalAvgPool3dBlock

      public static Block globalAvgPool3dBlock()
      Creates a LambdaBlock that applies the globalAvgPool3d pooling function.
      Returns:
      the LambdaBlock that applies the globalAvgPool3d pooling function
    • lpPool1dBlock

      public static Block lpPool1dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the lpPool1dBlock pooling function in its forward function.
      Parameters:
      normType - integer indicating pValue
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - padding of pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the lpPool1dBlock activation function
    • lpPool1dBlock

      public static Block lpPool1dBlock(float normType, Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the lpPool1dBlock pooling function in its forward function.
      Parameters:
      normType - integer indicating pValue
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - padding of pooling layer
      Returns:
      the LambdaBlock that applies the lpPool1dBlock activation function
    • lpPool1dBlock

      public static Block lpPool1dBlock(float normType, Shape kernelShape)
      Creates a LambdaBlock that applies the lpPool1dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the lpPool1dBlock activation function
    • lpPool2dBlock

      public static Block lpPool2dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the lpPool2dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the lpPool2dBlock activation function
    • lpPool2dBlock

      public static Block lpPool2dBlock(float normType, Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the lpPool2dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the lpPool2dBlock activation function
    • lpPool2dBlock

      public static Block lpPool2dBlock(float normType, Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the lpPool2dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the lpPool2dBlock activation function
    • lpPool2dBlock

      public static Block lpPool2dBlock(float normType, Shape kernelShape)
      Creates a LambdaBlock that applies the lpPool2dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the lpPool2dBlock activation function
    • lpPool3dBlock

      public static Block lpPool3dBlock(float normType, Shape kernelShape, Shape stride, Shape padding, boolean ceilMode)
      Creates a LambdaBlock that applies the lpPool3dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      ceilMode - when true, will use ceil instead of floor in the formula to compute the output shape. The formula is f(x, k, p, s) = floor((x+2*p-k)/s)+1.
      Returns:
      the LambdaBlock that applies the lpPool3dBlock activation function
    • lpPool3dBlock

      public static Block lpPool3dBlock(float normType, Shape kernelShape, Shape stride, Shape padding)
      Creates a LambdaBlock that applies the lpPool3dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      padding - pad of the pooling layer
      Returns:
      the LambdaBlock that applies the lpPool3dBlock activation function
    • lpPool3dBlock

      public static Block lpPool3dBlock(float normType, Shape kernelShape, Shape stride)
      Creates a LambdaBlock that applies the LpPoo3D pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      stride - stride of pooling layer
      Returns:
      the LambdaBlock that applies the lpPool3dBlock activation function
    • lpPool3dBlock

      public static Block lpPool3dBlock(float normType, Shape kernelShape)
      Creates a LambdaBlock that applies the lpPool3dBlock pooling function in its forward function.
      Parameters:
      normType - float value indicating norm
      kernelShape - the shape of the kernel to be used
      Returns:
      the LambdaBlock that applies the lpPool3dBlock activation function
    • globalLpPool1dBlock

      public static Block globalLpPool1dBlock(float normType)
      Creates a LambdaBlock that applies the globalLpPool1d pooling function.
      Parameters:
      normType - float value indicating norm
      Returns:
      the LambdaBlock that applies the globalLpPool1d pooling function
    • globalLpPool2dBlock

      public static Block globalLpPool2dBlock(float normType)
      Creates a LambdaBlock that applies the globalLpPool2d pooling function.
      Parameters:
      normType - float value indicating norm
      Returns:
      the LambdaBlock that applies the globalLpPool2d pooling function
    • globalLpPool3dBlock

      public static Block globalLpPool3dBlock(float normType)
      Creates a LambdaBlock that applies the globalLpPool3d pooling function.
      Parameters:
      normType - float value indicating norm
      Returns:
      the LambdaBlock that applies the globalLpPool3d pooling function