# mahirahmed521/building-my-own-neural-net-from-scratch architecture

> Architecture diagram of the GitHub repository mahirahmed521/building-my-own-neural-net-from-scratch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahirahmed521/building-my-own-neural-net-from-scratch
- Repository: https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch

## Overview

This repository is an educational feedforward neural network implemented in a single notebook. Its documented workflow trains a 3–4–1 sigmoid network on a simple logical pattern: forward propagation produces predictions, MSE measures error, and backpropagation computes gradients for gradient-descent updates. After 5,000 epochs, the trained network predicts the result for an unseen input. The README documents these stages and relationships; no notebook source excerpts were available to verify implementation details.

Main entry points: [`building-my-own-neural-net-from-scratch.ipynb`](https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb) (Training loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_training["Training loop"]
node_forward["Forward propagation"]
node_loss["MSE loss"]
node_backprop["Backpropagation"]
node_updates["Gradient descent"]
node_test["Test prediction"]

node_user -->|"runs training"| node_training
node_training -->|"passes inputs"| node_forward
node_forward -->|"produces predictions"| node_loss
node_loss -->|"provides error"| node_backprop
node_backprop -->|"computes gradients"| node_updates
node_updates -->|"adjusts weights"| node_training
node_training -->|"tests trained network"| node_test

click node_training "https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb"
click node_forward "https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb"
click node_loss "https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb"
click node_backprop "https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb"
click node_updates "https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb"
click node_test "https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb"

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_user toneBlue
class node_training,node_forward,node_loss,node_backprop,node_updates,node_test toneTeal
```

## Components

### Other components

- **User**
- [Training loop](https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb): `building-my-own-neural-net-from-scratch.ipynb`
- [Forward propagation](https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb): `building-my-own-neural-net-from-scratch.ipynb`
- [MSE loss](https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb): `building-my-own-neural-net-from-scratch.ipynb`
- [Backpropagation](https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb): `building-my-own-neural-net-from-scratch.ipynb`
- [Gradient descent](https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb): `building-my-own-neural-net-from-scratch.ipynb`
- [Test prediction](https://github.com/mahirahmed521/building-my-own-neural-net-from-scratch/blob/main/building-my-own-neural-net-from-scratch.ipynb): `building-my-own-neural-net-from-scratch.ipynb`

## Connections

- User → Training loop: runs training (evidence: `README.md`)
- Training loop → Forward propagation: passes inputs (evidence: `README.md`)
- Forward propagation → MSE loss: produces predictions (evidence: `README.md`)
- MSE loss → Backpropagation: provides error (evidence: `README.md`)
- Backpropagation → Gradient descent: computes gradients (evidence: `README.md`)
- Gradient descent → Training loop: adjusts weights (evidence: `README.md`)
- Training loop → Test prediction: tests trained network (evidence: `README.md`)
