Deepity
Ultra-fast, SIMD-accelerated Predictive Coding
Loading...
Searching...
No Matches
ConvPCLayer.h File Reference

Convolutional counterpart to DiscriminativePCLayer. More...

#include <cstdlib>
#include <deepity/layers/Layer.h>
#include <deepity/utils/Activations.h>
#include <deepity/utils/Im2Col.h>
#include <deepity/utils/MemoryArena.h>
#include <map>
#include <memory>
#include <random>
#include <stdexcept>
#include <vector>

Go to the source code of this file.

Classes

class  Deep::ConvPCLayer
 Convolutional Predictive Coding layer (im2col-based). See the file-level warning above before enabling an unclamped middle layer. More...

Namespaces

namespace  Deep
 This file exists to provide both Tensor.h and IComputeBackend.h with device types without introducing circular dependencies.

Detailed Description

Convolutional counterpart to DiscriminativePCLayer.

Warning
CalculateState/UpdateState/UpdateWeights math is implemented in ConvPCLayer.cpp but has ONLY been verified for its weight-gradient path (UpdateWeights(), via finite-difference check with both layers clamped). The Col2Im-based feedback term in UpdateState() has NOT yet been exercised by any test – both layers in the existing gradient check were clamped, so that code path never actually ran. Do not trust the full training loop (unclamped hidden layers) until:
  1. A gradient check with a genuinely UNCLAMPED middle layer passes, exercising the feedback term for real.
  2. A clean ASan/UBSan run on a tiny synthetic ConvPCNetwork.
  3. A synthetic floor test (same pattern as tDiagnose.cpp) passes. Only then wire this into MNIST.

Layout convention: NCHW, row-major, contiguous per channel per batch item.

Note
Single-instance layer; scratch/column buffers are bound into a MemoryArena rather than stored in a container, unlike DiscriminativePCNetwork's vector-of-layers.
Version
1.0
Date
2026-06-30
Author
Jack Rose