MaxPool2d

class MaxPool2d<T : DType, V> @JvmOverloads constructor(val kernelSize: Pair<Int, Int>, val stride: Pair<Int, Int> = kernelSize, val padding: Pair<Int, Int> = 0 to 0, val name: String = "MaxPool2d") : Module<T, V> (source)

2D Max Pooling layer that applies a max pooling operation over 2D input.

Max pooling reduces the spatial dimensions of the input by taking the maximum value in each pooling window.

Parameters

kernelSize

Size of the pooling window (height, width)

stride

Stride of the pooling operation (default: same as kernelSize)

padding

Padding added to all sides of the input (default: 0, 0)

name

Name of the module

Constructors

Link copied to clipboard
constructor(kernelSize: Pair<Int, Int>, stride: Pair<Int, Int> = kernelSize, padding: Pair<Int, Int> = 0 to 0, name: String = "MaxPool2d")

Properties

Link copied to clipboard
Link copied to clipboard
open override val modules: List<Module<T, V>>
Link copied to clipboard
open override val name: String
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun forward(input: Tensor<T, V>, ctx: ExecutionContext): Tensor<T, V>
Link copied to clipboard
fun outputSize(inputSize: Pair<Int, Int>): Pair<Int, Int>

Calculates the output size for a given input size and pooling parameters.