OCR Project
Loading...
Searching...
No Matches
CNNActivations Struct Reference

Intermediate activations produced by the forward pass. More...

#include <cnn.h>

Public Attributes

float input [CNN_IMG_H][CNN_IMG_W]
float conv_out [CNN_N_FILTERS][CNN_CONV_H][CNN_CONV_W]
float pool_out [CNN_N_FILTERS][CNN_POOL_OUT_H][CNN_POOL_OUT_W]
int pool_max_r [CNN_N_FILTERS][CNN_POOL_OUT_H][CNN_POOL_OUT_W]
int pool_max_c [CNN_N_FILTERS][CNN_POOL_OUT_H][CNN_POOL_OUT_W]
float flat [CNN_FLAT_SIZE]
float z1 [CNN_HIDDEN_SIZE]
float h1 [CNN_HIDDEN_SIZE]
float z2 [CNN_N_CLASSES]
float output [CNN_N_CLASSES]

Detailed Description

Intermediate activations produced by the forward pass.

Kept in memory during training so that backward() can reuse them.

Member Data Documentation

◆ conv_out

float CNNActivations::conv_out[CNN_N_FILTERS][CNN_CONV_H][CNN_CONV_W]

Conv output after ReLU: conv_out[filter][row][col].

◆ flat

float CNNActivations::flat[CNN_FLAT_SIZE]

Flattened activations after pooling.

◆ h1

float CNNActivations::h1[CNN_HIDDEN_SIZE]

Hidden layer post-activation (after ReLU).

◆ input

float CNNActivations::input[CNN_IMG_H][CNN_IMG_W]

Normalised input image: input[row][col] ∈ [0, 1].

◆ output

float CNNActivations::output[CNN_N_CLASSES]

Final class probabilities (softmax output).

◆ pool_max_c

int CNNActivations::pool_max_c[CNN_N_FILTERS][CNN_POOL_OUT_H][CNN_POOL_OUT_W]

◆ pool_max_r

int CNNActivations::pool_max_r[CNN_N_FILTERS][CNN_POOL_OUT_H][CNN_POOL_OUT_W]

Row/col of the max element in each pooling window (for backprop). pool_max_r[f][r][c] = row inside the 2×2 window that held the max.

◆ pool_out

float CNNActivations::pool_out[CNN_N_FILTERS][CNN_POOL_OUT_H][CNN_POOL_OUT_W]

Pool output: pool_out[filter][row][col].

◆ z1

float CNNActivations::z1[CNN_HIDDEN_SIZE]

Hidden layer pre-activation (before ReLU).

◆ z2

float CNNActivations::z2[CNN_N_CLASSES]

Output layer pre-softmax.


The documentation for this struct was generated from the following file: