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

Learnable parameters of the CNN. More...

#include <cnn.h>

Public Attributes

float kernels [CNN_N_FILTERS][CNN_KERNEL_H][CNN_KERNEL_W]
float conv_bias [CNN_N_FILTERS]
float W1 [CNN_HIDDEN_SIZE][CNN_FLAT_SIZE]
float b1 [CNN_HIDDEN_SIZE]
float W2 [CNN_N_CLASSES][CNN_HIDDEN_SIZE]
float b2 [CNN_N_CLASSES]

Detailed Description

Learnable parameters of the CNN.

Laid out flat so that model_save() / model_load() can serialise them with a single fwrite / fread call.

Member Data Documentation

◆ b1

float CNNWeights::b1[CNN_HIDDEN_SIZE]

Dense layer 1 biases.

◆ b2

float CNNWeights::b2[CNN_N_CLASSES]

Dense layer 2 biases.

◆ conv_bias

float CNNWeights::conv_bias[CNN_N_FILTERS]

Conv layer biases, one per filter.

◆ kernels

float CNNWeights::kernels[CNN_N_FILTERS][CNN_KERNEL_H][CNN_KERNEL_W]

Conv layer: kernels[filter][row][col].

◆ W1

float CNNWeights::W1[CNN_HIDDEN_SIZE][CNN_FLAT_SIZE]

Dense layer 1 weights: W1[hidden][flat].

◆ W2

float CNNWeights::W2[CNN_N_CLASSES][CNN_HIDDEN_SIZE]

Dense layer 2 weights: W2[class][hidden].


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