# daehoum1/fisf architecture

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

- Interactive diagram: https://gitdiagram.com/daehoum1/fisf
- Repository: https://github.com/daehoum1/fisf

## Overview

##### Project type and purpose
- This is a research‐oriented Machine Learning codebase (“FISF”) for graph‐based feature imputation, implemented in PyTorch and PyTorch Geometric (PyG).
- It supports two main experimental workflows: semi-supervised node classification (run_node.py) and link prediction (run_link.py), based on the paper “Propagate and Inject…”.

##### File structure
- Top‐level scripts:
- run_node.py – orchestrates the node classification experiment
- run_link.py – orchestrates the link prediction experiment
- train.py      – generic training loop (called by run_*.py)
- evaluation.py – metrics calculation
- seeds.py      – experiment reproducibility
- Core modules:
- data_loading.py / data_utils.py – graph data ingestion, preprocessing & batch construction
- models.py        – PyTorch model architectures (GNN encoders, decoders, imputation heads)
- fisf.py          – implementation of the Propagate & Inject algorithm logic
- Utility modules:
- utils.py         – logging, config parsing, checkpointing
- utils_link.py    – link‐prediction–specific helpers
- External dependencies and config are implicitly defined by the README (torch==1.10.2, pyg==2.0.3).

##### Extract insights from the README
- Confirms two experiment types (node classification and link prediction).
- Emphasizes that this builds on Twitter’s Feature Propagation codebase.

##### Detail
- Dependencies on external frameworks (torch, pyg, feature‐propagation).
- Branching for the two workflows (node vs. link) early in the Experiment Layer.

– Shows all 12+ modules distinctly
– Illustrates how data flows from scripts through the FISF algorithm into evaluation
– Highlights separation of concerns and external integrations
– Can be extended later to include hyperparameter stores or deployment endpoints if needed.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Experiment Layer
    subgraph "Experiment Layer"
        RunNode["run_node.py"]:::exp
        RunLink["run_link.py"]:::exp
    end

    %% Pipeline Layer
    subgraph "Pipeline Layer"
        Train["train.py"]:::pipeline
        Eval["evaluation.py"]:::pipeline
    end

    %% Core Logic Layer
    subgraph "Core Logic Layer"
        Models["models.py"]:::core
        FISF["fisf.py"]:::core
    end

    %% Data Layer
    subgraph "Data Layer"
        DataLoad["data_loading.py"]:::data
        DataUtils["data_utils.py"]:::data
    end

    %% Utilities & Helpers
    subgraph "Utilities & Helpers"
        Utils["utils.py"]:::util
        UtilsLink["utils_link.py"]:::util
        Seeds["seeds.py"]:::util
    end

    %% External Dependencies
    subgraph "External Dependencies"
        Torch["PyTorch"]:::external
        PyG["PyG"]:::external
        FP["Feature-Propagation"]:::external
    end

    %% Relationships
    RunNode -->|"load config & seed"| Seeds
    RunLink -->|"load config & seed"| Seeds
    Seeds --> DataLoad
    DataLoad --> DataUtils
    DataUtils -->|"GraphBatch"| Train
    Models -->|"defines architectures"| Train
    FISF -->|"propagation routines"| Models
    FISF -->|"injected features"| Train
    Train -->|"metrics input"| Eval
    RunLink -->|"link-specific helpers"| UtilsLink
    Train -->|"negative sampling & edge split"| UtilsLink
    Utils --> Train
    Utils --> Eval

    %% External Dependencies usage
    Torch --> DataLoad
    Torch --> Models
    Torch --> Train
    PyG --> DataLoad
    PyG --> Models
    FP --> FISF

    %% Click Events
    click DataLoad "https://github.com/daehoum1/fisf/blob/main/data_loading.py"
    click DataUtils "https://github.com/daehoum1/fisf/blob/main/data_utils.py"
    click FISF "https://github.com/daehoum1/fisf/blob/main/fisf.py"
    click Models "https://github.com/daehoum1/fisf/blob/main/models.py"
    click Train "https://github.com/daehoum1/fisf/blob/main/train.py"
    click RunNode "https://github.com/daehoum1/fisf/blob/main/run_node.py"
    click RunLink "https://github.com/daehoum1/fisf/blob/main/run_link.py"
    click Eval "https://github.com/daehoum1/fisf/blob/main/evaluation.py"
    click Utils "https://github.com/daehoum1/fisf/blob/main/utils.py"
    click UtilsLink "https://github.com/daehoum1/fisf/blob/main/utils_link.py"
    click Seeds "https://github.com/daehoum1/fisf/blob/main/seeds.py"

    %% Styles
    classDef exp fill:#f9f,stroke:#333,stroke-width:1px
    classDef pipeline fill:#fea,stroke:#333,stroke-width:1px
    classDef core fill:#9f9,stroke:#333,stroke-width:1px
    classDef data fill:#9cf,stroke:#333,stroke-width:1px
    classDef util fill:#ccc,stroke:#333,stroke-width:1px
    classDef external fill:#eee,stroke:#666,stroke-width:1px,stroke-dasharray: 5 5
```
