FlexNN 1
Fully connected neural network built from scratch with flexible n-layer design and multiple activations.
Loading...
Searching...
No Matches
BatchNorm1D.hpp File Reference

BatchNorm1D layer for FlexNN::Layers (training stats, aux export). More...

#include <utility>
#include <Eigen/Dense>
#include "LayerTypes.hpp"
#include "../activations/Activation.hpp"
Include dependency graph for BatchNorm1D.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FlexNN::Layers::BatchNorm1D
 

Namespaces

namespace  FlexNN
 Namespace for the FlexNN neural network library.
 
namespace  FlexNN::Layers
 

Detailed Description

BatchNorm1D layer for FlexNN::Layers (training stats, aux export).

Implements per-feature y = gamma*(x - mean)/sqrt(var+eps) + beta where training uses batch stats and predict uses running stats (momentum 0.1). The layer is Activation::None only in v0.1 (export error otherwise). aux blob in model.bin is [gamma, beta, mean, var] each [F] float32.

Why this file: BatchNorm is needed for stable Conv1D training and is folded by the runtime compiler (W_fold = W*gamma/sqrt(var+eps)), but FlexNN still exports it as a separate layer for training correctness.