# yacine204/nyuraru architecture

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

- Interactive diagram: https://gitdiagram.com/yacine204/nyuraru
- Repository: https://github.com/yacine204/nyuraru

## Overview

ニューラル is a NumPy-based neural-network library for defining custom layers, training on .npy data, evaluating and predicting, with a Raylib visualizer for training progress and interactive tests. The main workflow is user configuration → training or loading a model → evaluation or interactive prediction. The graph includes the core computation, loss and activation modules, the Python-to-C visualization boundary, and the supplied datasets and weights. Edges are limited to relationships shown in excerpts or documented in the README; examples are omitted, and unsampled implementation details are not inferred.

Main entry points: [`core/nn.py`](https://github.com/yacine204/nyuraru/blob/master/core/nn.py) (Neural network), [`core/visualizer.py`](https://github.com/yacine204/nyuraru/blob/master/core/visualizer.py) (Python visualizer), [`dataset`](https://github.com/yacine204/nyuraru/tree/master/dataset) (Example datasets), [`weights`](https://github.com/yacine204/nyuraru/tree/master/weights) (Pretrained weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Model computation"]
  node_network["Neural network<br/>[nn.py]"]
  node_layers["Layer definitions<br/>[layer.py]"]
  node_activations["Activation functions<br/>[activate.py]"]
end

subgraph group_learning["Training and evaluation"]
  node_loss["Loss functions<br/>[cost.py]"]
  node_training["Training<br/>[nn.py]"]
  node_evaluation["Evaluation<br/>[nn.py]"]
  node_prediction["Interactive prediction<br/>[nn.py]"]
end

subgraph group_visualization["Interactive visualization"]
  node_pyviz["Python visualizer<br/>[visualizer.py]"]
  node_cui["Raylib visualizer UI<br/>[visualizor.c]"]
end

subgraph group_assets["Supplied model data"]
  node_datasets[("Example datasets")]
  node_weights[("Pretrained weights")]
end

node_user(("Library user"))

node_user -->|"configures"| node_network
node_network -->|"uses layers"| node_layers
node_network -->|"uses activations"| node_activations
node_network -->|"executes loss"| node_loss
node_user -->|"trains on data"| node_training
node_datasets -->|"provides .npy data"| node_training
node_user -->|"evaluates model"| node_evaluation
node_weights -->|"loads pretrained model"| node_network
node_user -->|"starts prediction"| node_prediction
node_training -->|"updates visualization"| node_pyviz
node_prediction -->|"drives interactive UI"| node_pyviz
node_pyviz -->|"calls UI functions"| node_cui
node_user -->|"interacts in real time"| node_pyviz

click node_network "https://github.com/yacine204/nyuraru/blob/master/core/nn.py"
click node_layers "https://github.com/yacine204/nyuraru/blob/master/core/layer.py"
click node_activations "https://github.com/yacine204/nyuraru/blob/master/core/activate.py"
click node_loss "https://github.com/yacine204/nyuraru/blob/master/core/cost.py"
click node_training "https://github.com/yacine204/nyuraru/blob/master/core/nn.py"
click node_evaluation "https://github.com/yacine204/nyuraru/blob/master/core/nn.py"
click node_prediction "https://github.com/yacine204/nyuraru/blob/master/core/nn.py"
click node_pyviz "https://github.com/yacine204/nyuraru/blob/master/core/visualizer.py"
click node_cui "https://github.com/yacine204/nyuraru/blob/master/visualizor.c"
click node_datasets "https://github.com/yacine204/nyuraru/tree/master/dataset"
click node_weights "https://github.com/yacine204/nyuraru/tree/master/weights"

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_network,node_layers,node_activations,node_user toneBlue
class node_loss,node_training,node_evaluation,node_prediction toneAmber
class node_pyviz,node_cui toneMint
class node_datasets,node_weights toneRose
```

## Components

### Model computation

- [Neural network](https://github.com/yacine204/nyuraru/blob/master/core/nn.py): `core/nn.py`
- [Layer definitions](https://github.com/yacine204/nyuraru/blob/master/core/layer.py): `core/layer.py`
- [Activation functions](https://github.com/yacine204/nyuraru/blob/master/core/activate.py): `core/activate.py`

### Training and evaluation

- [Loss functions](https://github.com/yacine204/nyuraru/blob/master/core/cost.py): `core/cost.py`
- [Training](https://github.com/yacine204/nyuraru/blob/master/core/nn.py): `core/nn.py`
- [Evaluation](https://github.com/yacine204/nyuraru/blob/master/core/nn.py): `core/nn.py`
- [Interactive prediction](https://github.com/yacine204/nyuraru/blob/master/core/nn.py): `core/nn.py`

### Interactive visualization

- [Python visualizer](https://github.com/yacine204/nyuraru/blob/master/core/visualizer.py): `core/visualizer.py`
- [Raylib visualizer UI](https://github.com/yacine204/nyuraru/blob/master/visualizor.c): `visualizor.c`

### Supplied model data

- [Example datasets](https://github.com/yacine204/nyuraru/tree/master/dataset): `dataset`
- [Pretrained weights](https://github.com/yacine204/nyuraru/tree/master/weights): `weights`

### Other components

- **Library user**

## Connections

- Library user → Neural network: configures (evidence: `README.md`)
- Neural network → Layer definitions: uses layers (evidence: `core/nn.py`)
- Neural network → Activation functions: uses activations (evidence: `core/nn.py`)
- Neural network → Loss functions: executes loss (evidence: `core/nn.py`)
- Library user → Training: trains on data (evidence: `README.md`)
- Example datasets → Training: provides .npy data (evidence: `README.md`)
- Library user → Evaluation: evaluates model (evidence: `README.md`)
- Pretrained weights → Neural network: loads pretrained model (evidence: `README.md`)
- Library user → Interactive prediction: starts prediction (evidence: `README.md`)
- Training → Python visualizer: updates visualization (evidence: `core/nn.py`)
- Interactive prediction → Python visualizer: drives interactive UI (evidence: `core/nn.py`)
- Python visualizer → Raylib visualizer UI: calls UI functions (evidence: `core/visualizer.py`)
- Library user → Python visualizer: interacts in real time (evidence: `README.md`)
