# yuvrajsingh-mist/paper-replications architecture

> Architecture diagram of the GitHub repository yuvrajsingh-mist/paper-replications, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yuvrajsingh-mist/paper-replications
- Repository: https://github.com/yuvrajsingh-mist/paper-replications

## Overview

##### Project type and purpose
- This is an open-source “paper/architecture replication” monorepo built with Python and PyTorch.
- Its goal is to provide end-to-end implementations (in Jupyter notebooks and modular scripts) of classic and SOTA ML/AI architectures (e.g., Attention Mechanisms, BERT, GAN variants, RNNs, Transformers, etc.).

##### File structure
- Top-level directories each represent a self-contained replication “subproject.”
- Some subprojects (“going_modular” folders) follow a template:
- data_setup.py  – dataset loading & preprocessing
- model_builder.py – network definitions
- engine.py / train.py – training & validation loops
- predictions.py – inference pipeline
- utils.py – shared helpers
- Other subprojects are Jupyter notebooks plus raw data folders and log directories (TensorBoard / Weights & Biases).
- All rely on PyTorch, Python scripts/notebooks, and external logging services (WandB, TensorBoard).

##### README for additional insights
- Confirms the repository’s aim: replicate academic papers “from scratch” using PyTorch.
- Points to a single author and links to HuggingFace for potential model hosting.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Monorepo Root
    subgraph "Monorepo Root"
        direction TB
        README["README.md"]:::code
        Gitignore[".gitignore"]:::code

        subgraph "Subprojects"
            direction TB

            %% Generic Template Example: DCGANs
            subgraph "Subproject: DCGANs (going_modular)"
                direction TB
                DCG_DataSetup["data_setup.py"]:::code
                DCG_ModelBuilder["model_builder.py"]:::code
                DCG_Engine["engine.py"]:::code
                DCG_Train["train.py"]:::code
                DCG_Predictions["predictions.py"]:::code
                DCG_Utils["utils.py"]:::code
            end

            %% Generic Template Example: ViT
            subgraph "Subproject: ViT (going_modular)"
                direction TB
                ViT_DataSetup["data_setup.py"]:::code
                ViT_ModelBuilder["model_builder.py"]:::code
                ViT_Engine["engine.py"]:::code
                ViT_Train["train.py"]:::code
                ViT_Predictions["predictions.py"]:::code
                ViT_Utils["utils.py"]:::code
            end

            %% Generic Template Example: PaliGemma
            subgraph "Subproject: PaliGemma (going_modular)"
                direction TB
                PG_DataSetup["data_setup.py"]:::code
                PG_ModelBuilder["model_builder.py"]:::code
                PG_Engine["engine.py"]:::code
                PG_Train["train.py"]:::code
                PG_Predictions["predictions.py"]:::code
                PG_Utils["utils.py"]:::code
            end

            %% Partial Modular Engines
            subgraph "Partial Modular Engines"
                direction TB
                CLiP_Engine["engine.py"]:::code
                Llava_Engine["engine.py"]:::code
                SigLip_Engine["engine.py"]:::code
            end

            %% Notebooks
            subgraph "Jupyter Notebooks"
                direction TB
                DCGANsNotebook["DCGANs.ipynb"]:::notebook
                ViTNotebook["ViT.ipynb"]:::notebook
                PaliGemmaNotebook["paligemma.ipynb"]:::notebook
                CLiPNotebook["clip.ipynb"]:::notebook
                LlavaNotebook["llava.ipynb"]:::notebook
                SigLipNotebook["siglip.ipynb"]:::notebook
            end
        end
    end

    %% Shared Tooling & Libraries
    subgraph "Shared Tooling"
        direction TB
        Python["Python 3.x / Jupyter"]:::external
        PyTorch["PyTorch Library"]:::external
        ShellScripts["Shell Scripts"]:::code
    end

    %% Data Stores & External Services
    subgraph "Data & Storage"
        direction TB
        LocalFS["Local File System"]:::datastore
        WandBCloud["WandB Cloud"]:::external
        TB_Logs["TensorBoard Logs"]:::datastore
    end

    %% Data Flow & Interactions
    User["User/Engineer"]:::external -->|opens| DCGANsNotebook
    User -->|runs| DCG_Train

    DCGANsNotebook -->|imports| DCG_DataSetup
    DCG_Train -->|calls| DCG_DataSetup
    DCG_DataSetup -->|loads raw data| LocalFS
    DCG_DataSetup -->|provides batches| DataLoader["DataLoader"]:::code
    DataLoader -->|feeds| DCG_ModelBuilder
    DCG_ModelBuilder --> Model["PyTorch Model"]:::external
    Model -->|forward/backward| DCG_Engine
    DCG_Engine -->|updates| Model
    DCG_Engine -->|logs metrics| TB_Logs
    DCG_Engine -->|logs metrics| WandBCloud
    DCG_Engine -->|saves checkpoint| LocalFS
    DCG_Predictions -->|loads checkpoint| LocalFS
    DCG_Predictions -->|runs inference| Model
    DCG_Predictions -->|writes outputs| LocalFS

    %% Shared tooling relations
    DCG_Train -->|uses| Python
    DCG_Predictions -->|uses| Python
    DataLoader -->|built on| PyTorch
    DCG_ModelBuilder -->|built on| PyTorch
    ShellScripts -->|for data prep| LocalFS

    %% Click Events
    click README "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/./README.md"
    click Gitignore "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/.gitignore"
    click DCG_DataSetup "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/DCGANs/going_modular/going_modular/data_setup.py"
    click DCG_ModelBuilder "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/DCGANs/going_modular/going_modular/model_builder.py"
    click DCG_Engine "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/DCGANs/going_modular/going_modular/engine.py"
    click DCG_Train "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/DCGANs/going_modular/going_modular/train.py"
    click DCG_Predictions "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/DCGANs/going_modular/going_modular/predictions.py"
    click DCG_Utils "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/DCGANs/going_modular/going_modular/utils.py"

    click ViT_DataSetup "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/ViT/going_modular/going_modular/data_setup.py"
    click ViT_ModelBuilder "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/ViT/going_modular/going_modular/model_builder.py"
    click ViT_Engine "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/ViT/going_modular/going_modular/engine.py"
    click ViT_Train "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/ViT/going_modular/going_modular/train.py"
    click ViT_Predictions "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/ViT/going_modular/going_modular/predictions.py"
    click ViT_Utils "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/ViT/going_modular/going_modular/utils.py"

    click PG_DataSetup "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/PaliGemma/going_modular/going_modular/data_setup.py"
    click PG_ModelBuilder "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/PaliGemma/going_modular/going_modular/model_builder.py"
    click PG_Engine "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/PaliGemma/going_modular/going_modular/engine.py"
    click PG_Train "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/PaliGemma/going_modular/going_modular/train.py"
    click PG_Predictions "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/PaliGemma/going_modular/going_modular/predictions.py"
    click PG_Utils "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/PaliGemma/going_modular/going_modular/utils.py"

    click CLiP_Engine "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/CLiP/going_modular/engine.py"
    click Llava_Engine "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/Llava/going_modular/engine.py"
    click SigLip_Engine "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/SigLip/going_modular/engine.py"

    click DCGANsNotebook "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/DCGANs/DCGANs.ipynb"
    click ViTNotebook "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/ViT/ViT.ipynb"
    click PaliGemmaNotebook "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/PaliGemma/paligemma.ipynb"
    click CLiPNotebook "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/CLiP/clip.ipynb"
    click LlavaNotebook "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/Llava/llava.ipynb"
    click SigLipNotebook "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/SigLip/siglip.ipynb"

    click ShellScripts "https://github.com/yuvrajsingh-mist/paper-replications/blob/master/Pix2Pix/data/download_dataset.sh"

    %% Styles
    classDef code fill:#bbdefb,stroke:#1e88e5,color:#0d47a1
    classDef datastore fill:#c8e6c9,stroke:#2e7d32,color:#1b5e20
    classDef external fill:#ffe0b2,stroke:#f57c00,color:#e65100
    classDef notebook fill:#e1bee7,stroke:#8e24aa,color:#4a148c
```
