# spartan-119/simple_gnn architecture

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

- Interactive diagram: https://gitdiagram.com/spartan-119/simple_gnn
- Repository: https://github.com/spartan-119/simple_gnn

## Overview

This repository is a PyTorch Geometric node-classification application. Its principal workflow starts at `main.py`: load the Cora graph and masks, construct the GNN and training configuration, train using the training mask with periodic validation, then report accuracy on the test mask. The model applies graph convolutions, ReLU activations, a linear layer, and log-softmax. The excerpts show these calls directly; the dataset provider is represented as an external dependency.

Main entry points: [`main.py`](https://github.com/spartan-119/simple_gnn/blob/main/main.py) (Workflow entry), [`gnn/model.py`](https://github.com/spartan-119/simple_gnn/blob/main/gnn/model.py) (GNN model), [`gnn/evaluate.py`](https://github.com/spartan-119/simple_gnn/blob/main/gnn/evaluate.py) (Test evaluation), [`gnn/train.py`](https://github.com/spartan-119/simple_gnn/blob/main/gnn/train.py) (Training and validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Application workflow"]
  node_app["Workflow entry<br/>[main.py]"]
  node_evaluator["Test evaluation<br/>[evaluate.py]"]
end

subgraph group_learning["Graph learning"]
  node_model["GNN model<br/>[model.py]"]
  node_trainer["Training and validation<br/>[train.py]"]
end

subgraph group_data["Graph data"]
  node_dataset[("Cora dataset")]
  node_loader["Dataset loader<br/>[data.py]"]
end

node_user(("User"))

node_user -->|"runs"| node_app
node_app -->|"loads data"| node_loader
node_loader -->|"loads dataset"| node_dataset
node_app -->|"constructs"| node_model
node_app -->|"trains"| node_trainer
node_trainer -->|"calls forward"| node_model
node_app -->|"evaluates"| node_evaluator
node_evaluator -->|"calls forward"| node_model

click node_app "https://github.com/spartan-119/simple_gnn/blob/main/main.py"
click node_loader "https://github.com/spartan-119/simple_gnn/blob/main/gnn/data.py"
click node_model "https://github.com/spartan-119/simple_gnn/blob/main/gnn/model.py"
click node_trainer "https://github.com/spartan-119/simple_gnn/blob/main/gnn/train.py"
click node_evaluator "https://github.com/spartan-119/simple_gnn/blob/main/gnn/evaluate.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_app,node_evaluator,node_user toneBlue
class node_model,node_trainer toneAmber
class node_dataset,node_loader toneMint
```

## Components

### Application workflow

- [Workflow entry](https://github.com/spartan-119/simple_gnn/blob/main/main.py): `main.py`
- [Test evaluation](https://github.com/spartan-119/simple_gnn/blob/main/gnn/evaluate.py): `gnn/evaluate.py`

### Graph learning

- [GNN model](https://github.com/spartan-119/simple_gnn/blob/main/gnn/model.py): `gnn/model.py`
- [Training and validation](https://github.com/spartan-119/simple_gnn/blob/main/gnn/train.py): `gnn/train.py`

### Graph data

- **Cora dataset**
- [Dataset loader](https://github.com/spartan-119/simple_gnn/blob/main/gnn/data.py): `gnn/data.py`

### Other components

- **User**

## Connections

- User → Workflow entry: runs (evidence: `README.md`)
- Workflow entry → Dataset loader: loads data (evidence: `main.py`)
- Dataset loader → Cora dataset: loads dataset (evidence: `gnn/data.py`)
- Workflow entry → GNN model: constructs (evidence: `main.py`)
- Workflow entry → Training and validation: trains (evidence: `main.py`)
- Training and validation → GNN model: calls forward (evidence: `gnn/train.py`)
- Workflow entry → Test evaluation: evaluates (evidence: `main.py`)
- Test evaluation → GNN model: calls forward (evidence: `gnn/evaluate.py`)
