# lampard7crypt/neuralnet architecture

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

- Interactive diagram: https://gitdiagram.com/lampard7crypt/neuralnet
- Repository: https://github.com/lampard7crypt/neuralnet

## Overview

NeuralNet is a PyTorch CIFAR-10 image-classification project. Its main workflow downloads and prepares the dataset, trains either a baseline CNN or residual network with validation, saves the best checkpoint and training history, then evaluates a checkpoint on the test set and reports metrics with a confusion-matrix visualization. The README also describes notebooks for data exploration, training experiments, and evaluation/inference. Source excerpts support the training and evaluation wiring; notebook behavior is represented from README documentation, not inspected notebook contents.

Main entry points: [`src/train.py`](https://github.com/lampard7crypt/neuralnet/blob/master/src/train.py) (Training command), [`src/evaluate.py`](https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py) (Evaluation command), [`src/dataset.py`](https://github.com/lampard7crypt/neuralnet/blob/master/src/dataset.py) (Dataset loaders), [`src/model.py`](https://github.com/lampard7crypt/neuralnet/blob/master/src/model.py) (Model selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_dataset["Dataset loaders<br/>[dataset.py]"]
  node_train_transform["Augmentation and normalization<br/>[dataset.py]"]
  node_split["Train/validation split<br/>[dataset.py]"]
  node_exploration["Data exploration notebook"]
end

subgraph group_training["Model training"]
  node_train_entry["Training command<br/>[train.py]"]
  node_model_factory["Model selection<br/>[model.py]"]
  node_simple["SimpleCNN baseline<br/>[model.py]"]
  node_resnet["CifarResNet<br/>[model.py]"]
  node_optimization["Optimization loop<br/>[train.py]"]
  node_training_utils["Training utilities<br/>[utils.py]"]
  node_experiments["Training experiments notebook"]
  node_config["Hyperparameter defaults<br/>[config.py]"]
end

subgraph group_evaluation["Evaluation and analysis"]
  node_eval_entry["Evaluation command<br/>[evaluate.py]"]
  node_test_inference["Test-set inference<br/>[evaluate.py]"]
  node_metrics["Classification metrics<br/>[evaluate.py]"]
  node_confusion["Confusion matrix<br/>[evaluate.py]"]
  node_analysis_notebook["Evaluation and inference notebook"]
end

subgraph group_state["Training artifacts"]
  node_checkpoint[("Best checkpoint<br/>[utils.py]")]
  node_history["Training history<br/>[train.py]"]
  node_matrix_output["Confusion-matrix artifact"]
end

node_user(("Researcher"))
node_cifar[("CIFAR-10")]

node_user -->|"starts training"| node_train_entry
node_user -->|"starts evaluation"| node_eval_entry
node_user -->|"explores data"| node_exploration
node_user -->|"runs experiments"| node_experiments
node_user -->|"analyzes predictions"| node_analysis_notebook
node_dataset -->|"downloads"| node_cifar
node_dataset -->|"uses transforms"| node_train_transform
node_dataset -->|"splits training data"| node_split
node_train_entry -->|"gets loaders"| node_dataset
node_train_entry -->|"selects model"| node_model_factory
node_model_factory -->|"creates baseline"| node_simple
node_model_factory -->|"creates residual net"| node_resnet
node_train_entry -->|"runs epochs"| node_optimization
node_train_entry -->|"uses utilities"| node_training_utils
node_train_entry -->|"saves best weights"| node_checkpoint
node_train_entry -->|"exports history"| node_history
node_eval_entry -->|"gets test loader"| node_dataset
node_eval_entry -->|"selects model"| node_model_factory
node_eval_entry -->|"loads checkpoint"| node_training_utils
node_eval_entry -->|"reads weights"| node_checkpoint
node_eval_entry -->|"runs evaluation"| node_test_inference
node_test_inference -->|"reports results"| node_metrics
node_test_inference -->|"computes matrix"| node_confusion
node_confusion -->|"saves plot"| node_matrix_output

click node_dataset "https://github.com/lampard7crypt/neuralnet/blob/master/src/dataset.py"
click node_train_transform "https://github.com/lampard7crypt/neuralnet/blob/master/src/dataset.py"
click node_split "https://github.com/lampard7crypt/neuralnet/blob/master/src/dataset.py"
click node_train_entry "https://github.com/lampard7crypt/neuralnet/blob/master/src/train.py"
click node_model_factory "https://github.com/lampard7crypt/neuralnet/blob/master/src/model.py"
click node_simple "https://github.com/lampard7crypt/neuralnet/blob/master/src/model.py"
click node_resnet "https://github.com/lampard7crypt/neuralnet/blob/master/src/model.py"
click node_optimization "https://github.com/lampard7crypt/neuralnet/blob/master/src/train.py"
click node_training_utils "https://github.com/lampard7crypt/neuralnet/blob/master/src/utils.py"
click node_checkpoint "https://github.com/lampard7crypt/neuralnet/blob/master/src/utils.py"
click node_history "https://github.com/lampard7crypt/neuralnet/blob/master/src/train.py"
click node_eval_entry "https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py"
click node_test_inference "https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py"
click node_metrics "https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py"
click node_confusion "https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py"
click node_matrix_output "https://github.com/lampard7crypt/neuralnet/tree/master/outputs"
click node_exploration "https://github.com/lampard7crypt/neuralnet/blob/master/notebooks/01_data_exploration.ipynb"
click node_experiments "https://github.com/lampard7crypt/neuralnet/blob/master/notebooks/02_training_experiments.ipynb"
click node_analysis_notebook "https://github.com/lampard7crypt/neuralnet/blob/master/notebooks/03_evaluation_and_inference.ipynb"
click node_config "https://github.com/lampard7crypt/neuralnet/blob/master/src/config.py"

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_dataset,node_train_transform,node_split,node_exploration toneBlue
class node_train_entry,node_model_factory,node_simple,node_resnet,node_optimization,node_training_utils,node_experiments,node_config,node_cifar toneAmber
class node_eval_entry,node_test_inference,node_metrics,node_confusion,node_analysis_notebook toneMint
class node_checkpoint,node_history,node_matrix_output toneRose
class node_user toneIndigo
```

## Components

### Data preparation

- [Dataset loaders](https://github.com/lampard7crypt/neuralnet/blob/master/src/dataset.py): `src/dataset.py`
- [Augmentation and normalization](https://github.com/lampard7crypt/neuralnet/blob/master/src/dataset.py): `src/dataset.py`
- [Train/validation split](https://github.com/lampard7crypt/neuralnet/blob/master/src/dataset.py): `src/dataset.py`
- [Data exploration notebook](https://github.com/lampard7crypt/neuralnet/blob/master/notebooks/01_data_exploration.ipynb): `notebooks/01_data_exploration.ipynb`

### Model training

- [Training command](https://github.com/lampard7crypt/neuralnet/blob/master/src/train.py): `src/train.py`
- [Model selection](https://github.com/lampard7crypt/neuralnet/blob/master/src/model.py): `src/model.py`
- [SimpleCNN baseline](https://github.com/lampard7crypt/neuralnet/blob/master/src/model.py): `src/model.py`
- [CifarResNet](https://github.com/lampard7crypt/neuralnet/blob/master/src/model.py): `src/model.py`
- [Optimization loop](https://github.com/lampard7crypt/neuralnet/blob/master/src/train.py): `src/train.py`
- [Training utilities](https://github.com/lampard7crypt/neuralnet/blob/master/src/utils.py): `src/utils.py`
- [Training experiments notebook](https://github.com/lampard7crypt/neuralnet/blob/master/notebooks/02_training_experiments.ipynb): `notebooks/02_training_experiments.ipynb`
- [Hyperparameter defaults](https://github.com/lampard7crypt/neuralnet/blob/master/src/config.py): `src/config.py`

### Evaluation and analysis

- [Evaluation command](https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py): `src/evaluate.py`
- [Test-set inference](https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py): `src/evaluate.py`
- [Classification metrics](https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py): `src/evaluate.py`
- [Confusion matrix](https://github.com/lampard7crypt/neuralnet/blob/master/src/evaluate.py): `src/evaluate.py`
- [Evaluation and inference notebook](https://github.com/lampard7crypt/neuralnet/blob/master/notebooks/03_evaluation_and_inference.ipynb): `notebooks/03_evaluation_and_inference.ipynb`

### Training artifacts

- [Best checkpoint](https://github.com/lampard7crypt/neuralnet/blob/master/src/utils.py): `src/utils.py`
- [Training history](https://github.com/lampard7crypt/neuralnet/blob/master/src/train.py): `src/train.py`
- [Confusion-matrix artifact](https://github.com/lampard7crypt/neuralnet/tree/master/outputs): `outputs`

### Other components

- **Researcher**
- **CIFAR-10**

## Connections

- Researcher → Training command: starts training (evidence: `README.md`)
- Researcher → Evaluation command: starts evaluation (evidence: `README.md`)
- Researcher → Data exploration notebook: explores data (evidence: `README.md`)
- Researcher → Training experiments notebook: runs experiments (evidence: `README.md`)
- Researcher → Evaluation and inference notebook: analyzes predictions (evidence: `README.md`)
- Dataset loaders → CIFAR-10: downloads (evidence: `src/dataset.py`)
- Dataset loaders → Augmentation and normalization: uses transforms (evidence: `src/dataset.py`)
- Dataset loaders → Train/validation split: splits training data (evidence: `src/dataset.py`)
- Training command → Dataset loaders: gets loaders (evidence: `src/train.py`)
- Training command → Model selection: selects model (evidence: `src/train.py`)
- Model selection → SimpleCNN baseline: creates baseline (evidence: `src/model.py`)
- Model selection → CifarResNet: creates residual net (evidence: `src/model.py`)
- Training command → Optimization loop: runs epochs (evidence: `src/train.py`)
- Training command → Training utilities: uses utilities (evidence: `src/train.py`)
- Training command → Best checkpoint: saves best weights (evidence: `src/train.py`)
- Training command → Training history: exports history (evidence: `src/train.py`)
- Evaluation command → Dataset loaders: gets test loader (evidence: `src/evaluate.py`)
- Evaluation command → Model selection: selects model (evidence: `src/evaluate.py`)
- Evaluation command → Training utilities: loads checkpoint (evidence: `src/evaluate.py`)
- Evaluation command → Best checkpoint: reads weights (evidence: `src/evaluate.py`)
- Evaluation command → Test-set inference: runs evaluation (evidence: `src/evaluate.py`)
- Test-set inference → Classification metrics: reports results (evidence: `src/evaluate.py`)
- Test-set inference → Confusion matrix: computes matrix (evidence: `src/evaluate.py`)
- Confusion matrix → Confusion-matrix artifact: saves plot (evidence: `src/evaluate.py`)
