# adlerzz/nnts architecture

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

- Interactive diagram: https://gitdiagram.com/adlerzz/nnts
- Repository: https://github.com/adlerzz/nnts

## Overview

This is a small TypeScript neural-network demo with vector and matrix primitives. Its intended workflow is to train a network on a small dataset, then evaluate inputs; that training and evaluation loop is commented out. As currently written, execution only creates and prints a vector. Network behavior and its supporting math are all in src/main.ts, so the graph separates those responsibilities without implying they are separate modules.

Main entry points: [`src/main.ts`](https://github.com/adlerzz/nnts/blob/main/src/main.ts) (Main entry), [`src/models.ts`](https://github.com/adlerzz/nnts/blob/main/src/models.ts) (Vector and matrix)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_runtime(("Program runtime"))
node_entry["Main entry<br/>[main.ts]"]
node_dataset["Training dataset<br/>[main.ts]"]
node_training["Training loop<br/>[main.ts]"]
node_network["Neural network<br/>[main.ts]"]
node_math["Network math<br/>[main.ts]"]
node_tensors["Vector and matrix<br/>[models.ts]"]
node_console(("Console output"))

node_runtime -->|"runs"| node_entry
node_entry -->|"imports"| node_tensors
node_entry -->|"defines"| node_dataset
node_entry -->|"defines"| node_training
node_training -.->|"iterates"| node_dataset
node_training -.->|"trains"| node_network
node_network -->|"uses"| node_tensors
node_network -->|"calls"| node_math
node_entry -->|"creates"| node_tensors
node_entry -->|"prints"| node_console

click node_entry "https://github.com/adlerzz/nnts/blob/main/src/main.ts"
click node_dataset "https://github.com/adlerzz/nnts/blob/main/src/main.ts"
click node_training "https://github.com/adlerzz/nnts/blob/main/src/main.ts"
click node_network "https://github.com/adlerzz/nnts/blob/main/src/main.ts"
click node_math "https://github.com/adlerzz/nnts/blob/main/src/main.ts"
click node_tensors "https://github.com/adlerzz/nnts/blob/main/src/models.ts"

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_runtime,node_console toneIndigo
class node_entry,node_dataset,node_training,node_network,node_math,node_tensors toneTeal
```

## Components

### Other components

- **Program runtime**
- [Main entry](https://github.com/adlerzz/nnts/blob/main/src/main.ts): `src/main.ts`
- [Training dataset](https://github.com/adlerzz/nnts/blob/main/src/main.ts): `src/main.ts`
- [Training loop](https://github.com/adlerzz/nnts/blob/main/src/main.ts): `src/main.ts`
- [Neural network](https://github.com/adlerzz/nnts/blob/main/src/main.ts): `src/main.ts`
- [Network math](https://github.com/adlerzz/nnts/blob/main/src/main.ts): `src/main.ts`
- [Vector and matrix](https://github.com/adlerzz/nnts/blob/main/src/models.ts): `src/models.ts`
- **Console output**

## Connections

- Program runtime → Main entry: runs
- Main entry → Vector and matrix: imports (evidence: `src/main.ts`)
- Main entry → Training dataset: defines (evidence: `src/main.ts`)
- Main entry → Training loop: defines (evidence: `src/main.ts`)
- Training loop → Training dataset: iterates (evidence: `src/main.ts`)
- Training loop → Neural network: trains (evidence: `src/main.ts`)
- Neural network → Vector and matrix: uses (evidence: `src/main.ts`)
- Neural network → Network math: calls (evidence: `src/main.ts`)
- Main entry → Vector and matrix: creates (evidence: `src/main.ts`)
- Main entry → Console output: prints (evidence: `src/main.ts`)
