# khushiyadav03/atmofusenet architecture

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

- Interactive diagram: https://gitdiagram.com/khushiyadav03/atmofusenet
- Repository: https://github.com/khushiyadav03/atmofusenet

## Overview

AtmoFuseNet trains and evaluates a physics-guided neural ODE model for air-quality forecasting. The principal workflow starts with station and time-series inputs, builds a spatial graph, trains the model, evaluates forecast horizons, and saves predictions and summary metrics. The model encodes observations into latent initial states, integrates them with a differential-equation solver whose dynamics include graph-based physics, then decodes forecasts. Source excerpts establish the main calls; unsampled data-loading details are represented only where the index or README supports them.

Main entry points: [`main.py`](https://github.com/khushiyadav03/atmofusenet/blob/main/main.py) (Experiment entry), [`atmofusenet_model.py`](https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_model.py) (AtmoFuseNet model), [`atmofusenet_supervisor.py`](https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_supervisor.py) (Training supervisor), [`diffeq_solver.py`](https://github.com/khushiyadav03/atmofusenet/blob/main/diffeq_solver.py) (ODE integrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Run and evaluation"]
  node_main["Experiment entry<br/>[main.py]"]
  node_supervisor["Training supervisor"]
end

subgraph group_inputs["Data and graph"]
  node_config["Run configuration<br/>[config.yaml]"]
  node_station_data["Station locations<br/>[station.csv]"]
  node_series_data["Air-quality series"]
  node_graph_prep["Spatial graph prep<br/>[utils.py]"]
  node_data_pipeline["Dataset and batches<br/>[utils.py]"]
end

subgraph group_model["Forecast model"]
  node_model["AtmoFuseNet model"]
  node_encoder["GRU latent encoder"]
  node_ode_func["Physics-guided dynamics<br/>[ode_func.py]"]
  node_solver["ODE integrator<br/>[diffeq_solver.py]"]
  node_decoder["Forecast decoder"]
  node_odeint["torchdiffeq integrator"]
end

subgraph group_assessment["Evaluation outputs"]
  node_metrics["Forecast metrics<br/>[metrics.py]"]
  node_predictions["Saved forecasts"]
  node_results["Horizon summaries"]
end

node_user(("Experiment runner"))

node_user -->|"runs"| node_main
node_main -->|"loads"| node_config
node_main -->|"builds graph"| node_graph_prep
node_station_data -->|"provides locations"| node_graph_prep
node_series_data -->|"provides series"| node_data_pipeline
node_supervisor -->|"loads data"| node_data_pipeline
node_main -->|"trains and evaluates"| node_supervisor
node_supervisor -->|"invokes"| node_model
node_model -->|"encodes inputs"| node_encoder
node_model -->|"constructs dynamics"| node_ode_func
node_model -->|"integrates latent state"| node_solver
node_solver -->|"evaluates dynamics"| node_ode_func
node_solver -->|"calls"| node_odeint
node_model -->|"decodes trajectories"| node_decoder
node_supervisor -->|"computes scores"| node_metrics
node_main -->|"saves forecasts"| node_predictions
node_main -->|"writes summaries"| node_results

click node_main "https://github.com/khushiyadav03/atmofusenet/blob/main/main.py"
click node_config "https://github.com/khushiyadav03/atmofusenet/blob/main/config.yaml"
click node_station_data "https://github.com/khushiyadav03/atmofusenet/blob/main/data/station.csv"
click node_series_data "https://github.com/khushiyadav03/atmofusenet/tree/main/data"
click node_graph_prep "https://github.com/khushiyadav03/atmofusenet/blob/main/utils.py"
click node_data_pipeline "https://github.com/khushiyadav03/atmofusenet/blob/main/utils.py"
click node_supervisor "https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_supervisor.py"
click node_model "https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_model.py"
click node_encoder "https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_model.py"
click node_ode_func "https://github.com/khushiyadav03/atmofusenet/blob/main/ode_func.py"
click node_solver "https://github.com/khushiyadav03/atmofusenet/blob/main/diffeq_solver.py"
click node_decoder "https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_model.py"
click node_metrics "https://github.com/khushiyadav03/atmofusenet/blob/main/metrics.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_main,node_supervisor toneBlue
class node_config,node_station_data,node_series_data,node_graph_prep,node_data_pipeline toneAmber
class node_model,node_encoder,node_ode_func,node_solver,node_decoder,node_odeint toneMint
class node_metrics,node_predictions,node_results toneRose
class node_user toneIndigo
```

## Components

### Run and evaluation

- [Experiment entry](https://github.com/khushiyadav03/atmofusenet/blob/main/main.py): `main.py`
- [Training supervisor](https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_supervisor.py): `atmofusenet_supervisor.py`

### Data and graph

- [Run configuration](https://github.com/khushiyadav03/atmofusenet/blob/main/config.yaml): `config.yaml`
- [Station locations](https://github.com/khushiyadav03/atmofusenet/blob/main/data/station.csv): `data/station.csv`
- [Air-quality series](https://github.com/khushiyadav03/atmofusenet/tree/main/data): `data`
- [Spatial graph prep](https://github.com/khushiyadav03/atmofusenet/blob/main/utils.py): `utils.py`
- [Dataset and batches](https://github.com/khushiyadav03/atmofusenet/blob/main/utils.py): `utils.py`

### Forecast model

- [AtmoFuseNet model](https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_model.py): `atmofusenet_model.py`
- [GRU latent encoder](https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_model.py): `atmofusenet_model.py`
- [Physics-guided dynamics](https://github.com/khushiyadav03/atmofusenet/blob/main/ode_func.py): `ode_func.py`
- [ODE integrator](https://github.com/khushiyadav03/atmofusenet/blob/main/diffeq_solver.py): `diffeq_solver.py`
- [Forecast decoder](https://github.com/khushiyadav03/atmofusenet/blob/main/atmofusenet_model.py): `atmofusenet_model.py`
- **torchdiffeq integrator**

### Evaluation outputs

- [Forecast metrics](https://github.com/khushiyadav03/atmofusenet/blob/main/metrics.py): `metrics.py`
- **Saved forecasts**
- **Horizon summaries**

### Other components

- **Experiment runner**

## Connections

- Experiment runner → Experiment entry: runs (evidence: `README.md`)
- Experiment entry → Run configuration: loads (evidence: `main.py`)
- Experiment entry → Spatial graph prep: builds graph (evidence: `main.py`)
- Station locations → Spatial graph prep: provides locations (evidence: `utils.py`)
- Air-quality series → Dataset and batches: provides series (evidence: `README.md`)
- Training supervisor → Dataset and batches: loads data (evidence: `atmofusenet_supervisor.py`)
- Experiment entry → Training supervisor: trains and evaluates (evidence: `main.py`)
- Training supervisor → AtmoFuseNet model: invokes (evidence: `atmofusenet_supervisor.py`)
- AtmoFuseNet model → GRU latent encoder: encodes inputs (evidence: `atmofusenet_model.py`)
- AtmoFuseNet model → Physics-guided dynamics: constructs dynamics (evidence: `atmofusenet_model.py`)
- AtmoFuseNet model → ODE integrator: integrates latent state (evidence: `atmofusenet_model.py`)
- ODE integrator → Physics-guided dynamics: evaluates dynamics (evidence: `diffeq_solver.py`)
- ODE integrator → torchdiffeq integrator: calls (evidence: `diffeq_solver.py`)
- AtmoFuseNet model → Forecast decoder: decodes trajectories (evidence: `atmofusenet_model.py`)
- Training supervisor → Forecast metrics: computes scores (evidence: `atmofusenet_supervisor.py`)
- Experiment entry → Saved forecasts: saves forecasts (evidence: `main.py`)
- Experiment entry → Horizon summaries: writes summaries (evidence: `main.py`)
