# sonicallgamexgit/ee_ee architecture

> Architecture diagram of the GitHub repository sonicallgamexgit/ee_ee, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sonicallgamexgit/ee_ee
- Repository: https://github.com/sonicallgamexgit/ee_ee

## Overview

This repository implements a small MNIST digit-classification program using a handwritten feed-forward neural network. Its principal workflow loads training images and labels, optionally augments images, trains the network, saves its parameters, then loads the model and evaluates it on test data. The graph separates dataset decoding, application workflow, and neural-network/model handling. Source excerpts show these calls directly; no README description is available, and the build currently selects a drawing test rather than src/main.cpp, so the graph describes the workflow implemented in that source file.

Main entry points: [`src/main.cpp`](https://github.com/sonicallgamexgit/ee_ee/blob/master/src/main.cpp) (Train and test), [`include/network.hpp`](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/network.hpp) (Model persistence), [`include/mnist/mnist.hpp`](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/mnist/mnist.hpp) (Image loader), [`assets/mnist/improved_network.dat`](https://github.com/sonicallgamexgit/ee_ee/blob/master/assets/mnist/improved_network.dat) (Saved model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["MNIST workflow"]
  node_app["Train and test<br/>[main.cpp]"]
  node_augment["Image augmentation<br/>[image.hpp]"]
end

subgraph group_data["Dataset decoding"]
  node_image_reader["Image loader<br/>[mnist.hpp]"]
  node_label_reader["Label loader<br/>[mnist.hpp]"]
  node_byte_decode["Byte conversion<br/>[bytes.hpp]"]
  node_train_data["MNIST datasets"]
end

subgraph group_model["Network and model"]
  node_network["Neural network<br/>[network.hpp]"]
  node_training_update["Backpropagation<br/>[network.hpp]"]
  node_model_io["Model persistence<br/>[network.hpp]"]
  node_model_file["Saved model"]
end

node_user(("Program user"))

node_user -->|"runs"| node_app
node_app -->|"loads images"| node_image_reader
node_app -->|"loads labels"| node_label_reader
node_image_reader -->|"reads image files"| node_train_data
node_label_reader -->|"reads label files"| node_train_data
node_image_reader -->|"converts headers"| node_byte_decode
node_label_reader -->|"converts headers"| node_byte_decode
node_app -->|"augments training images"| node_augment
node_app -->|"runs forward pass"| node_network
node_app -->|"updates weights"| node_training_update
node_app -->|"saves trained model"| node_model_io
node_model_io -->|"writes parameters"| node_model_file
node_app -->|"loads model"| node_model_io
node_model_file -->|"supplies parameters"| node_model_io
node_app -->|"evaluates test images"| node_network

click node_app "https://github.com/sonicallgamexgit/ee_ee/blob/master/src/main.cpp"
click node_augment "https://github.com/sonicallgamexgit/ee_ee/blob/master/include/util/image.hpp"
click node_image_reader "https://github.com/sonicallgamexgit/ee_ee/blob/master/include/mnist/mnist.hpp"
click node_label_reader "https://github.com/sonicallgamexgit/ee_ee/blob/master/include/mnist/mnist.hpp"
click node_byte_decode "https://github.com/sonicallgamexgit/ee_ee/blob/master/include/util/bytes.hpp"
click node_train_data "https://github.com/sonicallgamexgit/ee_ee/tree/master/assets/mnist"
click node_network "https://github.com/sonicallgamexgit/ee_ee/blob/master/include/network.hpp"
click node_training_update "https://github.com/sonicallgamexgit/ee_ee/blob/master/include/network.hpp"
click node_model_io "https://github.com/sonicallgamexgit/ee_ee/blob/master/include/network.hpp"
click node_model_file "https://github.com/sonicallgamexgit/ee_ee/blob/master/assets/mnist/improved_network.dat"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_augment,node_user toneBlue
class node_image_reader,node_label_reader,node_byte_decode,node_train_data toneAmber
class node_network,node_training_update,node_model_io,node_model_file toneMint
```

## Components

### MNIST workflow

- [Train and test](https://github.com/sonicallgamexgit/ee_ee/blob/master/src/main.cpp): `src/main.cpp`
- [Image augmentation](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/util/image.hpp): `include/util/image.hpp`

### Dataset decoding

- [Image loader](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/mnist/mnist.hpp): `include/mnist/mnist.hpp`
- [Label loader](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/mnist/mnist.hpp): `include/mnist/mnist.hpp`
- [Byte conversion](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/util/bytes.hpp): `include/util/bytes.hpp`
- [MNIST datasets](https://github.com/sonicallgamexgit/ee_ee/tree/master/assets/mnist): `assets/mnist`

### Network and model

- [Neural network](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/network.hpp): `include/network.hpp`
- [Backpropagation](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/network.hpp): `include/network.hpp`
- [Model persistence](https://github.com/sonicallgamexgit/ee_ee/blob/master/include/network.hpp): `include/network.hpp`
- [Saved model](https://github.com/sonicallgamexgit/ee_ee/blob/master/assets/mnist/improved_network.dat): `assets/mnist/improved_network.dat`

### Other components

- **Program user**

## Connections

- Program user → Train and test: runs (evidence: `src/main.cpp`)
- Train and test → Image loader: loads images (evidence: `src/main.cpp`)
- Train and test → Label loader: loads labels (evidence: `src/main.cpp`)
- Image loader → MNIST datasets: reads image files
- Label loader → MNIST datasets: reads label files
- Image loader → Byte conversion: converts headers (evidence: `include/mnist/mnist.hpp`)
- Label loader → Byte conversion: converts headers (evidence: `include/mnist/mnist.hpp`)
- Train and test → Image augmentation: augments training images (evidence: `src/main.cpp`)
- Train and test → Neural network: runs forward pass (evidence: `src/main.cpp`)
- Train and test → Backpropagation: updates weights (evidence: `src/main.cpp`)
- Train and test → Model persistence: saves trained model (evidence: `src/main.cpp`)
- Model persistence → Saved model: writes parameters
- Train and test → Model persistence: loads model (evidence: `src/main.cpp`)
- Saved model → Model persistence: supplies parameters
- Train and test → Neural network: evaluates test images (evidence: `src/main.cpp`)
