# xchereau/mapetiteia architecture

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

- Interactive diagram: https://gitdiagram.com/xchereau/mapetiteia
- Repository: https://github.com/xchereau/mapetiteia

## Overview

MAPETITEIA is a small MNIST neural-network evaluation program. Its main workflow loads the bundled image and label data, initializes a randomly weighted network, copies its parameters into matrices, and computes performance on the test set. The CUDA implementation is present in the tree but was not excerpted, so its internal execution details are not shown.

Main entry points: [`main.c`](https://github.com/xchereau/mapetiteia/blob/main/main.c) (Application entry), [`get_mnist_data/get_mnist_vector.c`](https://github.com/xchereau/mapetiteia/blob/main/get_mnist_data/get_mnist_vector.c) (Dataset loading and display), [`neural_network/neural_types.c`](https://github.com/xchereau/mapetiteia/blob/main/neural_network/neural_types.c) (Network allocation), [`get_weight_bias_matrix/get_matrix.c`](https://github.com/xchereau/mapetiteia/blob/main/get_weight_bias_matrix/get_matrix.c) (Weight and bias matrices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["MNIST input"]
  node_mnist_files["MNIST binaries"]
  node_mnist_io["Dataset loading and display<br/>[get_mnist_vector.c]"]
end

subgraph group_model["Network model"]
  node_network_types["Network allocation<br/>[neural_types.c]"]
  node_network_struct["Network data types<br/>[neural_types.h]"]
  node_parameter_matrices["Weight and bias matrices<br/>[get_matrix.c]"]
end

subgraph group_evaluation["Evaluation"]
  node_entry["Application entry<br/>[main.c]"]
  node_performance["Performance computation"]
end

node_user(("Program user"))

node_user -->|"runs"| node_entry
node_entry -->|"loads and displays"| node_mnist_io
node_entry -->|"selects data files"| node_mnist_files
node_mnist_io -->|"reads"| node_mnist_files
node_entry -->|"initializes and frees"| node_network_types
node_network_types -->|"implements"| node_network_struct
node_entry -->|"allocates from network"| node_parameter_matrices
node_parameter_matrices -->|"copies parameters"| node_network_struct
node_entry -->|"computes test performance"| node_performance

click node_entry "https://github.com/xchereau/mapetiteia/blob/main/main.c"
click node_mnist_files "https://github.com/xchereau/mapetiteia/tree/main/get_mnist_data"
click node_mnist_io "https://github.com/xchereau/mapetiteia/blob/main/get_mnist_data/get_mnist_vector.c"
click node_network_types "https://github.com/xchereau/mapetiteia/blob/main/neural_network/neural_types.c"
click node_network_struct "https://github.com/xchereau/mapetiteia/blob/main/neural_network/neural_types.h"
click node_parameter_matrices "https://github.com/xchereau/mapetiteia/blob/main/get_weight_bias_matrix/get_matrix.c"
click node_performance "https://github.com/xchereau/mapetiteia/blob/main/neural_network/compute_neural_network.cu"

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_mnist_files,node_mnist_io,node_user toneBlue
class node_network_types,node_network_struct,node_parameter_matrices toneAmber
class node_entry,node_performance toneMint
```

## Components

### MNIST input

- [MNIST binaries](https://github.com/xchereau/mapetiteia/tree/main/get_mnist_data): `get_mnist_data`
- [Dataset loading and display](https://github.com/xchereau/mapetiteia/blob/main/get_mnist_data/get_mnist_vector.c): `get_mnist_data/get_mnist_vector.c`

### Network model

- [Network allocation](https://github.com/xchereau/mapetiteia/blob/main/neural_network/neural_types.c): `neural_network/neural_types.c`
- [Network data types](https://github.com/xchereau/mapetiteia/blob/main/neural_network/neural_types.h): `neural_network/neural_types.h`
- [Weight and bias matrices](https://github.com/xchereau/mapetiteia/blob/main/get_weight_bias_matrix/get_matrix.c): `get_weight_bias_matrix/get_matrix.c`

### Evaluation

- [Application entry](https://github.com/xchereau/mapetiteia/blob/main/main.c): `main.c`
- [Performance computation](https://github.com/xchereau/mapetiteia/blob/main/neural_network/compute_neural_network.cu): `neural_network/compute_neural_network.cu`

### Other components

- **Program user**

## Connections

- Program user → Application entry: runs
- Application entry → Dataset loading and display: loads and displays (evidence: `main.c`)
- Application entry → MNIST binaries: selects data files (evidence: `main.c`)
- Dataset loading and display → MNIST binaries: reads (evidence: `get_mnist_data/get_mnist_vector.c`)
- Application entry → Network allocation: initializes and frees (evidence: `main.c`)
- Network allocation → Network data types: implements (evidence: `neural_network/neural_types.c`)
- Application entry → Weight and bias matrices: allocates from network (evidence: `main.c`)
- Weight and bias matrices → Network data types: copies parameters (evidence: `get_weight_bias_matrix/get_matrix.c`)
- Application entry → Performance computation: computes test performance (evidence: `main.c`)
