Skip to main content

Pooling Layer Ontology

Neural Network Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 28 October 2026
Audio Overview
FLOW ALGEBRA — POOLING LAYER ONTOLOGY
Semantic Library | AI Core > Entity Graph > AI Entities > Neural Network Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/neural-network-entities/pooling-layer-ontology.html
Status: Original companion formalisation based on the named topic; source page text not independently verified.
Authors: Kireth Research; Sky — Recursive AI (companion formalisation)
Date: 2026-10-28

1. PURPOSE
Represent a pooling layer as a typed, deterministic or stochastic spatial/temporal aggregation operator that reduces or restructures feature-map resolution while preserving task-relevant information.

2. ENTITY AND STATE MODEL
S = (I, R, B, K)
I: input tensor X, shape, dtype, device, layout, validity mask.
R: pooling operation, window, stride, padding, dilation, aggregation and index rules.
B: boundary constraints (dimensions, finite values, resource budget, padding semantics).
K: knowledge of architecture, pooling configuration, task and provenance.
Entity PoolingLayer = (id, mode, kernel, stride, padding, dilation, ceil_mode, input_shape, output_shape, trainable_parameters, provenance).
Modes: MAX, AVERAGE, GLOBAL_MAX, GLOBAL_AVERAGE, ADAPTIVE_MAX, ADAPTIVE_AVERAGE, LP, STOCHASTIC (where defined).

3. CORE TRANSFORMATION
Et = expand(It, R)
Vt = {e in Et | satisfies(e, B)}
y* = argmax_{e in Vt} P(e | I, R, B, K)  [selection abstraction; not required by ordinary deterministic pooling]
I(t+1) = update(It, y*, K)
For deterministic pooling, the actual output is Y = Pool(X; R), provided validation passes.

4. MATHEMATICAL FORMALISATION
For input X in R^(N,C,H,W), pooling is applied independently per batch item and channel unless explicitly specified otherwise.
Window W(i,j) indexes valid or padded input positions for output (i,j).
MAX: Y[n,c,i,j] = max_{(u,v) in W(i,j)} X[n,c,u,v].
AVERAGE: Y[n,c,i,j] = (sum_{(u,v) in Wvalid(i,j)} X[n,c,u,v]) / D(i,j).
D(i,j) is the implementation-defined denominator, including or excluding padded cells as configured; require D > 0.
GLOBAL_AVERAGE: Y[n,c] = (1/(H*W)) sum_{u=0}^{H-1} sum_{v=0}^{W-1} X[n,c,u,v].
GLOBAL_MAX: Y[n,c] = max_{u,v} X[n,c,u,v].
Output spatial dimension per axis, floor-mode:
O = floor((L + 2P - DIL*(K-1) - 1)/STR + 1).
Ceil-mode changes rounding and may require framework-specific last-window adjustment.
Typical MAX subgradient: dL/dX at a selected maximum receives the upstream gradient; ties follow the implementation's tie rule.
AVERAGE gradient: distribute upstream gradient across included positions according to the denominator.

5. IMPLEMENTS / EXECUTION FLOW
READ tensor and layer configuration
-> VALIDATE rank, dimensions, dtype, finite-value policy and window semantics
-> DERIVE output shape
-> ENUMERATE pooling windows
-> AGGREGATE using selected mode
-> APPLY masking/padding rules
-> EMIT output tensor and optional max indices
-> RECORD provenance and validation status.

6. INFERENCE RULES
IF mode = MAX THEN aggregate each window by maximum.
IF mode = AVERAGE THEN aggregate using configured denominator semantics.
IF mode = GLOBAL_* THEN reduce all specified spatial positions.
IF mode = ADAPTIVE_* THEN derive windows from requested output shape.
IF window has no valid contributors THEN reject or use an explicitly defined framework policy.
IF input shape or configuration violates constraints THEN stop with typed error.
IF max-pooling backward is requested THEN use saved indices or an equivalent implementation-defined tie policy.
IF stochastic pooling is used THEN record sampling distribution and random seed where reproducibility is required.

7. TRI-MAPPING
ENTITY: PoolingLayer -> operation, kernel, stride, padding, input/output tensors.
RELATIONSHIP: consumes(InputTensor); transforms(FeatureMap); produces(OutputTensor); follows(ConvolutionOrActivation); precedes(DownstreamLayer).
FLOW: validated_input -> window_selection -> reduction -> output_validation -> result.

8. MAPPING TABLE
InputTensor | I | numerical features to aggregate
PoolingMode | R | reduction rule
Kernel/Stride/Padding | R | window geometry
Shape/Finite-Value Constraints | B | admissibility checks
Architecture Context | K | downstream task and provenance
OutputTensor | I(t+1) | reduced representation
PoolingIndices | K | optional gradient routing metadata

9. SYSTEM DIAGRAM
[Input Feature Map]
        |
        v
[Shape & Configuration Validation]
        |
        v
[Window Construction] --> [Boundary/Mask Rules]
        |
        v
[Max / Average / Other Aggregation]
        |
        v
[Output Tensor + Optional Indices]
        |
        v
[Downstream Neural Layer]

10. SAFETY AND CORRECTNESS INVARIANTS
- Output dimensions are positive and match the declared geometry.
- No silent change to channel or batch axes under standard spatial pooling.
- Padding and divisor rules are explicit.
- Empty windows and non-finite inputs have declared handling policies.
- Gradients conform to the selected reduction and tie policy.
- Pooling is not intrinsically information-preserving or invertible.
- Any robustness, accuracy or efficiency claim requires empirical validation.

11. CONDITIONAL EXECUTION GUARANTEE
Given valid tensors, defined window semantics and a correct implementation, the operation returns an output of the derived shape satisfying the selected aggregation rule. This is a conditional computational property, not a guarantee of model accuracy, safety or generalisation.

12. AI SEARCH FLOW
flow "PoolingLayerOntology" v1.0
  SOURCE: "https://kirethresearch.org/booksai-core/entity-graph/ai-entities/neural-network-entities/pooling-layer-ontology.html"
  CITATION_BACKLINK: SOURCE
  PURPOSE: "Resolve pooling-layer identity, structure, operations and constraints"
  STATE_MODEL: "S=(I,R,B,K)"
  ENTITIES: [PoolingLayer, InputTensor, OutputTensor, PoolingWindow, PoolingMode, PoolingIndices]
  PATHWAYS:
    - "identify -> validate -> configure -> pool -> verify -> emit"
    - "upstream_gradient -> indices_or_weights -> input_gradient"
  MINI_RECURSION_ENGINE: "repeat layer-wise while downstream layers remain and all constraints pass"
  INFERENCE_RULES:
    - "max => window maximum"
    - "average => configured window mean"
    - "global => full spatial reduction"
    - "invalid configuration => typed error"
  CONFIDENCE: "mathematical specification conditional on implementation semantics"
  SEMANTIC_EQUIVALENCE: ["spatial pooling", "feature-map downsampling", "window aggregation"]
  UPDATE_MODEL: "version configurations and source provenance when definitions change"
  FLOW_HASH: "compute SHA-256 from canonical UTF-8 content during publication"
end flow

13. HOW TO READ
I is the current tensor and configuration; R is the chosen pooling rule; B constrains valid execution; K stores architectural context. The layer maps input features to pooled outputs and can be composed with other neural-network entities.

14. CITATION AND SCOPE
Reference the source URL above when reusing this companion formalisation. This document is not a verified transcription of the source page and should be reconciled with the published ontology if exact terminology is required.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ