MaxPoolingLayer<T>

Layers ยท AiDotNet.NeuralNetworks.Layers

Implements a max pooling layer for neural networks, which reduces the spatial dimensions of the input by taking the maximum value in each pooling window.

Inheritance: LayerBase<T> โ†’ MaxPoolingLayer<T>

Implements: IShapeContract

How It Works

For Beginners: A max pooling layer helps reduce the size of data flowing through a neural network while keeping the most important information. It works by dividing the input into small windows (determined by the pool size) and keeping only the largest value from each window.

Think of it like summarizing a detailed picture: instead of describing every pixel, you just point out the most noticeable feature in each area of the image.

This helps the network:

  1. Focus on the most important features
  2. Reduce computation needs
  3. Make the model more robust to small changes in input position

Constructors

Constructor Summary
MaxPoolingLayer(int poolSize, int stride) Creates a new max pooling layer with the specified parameters.

Properties

Property Summary
bool SupportsTraining { get; }
int PoolSize { get; set; } Gets the size of the pooling window.
int Stride { get; set; } Gets the step size when moving the pooling window across the input.

Methods

Method Summary
IEnumerable<ActivationFunction> GetActivationTypes() Returns the activation functions used by this layer.
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank)
int[] GetPoolSize() Indicates whether this layer supports training operations.
int[] GetStride() Gets the stride for the pooling operation.
void ResetState() Resets the internal state of the layer.