# stallker202/irisneuralnet architecture

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

- Interactive diagram: https://gitdiagram.com/stallker202/irisneuralnet
- Repository: https://github.com/stallker202/irisneuralnet

## Overview

IrisNeuralNet is a dependency-free C# neural-network engine for Iris classification, paired with a WinForms/console lab for training and experiments. The main user flow loads Iris CSV data, splits and normalizes it, trains and evaluates a configurable network, then presents metrics and visualizations or saves/loads a model. README-documented sweep and visualization capabilities are included; some Lab wiring is supported by the SOURCE INDEX and README rather than inspected implementation excerpts.

Main entry points: [`IrisNeuralNet.Lab/Program.cs`](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/Program.cs) (Lab entry point), [`IrisNeuralNet.Lab/LabForm.cs`](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/LabForm.cs) (Lab interface), [`IrisNeuralNet/Core/Trainer.cs`](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/Trainer.cs) (Trainer), [`IrisNeuralNet.Lab/TrainingSession.cs`](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/TrainingSession.cs) (Training session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_loader["CSV loader<br/>[IrisDataLoader.cs]"]
  node_dataset["Iris dataset<br/>[IrisDataset.cs]"]
  node_splitter["Dataset split<br/>[DatasetSplitter.cs]"]
  node_normalizer["Feature scaling"]
  node_encoder["Label encoding<br/>[OneHotEncoder.cs]"]
end

subgraph group_engine["Neural engine"]
  node_network["Neural network<br/>[NeuralNetwork.cs]"]
  node_factory["Network factory<br/>[NetworkFactory.cs]"]
  node_dense["Dense layer<br/>[DenseLayer.cs]"]
  node_activation["Activations"]
  node_loss["Cross-entropy loss"]
  node_trainer["Trainer<br/>[Trainer.cs]"]
  node_optimizer["Adam optimizer<br/>[AdamOptimizer.cs]"]
  node_simd["SIMD operations<br/>[VectorOps.cs]"]
  node_guard["Span validation<br/>[SpanGuard.cs]"]
  node_pca["PCA projection<br/>[Pca2D.cs]"]
  node_model_file["Model serialization<br/>[ModelFile.cs]"]
end

subgraph group_diagnostics["Training diagnostics"]
  node_metrics["Epoch metrics<br/>[EpochMetrics.cs]"]
  node_observer["Observer contract"]
  node_ring["Metrics ring<br/>[MetricsRing.cs]"]
end

subgraph group_lab["Lab and experiments"]
  node_session["Training session<br/>[TrainingSession.cs]"]
  node_entry["Lab entry point<br/>[Program.cs]"]
  node_form["Lab interface<br/>[LabForm.cs]"]
  node_charts["Training charts<br/>[ChartPainter.cs]"]
  node_topology["Topology view<br/>[TopologyView.cs]"]
  node_boundary["Decision boundary"]
  node_sweep["Architecture sweeps<br/>[SweepRunner.cs]"]
end

node_user(("Lab user"))
node_iris_csv["Iris CSV"]
node_model_storage["Model file"]

node_user -->|"starts"| node_entry
node_entry -->|"loads"| node_loader
node_iris_csv -->|"provides rows"| node_loader
node_loader -->|"creates"| node_dataset
node_entry -->|"splits"| node_splitter
node_entry -->|"fits and applies"| node_normalizer
node_entry -->|"encodes labels"| node_encoder
node_entry -->|"creates"| node_session
node_session -->|"builds network"| node_factory
node_factory -->|"creates"| node_network
node_network -->|"runs layers"| node_dense
node_dense -->|"applies"| node_activation
node_dense -->|"computes with"| node_simd
node_simd -->|"validates spans"| node_guard
node_session -->|"runs"| node_trainer
node_trainer -->|"forwards and backpropagates"| node_network
node_trainer -->|"computes gradients"| node_loss
node_trainer -->|"updates parameters"| node_optimizer
node_optimizer -->|"updates weights"| node_dense
node_trainer -->|"emits epoch results"| node_metrics
node_trainer -->|"notifies"| node_observer
node_session -->|"supplies observer"| node_ring
node_observer -->|"receives"| node_metrics
node_ring -->|"stores"| node_metrics
node_entry -->|"opens UI"| node_form
node_form -->|"controls training"| node_session
node_form -->|"renders metrics"| node_charts
node_form -->|"shows topology"| node_topology
node_form -->|"shows boundaries"| node_boundary
node_form -.->|"runs experiments"| node_sweep
node_form -->|"projects features"| node_pca
node_entry -->|"loads or saves"| node_model_file
node_model_file -->|"reads and writes"| node_model_storage
node_model_file -->|"restores network"| node_network
node_model_file -->|"persists scaling"| node_normalizer

click node_loader "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/IrisDataLoader.cs"
click node_dataset "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/IrisDataset.cs"
click node_splitter "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/DatasetSplitter.cs"
click node_normalizer "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/FeatureNormalizer.cs"
click node_encoder "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/OneHotEncoder.cs"
click node_network "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/NeuralNetwork.cs"
click node_factory "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/NetworkFactory.cs"
click node_dense "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/DenseLayer.cs"
click node_activation "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/ActivationFunction.cs"
click node_loss "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/CategoricalCrossEntropyLoss.cs"
click node_trainer "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/Trainer.cs"
click node_optimizer "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Optimizers/AdamOptimizer.cs"
click node_simd "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/MathCore/VectorOps.cs"
click node_guard "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/MathCore/SpanGuard.cs"
click node_metrics "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Diagnostics/EpochMetrics.cs"
click node_observer "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Diagnostics/ITrainingObserver.cs"
click node_ring "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Diagnostics/MetricsRing.cs"
click node_session "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/TrainingSession.cs"
click node_entry "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/Program.cs"
click node_form "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/LabForm.cs"
click node_charts "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/ChartPainter.cs"
click node_topology "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/TopologyView.cs"
click node_boundary "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/DecisionBoundaryView.cs"
click node_sweep "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/SweepRunner.cs"
click node_pca "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/MathCore/Pca2D.cs"
click node_model_file "https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/ModelFile.cs"

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_loader,node_dataset,node_splitter,node_normalizer,node_encoder,node_user toneBlue
class node_network,node_factory,node_dense,node_activation,node_loss,node_trainer,node_optimizer,node_simd,node_guard,node_pca,node_model_file toneAmber
class node_metrics,node_observer,node_ring toneMint
class node_session,node_entry,node_form,node_charts,node_topology,node_boundary,node_sweep toneRose
class node_iris_csv,node_model_storage toneIndigo
```

## Components

### Data preparation

- [CSV loader](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/IrisDataLoader.cs): `IrisNeuralNet/Data/IrisDataLoader.cs`
- [Iris dataset](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/IrisDataset.cs): `IrisNeuralNet/Data/IrisDataset.cs`
- [Dataset split](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/DatasetSplitter.cs): `IrisNeuralNet/Data/DatasetSplitter.cs`
- [Feature scaling](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/FeatureNormalizer.cs): `IrisNeuralNet/Data/FeatureNormalizer.cs`
- [Label encoding](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Data/OneHotEncoder.cs): `IrisNeuralNet/Data/OneHotEncoder.cs`

### Neural engine

- [Neural network](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/NeuralNetwork.cs): `IrisNeuralNet/Core/NeuralNetwork.cs`
- [Network factory](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/NetworkFactory.cs): `IrisNeuralNet/Core/NetworkFactory.cs`
- [Dense layer](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/DenseLayer.cs): `IrisNeuralNet/Core/DenseLayer.cs`
- [Activations](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/ActivationFunction.cs): `IrisNeuralNet/Core/ActivationFunction.cs`
- [Cross-entropy loss](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/CategoricalCrossEntropyLoss.cs): `IrisNeuralNet/Core/CategoricalCrossEntropyLoss.cs`
- [Trainer](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/Trainer.cs): `IrisNeuralNet/Core/Trainer.cs`
- [Adam optimizer](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Optimizers/AdamOptimizer.cs): `IrisNeuralNet/Optimizers/AdamOptimizer.cs`
- [SIMD operations](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/MathCore/VectorOps.cs): `IrisNeuralNet/MathCore/VectorOps.cs`
- [Span validation](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/MathCore/SpanGuard.cs): `IrisNeuralNet/MathCore/SpanGuard.cs`
- [PCA projection](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/MathCore/Pca2D.cs): `IrisNeuralNet/MathCore/Pca2D.cs`
- [Model serialization](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Core/ModelFile.cs): `IrisNeuralNet/Core/ModelFile.cs`

### Training diagnostics

- [Epoch metrics](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Diagnostics/EpochMetrics.cs): `IrisNeuralNet/Diagnostics/EpochMetrics.cs`
- [Observer contract](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Diagnostics/ITrainingObserver.cs): `IrisNeuralNet/Diagnostics/ITrainingObserver.cs`
- [Metrics ring](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet/Diagnostics/MetricsRing.cs): `IrisNeuralNet/Diagnostics/MetricsRing.cs`

### Lab and experiments

- [Training session](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/TrainingSession.cs): `IrisNeuralNet.Lab/TrainingSession.cs`
- [Lab entry point](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/Program.cs): `IrisNeuralNet.Lab/Program.cs`
- [Lab interface](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/LabForm.cs): `IrisNeuralNet.Lab/LabForm.cs`
- [Training charts](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/ChartPainter.cs): `IrisNeuralNet.Lab/ChartPainter.cs`
- [Topology view](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/TopologyView.cs): `IrisNeuralNet.Lab/TopologyView.cs`
- [Decision boundary](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/DecisionBoundaryView.cs): `IrisNeuralNet.Lab/DecisionBoundaryView.cs`
- [Architecture sweeps](https://github.com/stallker202/irisneuralnet/blob/main/IrisNeuralNet.Lab/SweepRunner.cs): `IrisNeuralNet.Lab/SweepRunner.cs`

### Other components

- **Lab user**
- **Iris CSV**
- **Model file**

## Connections

- Lab user → Lab entry point: starts (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Lab entry point → CSV loader: loads (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Iris CSV → CSV loader: provides rows (evidence: `IrisNeuralNet/Data/IrisDataLoader.cs`)
- CSV loader → Iris dataset: creates (evidence: `IrisNeuralNet/Data/IrisDataLoader.cs`)
- Lab entry point → Dataset split: splits (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Lab entry point → Feature scaling: fits and applies (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Lab entry point → Label encoding: encodes labels (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Lab entry point → Training session: creates (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Training session → Network factory: builds network (evidence: `IrisNeuralNet.Lab/TrainingSession.cs`)
- Network factory → Neural network: creates (evidence: `IrisNeuralNet/Core/NetworkFactory.cs`)
- Neural network → Dense layer: runs layers (evidence: `IrisNeuralNet/Core/NeuralNetwork.cs`)
- Dense layer → Activations: applies (evidence: `IrisNeuralNet/Core/DenseLayer.cs`)
- Dense layer → SIMD operations: computes with (evidence: `IrisNeuralNet/Core/DenseLayer.cs`)
- SIMD operations → Span validation: validates spans (evidence: `IrisNeuralNet/MathCore/VectorOps.cs`)
- Training session → Trainer: runs (evidence: `IrisNeuralNet.Lab/TrainingSession.cs`)
- Trainer → Neural network: forwards and backpropagates (evidence: `IrisNeuralNet/Core/Trainer.cs`)
- Trainer → Cross-entropy loss: computes gradients (evidence: `IrisNeuralNet/Core/Trainer.cs`)
- Trainer → Adam optimizer: updates parameters (evidence: `IrisNeuralNet/Core/Trainer.cs`)
- Adam optimizer → Dense layer: updates weights (evidence: `IrisNeuralNet/Optimizers/AdamOptimizer.cs`)
- Trainer → Epoch metrics: emits epoch results (evidence: `IrisNeuralNet/Core/Trainer.cs`)
- Trainer → Observer contract: notifies (evidence: `IrisNeuralNet/Core/Trainer.cs`)
- Training session → Metrics ring: supplies observer (evidence: `IrisNeuralNet.Lab/TrainingSession.cs`)
- Observer contract → Epoch metrics: receives (evidence: `IrisNeuralNet/Diagnostics/ITrainingObserver.cs`)
- Metrics ring → Epoch metrics: stores (evidence: `IrisNeuralNet/Diagnostics/MetricsRing.cs`)
- Lab entry point → Lab interface: opens UI (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Lab interface → Training session: controls training (evidence: `IrisNeuralNet.Lab/LabForm.cs`)
- Lab interface → Training charts: renders metrics (evidence: `IrisNeuralNet.Lab/LabForm.cs`)
- Lab interface → Topology view: shows topology (evidence: `IrisNeuralNet.Lab/LabForm.cs`)
- Lab interface → Decision boundary: shows boundaries (evidence: `IrisNeuralNet.Lab/LabForm.cs`)
- Lab interface → Architecture sweeps: runs experiments
- Lab interface → PCA projection: projects features (evidence: `IrisNeuralNet.Lab/LabForm.cs`)
- Lab entry point → Model serialization: loads or saves (evidence: `IrisNeuralNet.Lab/Program.cs`)
- Model serialization → Model file: reads and writes (evidence: `IrisNeuralNet/Core/ModelFile.cs`)
- Model serialization → Neural network: restores network (evidence: `IrisNeuralNet/Core/ModelFile.cs`)
- Model serialization → Feature scaling: persists scaling (evidence: `IrisNeuralNet/Core/ModelFile.cs`)
