# namtt908/saint- architecture

> Architecture diagram of the GitHub repository namtt908/saint-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/namtt908/saint-
- Repository: https://github.com/namtt908/saint-

## Overview

##### Project type and purpose
- This is a machine-learning library and training pipeline implementing the SAINT+ Transformer-based model for knowledge tracing on the EdNet dataset.
- It is not a web or full-stack app but a PyTorch-based research codebase with data processing, model, trainer, metrics, and CLI/script interfaces.

##### File structure
- Top-level:
- configs/ednet_config.yaml – hyperparameters and paths
- requirements.txt, setup.py – packaging and dependencies
- saint_plus/ – core library
– data/dataset.py – dataset loader & preprocessing
– model.py – model definition (encoder, decoder, temporal layers)
– trainer.py – training & evaluation orchestration
– utils/metrics.py – performance metrics
- scripts/ – entry-point scripts:
– preprocess_kt1.py – any extra preprocessing
– train.py, train_kt1.py – training launches
- tests/ – unit tests for model behavior

##### README for extra insights
- README spells out the core components: Encoder, Decoder, Temporal Features, Output Layer, and training/evaluation utilities.
- It cites use of PyTorch 1.10+, details input features and output metrics.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Dependencies
    EdNet["EdNet Raw Data"]:::external
    PyTorch["PyTorch"]:::external

    %% Configuration & Scripts
    Config["Config (ednet_config.yaml)"]:::scripts
    Setup["Setup & Packaging\n(setup.py, requirements.txt)"]:::scripts
    Preprocess["Preprocessing Script"]:::scripts
    TrainCLI["CLI Scripts\n(train.py, train_kt1.py)"]:::scripts

    %% Core Modules
    Dataset["Dataset Loader\n(saint_plus/data/dataset.py)"]:::code
    Model["SAINTPlus Model\n(saint_plus/model.py)"]:::code
    Trainer["Training & Evaluation Engine\n(saint_plus/trainer.py)"]:::code
    Metrics["Metrics & Logging\n(saint_plus/utils/metrics.py)"]:::code

    %% Tests & Outputs
    Tests["Unit Tests\n(tests/test_model.py)"]:::code
    Checkpoint["Checkpoints & Logs"]:::external
    EvalReports["Evaluation Reports"]:::external

    %% Data Flow
    EdNet --> Preprocess
    Preprocess --> Dataset
    Dataset --> Model
    Model --> Trainer
    Trainer --> Metrics
    Trainer --> Checkpoint
    Trainer --> EvalReports

    %% Config & Scripts Flow
    Config --> Preprocess
    Config --> Trainer
    Config --> TrainCLI
    Setup --> Preprocess
    Setup --> Trainer
    TrainCLI --> Trainer

    %% External Dependencies Flow
    PyTorch --> Model
    PyTorch --> Trainer

    %% Click Events
    click Preprocess "https://github.com/namtt908/saint-/blob/main/scripts/preprocess_kt1.py"
    click Dataset "https://github.com/namtt908/saint-/blob/main/saint_plus/data/dataset.py"
    click Model "https://github.com/namtt908/saint-/blob/main/saint_plus/model.py"
    click Trainer "https://github.com/namtt908/saint-/blob/main/saint_plus/trainer.py"
    click Metrics "https://github.com/namtt908/saint-/blob/main/saint_plus/utils/metrics.py"
    click Config "https://github.com/namtt908/saint-/blob/main/configs/ednet_config.yaml"
    click Setup "https://github.com/namtt908/saint-/blob/main/setup.py"
    click TrainCLI "https://github.com/namtt908/saint-/blob/main/scripts/train.py"
    click Tests "https://github.com/namtt908/saint-/blob/main/tests/test_model.py"

    %% Styling
    classDef code fill:#D6EAF8,stroke:#2874A6,color:#1B2631;
    classDef scripts fill:#D5F5E3,stroke:#239B56,color:#1B2631;
    classDef external fill:#FDEBD0,stroke:#E67E22,color:#1B2631;

    class Dataset,Model,Trainer,Metrics,Tests code
    class Preprocess,TrainCLI,Config,Setup scripts
    class EdNet,PyTorch,Checkpoint,EvalReports external
```
