# aravindsankar28/dysat architecture

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

- Interactive diagram: https://gitdiagram.com/aravindsankar28/dysat
- Repository: https://github.com/aravindsankar28/dysat

## Overview

DySAT learns node embeddings from time-ordered graph snapshots, with IncSAT as an incremental alternative. The main workflow runs per-time-step training, prepares graph structure and random-walk context pairs, trains the selected attention model, then evaluates embeddings for link prediction and records experiment results. The graph preserves both model variants and their shared utilities. Some modules are indexed but unsampled; their connections are included only where the README or an excerpt supports them.

Main entry points: [`train.py`](https://github.com/aravindsankar28/dysat/blob/master/train.py) (DySAT training), [`train_incremental.py`](https://github.com/aravindsankar28/dysat/blob/master/train_incremental.py) (IncSAT training), [`utils/preprocess.py`](https://github.com/aravindsankar28/dysat/blob/master/utils/preprocess.py) (Graph preprocessing), [`run_script.py`](https://github.com/aravindsankar28/dysat/blob/master/run_script.py) (Experiment runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Experiment orchestration"]
  node_runner["Experiment runner<br/>[run_script.py]"]
  node_config["Experiment settings<br/>[flags.py]"]
  node_standard_train["DySAT training<br/>[train.py]"]
  node_incremental_train["IncSAT training"]
end

subgraph group_data["Graph preparation"]
  node_snapshots[("Graph snapshots<br/>[graphs.npz]")]
  node_preprocess["Graph preprocessing<br/>[preprocess.py]"]
  node_context["Walk contexts<br/>[utilities.py]"]
  node_walk_engine["Random walk engine<br/>[random_walk.py]"]
  node_batch["Node minibatches<br/>[minibatch.py]"]
  node_incremental_batch["Incremental batches"]
end

subgraph group_models["Embedding models"]
  node_dysat_model["DySAT network<br/>[models.py]"]
  node_dysat_layers["DySAT attention layers<br/>[layers.py]"]
  node_initializers["Weight initializers<br/>[inits.py]"]
  node_incsat_model["IncSAT network<br/>[models.py]"]
  node_incsat_layers["IncSAT attention layers<br/>[layers.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_link_eval["Link prediction<br/>[link_prediction.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"starts run"| node_runner
node_runner -->|"launches"| node_standard_train
node_runner -->|"launches"| node_incremental_train
node_standard_train -->|"reads settings"| node_config
node_incremental_train -->|"reads settings"| node_config
node_standard_train -->|"loads graphs"| node_preprocess
node_incremental_train -->|"loads graphs"| node_preprocess
node_preprocess -->|"reads snapshots"| node_snapshots
node_preprocess -->|"generates contexts"| node_context
node_context -->|"runs walks"| node_walk_engine
node_standard_train -->|"builds batches"| node_batch
node_incremental_train -->|"builds batches"| node_incremental_batch
node_standard_train -->|"trains model"| node_dysat_model
node_incremental_train -->|"trains model"| node_incsat_model
node_dysat_model -->|"builds attention"| node_dysat_layers
node_dysat_layers -->|"uses initializers"| node_initializers
node_incsat_model -->|"builds attention"| node_incsat_layers
node_incsat_layers -->|"uses initializers"| node_initializers
node_standard_train -->|"evaluates embeddings"| node_link_eval
node_incremental_train -->|"evaluates embeddings"| node_link_eval

click node_runner "https://github.com/aravindsankar28/dysat/blob/master/run_script.py"
click node_config "https://github.com/aravindsankar28/dysat/blob/master/flags.py"
click node_standard_train "https://github.com/aravindsankar28/dysat/blob/master/train.py"
click node_incremental_train "https://github.com/aravindsankar28/dysat/blob/master/train_incremental.py"
click node_snapshots "https://github.com/aravindsankar28/dysat/blob/master/data/Enron_new/graphs.npz"
click node_preprocess "https://github.com/aravindsankar28/dysat/blob/master/utils/preprocess.py"
click node_context "https://github.com/aravindsankar28/dysat/blob/master/utils/utilities.py"
click node_walk_engine "https://github.com/aravindsankar28/dysat/blob/master/utils/random_walk.py"
click node_batch "https://github.com/aravindsankar28/dysat/blob/master/utils/minibatch.py"
click node_incremental_batch "https://github.com/aravindsankar28/dysat/blob/master/utils/incremental_minibatch.py"
click node_dysat_model "https://github.com/aravindsankar28/dysat/blob/master/models/DySAT/models.py"
click node_dysat_layers "https://github.com/aravindsankar28/dysat/blob/master/models/DySAT/layers.py"
click node_initializers "https://github.com/aravindsankar28/dysat/blob/master/models/DySAT/inits.py"
click node_incsat_model "https://github.com/aravindsankar28/dysat/blob/master/models/IncSAT/models.py"
click node_incsat_layers "https://github.com/aravindsankar28/dysat/blob/master/models/IncSAT/layers.py"
click node_link_eval "https://github.com/aravindsankar28/dysat/blob/master/eval/link_prediction.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_runner,node_config,node_standard_train,node_incremental_train toneBlue
class node_snapshots,node_preprocess,node_context,node_walk_engine,node_batch,node_incremental_batch toneAmber
class node_dysat_model,node_dysat_layers,node_initializers,node_incsat_model,node_incsat_layers toneMint
class node_link_eval toneRose
class node_researcher toneIndigo
```

## Components

### Experiment orchestration

- [Experiment runner](https://github.com/aravindsankar28/dysat/blob/master/run_script.py): `run_script.py`
- [Experiment settings](https://github.com/aravindsankar28/dysat/blob/master/flags.py): `flags.py`
- [DySAT training](https://github.com/aravindsankar28/dysat/blob/master/train.py): `train.py`
- [IncSAT training](https://github.com/aravindsankar28/dysat/blob/master/train_incremental.py): `train_incremental.py`

### Graph preparation

- [Graph snapshots](https://github.com/aravindsankar28/dysat/blob/master/data/Enron_new/graphs.npz): `data/Enron_new/graphs.npz`
- [Graph preprocessing](https://github.com/aravindsankar28/dysat/blob/master/utils/preprocess.py): `utils/preprocess.py`
- [Walk contexts](https://github.com/aravindsankar28/dysat/blob/master/utils/utilities.py): `utils/utilities.py`
- [Random walk engine](https://github.com/aravindsankar28/dysat/blob/master/utils/random_walk.py): `utils/random_walk.py`
- [Node minibatches](https://github.com/aravindsankar28/dysat/blob/master/utils/minibatch.py): `utils/minibatch.py`
- [Incremental batches](https://github.com/aravindsankar28/dysat/blob/master/utils/incremental_minibatch.py): `utils/incremental_minibatch.py`

### Embedding models

- [DySAT network](https://github.com/aravindsankar28/dysat/blob/master/models/DySAT/models.py): `models/DySAT/models.py`
- [DySAT attention layers](https://github.com/aravindsankar28/dysat/blob/master/models/DySAT/layers.py): `models/DySAT/layers.py`
- [Weight initializers](https://github.com/aravindsankar28/dysat/blob/master/models/DySAT/inits.py): `models/DySAT/inits.py`
- [IncSAT network](https://github.com/aravindsankar28/dysat/blob/master/models/IncSAT/models.py): `models/IncSAT/models.py`
- [IncSAT attention layers](https://github.com/aravindsankar28/dysat/blob/master/models/IncSAT/layers.py): `models/IncSAT/layers.py`

### Evaluation

- [Link prediction](https://github.com/aravindsankar28/dysat/blob/master/eval/link_prediction.py): `eval/link_prediction.py`

### Other components

- **Researcher**

## Connections

- Researcher → Experiment runner: starts run (evidence: `README.md`)
- Experiment runner → DySAT training: launches (evidence: `README.md`)
- Experiment runner → IncSAT training: launches (evidence: `README.md`)
- DySAT training → Experiment settings: reads settings (evidence: `train.py`)
- IncSAT training → Experiment settings: reads settings (evidence: `train_incremental.py`)
- DySAT training → Graph preprocessing: loads graphs (evidence: `train.py`)
- IncSAT training → Graph preprocessing: loads graphs (evidence: `train_incremental.py`)
- Graph preprocessing → Graph snapshots: reads snapshots (evidence: `utils/preprocess.py`)
- Graph preprocessing → Walk contexts: generates contexts (evidence: `utils/preprocess.py`)
- Walk contexts → Random walk engine: runs walks (evidence: `utils/utilities.py`)
- DySAT training → Node minibatches: builds batches (evidence: `train.py`)
- IncSAT training → Incremental batches: builds batches (evidence: `train_incremental.py`)
- DySAT training → DySAT network: trains model (evidence: `train.py`)
- IncSAT training → IncSAT network: trains model (evidence: `train_incremental.py`)
- DySAT network → DySAT attention layers: builds attention (evidence: `models/DySAT/models.py`)
- DySAT attention layers → Weight initializers: uses initializers (evidence: `models/DySAT/layers.py`)
- IncSAT network → IncSAT attention layers: builds attention (evidence: `models/IncSAT/models.py`)
- IncSAT attention layers → Weight initializers: uses initializers (evidence: `models/IncSAT/layers.py`)
- DySAT training → Link prediction: evaluates embeddings (evidence: `train.py`)
- IncSAT training → Link prediction: evaluates embeddings (evidence: `train_incremental.py`)
