# notnot696/deep-neural-network-from-scratch architecture

> Architecture diagram of the GitHub repository notnot696/deep-neural-network-from-scratch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/notnot696/deep-neural-network-from-scratch
- Repository: https://github.com/notnot696/deep-neural-network-from-scratch

## Overview

This repository is a NumPy neural-network library for building, training, and evaluating classifiers. Its principal workflow is to load and prepare a dataset, compose a network, train it, then predict or evaluate and save results. The sampled model directly performs layer passes and uses utility losses and plotting; optimizer, scheduler, and regularizer modules provide additional capabilities, but their integration into training is not shown. Callback and logging behavior is documented and partially visible in `src/utils.py`.

Main entry points: [`src/model.py`](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/model.py) (Neural network), [`src/data_loader.py`](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/data_loader.py) (Iris and image data), [`src/layers.py`](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/layers.py) (Dense and norm layers), [`src/utils.py`](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py) (Training callbacks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_datasets["Iris and image data<br/>[data_loader.py]"]
  node_prep["Encoding and splitting<br/>[utils.py]"]
end

subgraph group_network["Network runtime"]
  node_model["Neural network<br/>[model.py]"]
  node_layers["Dense and norm layers<br/>[layers.py]"]
  node_activations["Activation functions<br/>[activations.py]"]
  node_initializers["Weight initializers<br/>[initializers.py]"]
end

subgraph group_training["Training extensions"]
  node_optimizers["Gradient optimizers<br/>[optimizers.py]"]
  node_schedulers["Learning rate schedules<br/>[schedulers.py]"]
  node_regularizers["Weight regularization<br/>[regularizers.py]"]
  node_callbacks["Training callbacks<br/>[utils.py]"]
end

subgraph group_results["Evaluation and artifacts"]
  node_losses["Losses and metrics<br/>[utils.py]"]
  node_plots["Training plots<br/>[utils.py]"]
  node_logger["Experiment logging<br/>[utils.py]"]
  node_weights["Saved model weights<br/>[model.py]"]
  node_log_files["JSON experiment logs<br/>[utils.py]"]
end

node_user(("Model builder"))
node_data_source["Dataset providers"]
node_filesystem["Local filesystem"]

node_user -->|"requests data"| node_datasets
node_datasets -.->|"fetches dataset"| node_data_source
node_datasets -->|"encodes and splits"| node_prep
node_user -->|"configures and trains"| node_model
node_model -->|"runs forward and backward"| node_layers
node_layers -->|"applies activation"| node_activations
node_layers -->|"initializes weights"| node_initializers
node_model -->|"computes loss and accuracy"| node_losses
node_model -->|"plots training history"| node_plots
node_model -->|"saves or loads"| node_weights
node_user -->|"selects optimizer"| node_optimizers
node_user -->|"selects schedule"| node_schedulers
node_user -->|"uses regularization"| node_regularizers
node_user -->|"uses callbacks"| node_callbacks
node_callbacks -->|"saves checkpoint"| node_model
node_user -->|"records experiment"| node_logger
node_logger -->|"writes JSON"| node_log_files
node_log_files -->|"persists"| node_filesystem
node_weights -->|"persists"| node_filesystem

click node_datasets "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/data_loader.py"
click node_prep "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py"
click node_model "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/model.py"
click node_layers "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/layers.py"
click node_activations "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/activations.py"
click node_initializers "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/initializers.py"
click node_losses "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py"
click node_plots "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py"
click node_optimizers "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/optimizers.py"
click node_schedulers "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/schedulers.py"
click node_regularizers "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/regularizers.py"
click node_callbacks "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py"
click node_logger "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py"
click node_weights "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/model.py"
click node_log_files "https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.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_datasets,node_prep toneBlue
class node_model,node_layers,node_activations,node_initializers toneAmber
class node_optimizers,node_schedulers,node_regularizers,node_callbacks toneMint
class node_losses,node_plots,node_logger,node_weights,node_log_files toneRose
class node_user,node_data_source,node_filesystem toneIndigo
```

## Components

### Data preparation

- [Iris and image data](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/data_loader.py): `src/data_loader.py`
- [Encoding and splitting](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py): `src/utils.py`

### Network runtime

- [Neural network](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/model.py): `src/model.py`
- [Dense and norm layers](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/layers.py): `src/layers.py`
- [Activation functions](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/activations.py): `src/activations.py`
- [Weight initializers](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/initializers.py): `src/initializers.py`

### Training extensions

- [Gradient optimizers](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/optimizers.py): `src/optimizers.py`
- [Learning rate schedules](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/schedulers.py): `src/schedulers.py`
- [Weight regularization](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/regularizers.py): `src/regularizers.py`
- [Training callbacks](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py): `src/utils.py`

### Evaluation and artifacts

- [Losses and metrics](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py): `src/utils.py`
- [Training plots](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py): `src/utils.py`
- [Experiment logging](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py): `src/utils.py`
- [Saved model weights](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/model.py): `src/model.py`
- [JSON experiment logs](https://github.com/notnot696/deep-neural-network-from-scratch/blob/master/src/utils.py): `src/utils.py`

### Other components

- **Model builder**
- **Dataset providers**
- **Local filesystem**

## Connections

- Model builder → Iris and image data: requests data
- Iris and image data → Dataset providers: fetches dataset
- Iris and image data → Encoding and splitting: encodes and splits
- Model builder → Neural network: configures and trains
- Neural network → Dense and norm layers: runs forward and backward
- Dense and norm layers → Activation functions: applies activation
- Dense and norm layers → Weight initializers: initializes weights
- Neural network → Losses and metrics: computes loss and accuracy
- Neural network → Training plots: plots training history
- Neural network → Saved model weights: saves or loads
- Model builder → Gradient optimizers: selects optimizer
- Model builder → Learning rate schedules: selects schedule
- Model builder → Weight regularization: uses regularization
- Model builder → Training callbacks: uses callbacks
- Training callbacks → Neural network: saves checkpoint
- Model builder → Experiment logging: records experiment
- Experiment logging → JSON experiment logs: writes JSON
- JSON experiment logs → Local filesystem: persists
- Saved model weights → Local filesystem: persists
