Edge AI / PyTorch to C++

Manual PyTorch training to a C++ tensor loader

Trace the network, weight by weight.

A compact MLP is trained with an explicit forward pass, BCE loss, backpropagation, and gradient descent. Its learned tensors are exported for a C++ loader; the full C++ forward pass and int8 quantization remain deployment targets.

7-12-8-1MLP architecture
1200manual epochs
188learned weights

Pipeline

01Normalize

Clean tabular inputs and freeze train-set mean/std for test parity.

02Train

Manual tensor math, sigmoid output, BCE loss, and gradient updates.

03Export

Weights and biases are written into plain text files for C++ loading.

04Load

The C++ path currently reads the first exported weight matrix.

This trace visualizes the implemented training and export stages. C++ inference parity and int8 arithmetic are explicitly marked as work in progress.

Illustrative training curves

These curves are generated from example formulas, not recorded training runs. The displayed loss and accuracy are illustrative, not evaluation results.

Example loss
--
Example accuracy
--
Exported weights
--