# irfanhaider71/mag-net architecture

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

- Interactive diagram: https://gitdiagram.com/irfanhaider71/mag-net
- Repository: https://github.com/irfanhaider71/mag-net

## Overview

This repository is a reproducibility pipeline for molecular-property prediction: it derives graph descriptors, trains and evaluates the gated multi-task MAG-Net, and compares it with classical and alternative-representation baselines. The documented workflow uses a canonical held-out split and reports cross-validation and robustness results, alongside learned gating/error analysis. Edges reflect explicit README workflow or sampled calls; several README-listed robustness, figure, and correlation scripts are absent from the supplied tree, so their implementation links are not inferred.

Main entry points: [`3-Baselines/baseline_harness.py`](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/baseline_harness.py) (Shared baseline data), [`2-MAG-Net/proposed_validated_pipeline.py`](https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/proposed_validated_pipeline.py) (Validated MAG-Net), [`1-Topological Descriptor Computation/topological_descriptors_computation.py`](https://github.com/irfanhaider71/mag-net/blob/main/1-Topological%20Descriptor%20Computation/topological_descriptors_computation.py) (Graph descriptor computation), [`2-MAG-Net/extract_gating_and_errors.py`](https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/extract_gating_and_errors.py) (Gating and errors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_descriptor["Descriptor analysis"]
  node_descriptor_calc["Graph descriptor computation"]
  node_descriptor_formulas["Descriptor definitions"]
end

subgraph group_magnet["MAG-Net workflow"]
  node_magnet_pipeline["Validated MAG-Net"]
  node_joint_tuning["Joint tuning"]
  node_kfold_summary["Fold summary"]
  node_interpretation["Gating and errors"]
end

subgraph group_baseline["Baseline comparisons"]
  node_baseline_data["Shared baseline data"]
  node_classical["Classical models"]
  node_smiles_cnn["SMILES CNN"]
  node_cnn_search["CNN search"]
  node_transformer["Transformer search"]
  node_fingerprint["Fingerprint search"]
  node_descriptor_mlp["Ungated MLP tuning"]
end

subgraph group_evaluation["Evaluation outputs"]
  node_metrics["Benchmark metrics"]
  node_robustness["Robustness studies"]
  node_paper_figures["Paper figures"]
end

node_researcher(("Researcher"))
node_molecular_data["Molecular data"]
node_descriptor_table["Descriptor table"]

node_researcher -->|"runs"| node_descriptor_calc
node_researcher -->|"runs"| node_magnet_pipeline
node_researcher -->|"runs"| node_joint_tuning
node_researcher -->|"runs"| node_classical
node_molecular_data -->|"provides SMILES"| node_descriptor_calc
node_descriptor_calc -->|"computes"| node_descriptor_table
node_researcher -->|"views definitions"| node_descriptor_formulas
node_molecular_data -->|"provides inputs"| node_magnet_pipeline
node_descriptor_table -->|"provides descriptors"| node_magnet_pipeline
node_magnet_pipeline -->|"evaluates model"| node_metrics
node_molecular_data -->|"provides inputs"| node_joint_tuning
node_descriptor_table -->|"provides descriptors"| node_joint_tuning
node_molecular_data -->|"provides inputs"| node_kfold_summary
node_descriptor_table -->|"provides descriptors"| node_kfold_summary
node_molecular_data -->|"provides inputs"| node_interpretation
node_descriptor_table -->|"provides descriptors"| node_interpretation
node_interpretation -->|"writes analysis"| node_metrics
node_molecular_data -->|"loads and merges"| node_baseline_data
node_baseline_data -->|"supplies data"| node_classical
node_baseline_data -->|"supplies data"| node_smiles_cnn
node_baseline_data -->|"supplies data"| node_cnn_search
node_baseline_data -->|"supplies data"| node_transformer
node_baseline_data -->|"supplies data"| node_fingerprint
node_baseline_data -->|"supplies data"| node_descriptor_mlp
node_smiles_cnn -->|"provides tokenization"| node_cnn_search
node_classical -->|"reports results"| node_metrics
node_cnn_search -->|"reports results"| node_metrics
node_transformer -->|"reports results"| node_metrics
node_fingerprint -->|"reports results"| node_metrics
node_descriptor_mlp -->|"reports results"| node_metrics
node_researcher -.->|"runs documented studies"| node_robustness
node_researcher -.->|"regenerates"| node_paper_figures

click node_descriptor_calc "https://github.com/irfanhaider71/mag-net/blob/main/1-Topological%20Descriptor%20Computation/topological_descriptors_computation.py"
click node_descriptor_formulas "https://github.com/irfanhaider71/mag-net/blob/main/1-Topological%20Descriptor%20Computation/topological_formulas.py"
click node_magnet_pipeline "https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/proposed_validated_pipeline.py"
click node_joint_tuning "https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/magnet_joint_tuning.py"
click node_kfold_summary "https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/magnet_tuned_kfold_summary.py"
click node_interpretation "https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/extract_gating_and_errors.py"
click node_baseline_data "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/baseline_harness.py"
click node_classical "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/classical_baselines.py"
click node_smiles_cnn "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/baseline_smiles_cnn.py"
click node_cnn_search "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/optimize_smiles_cnn.py"
click node_transformer "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/optimize_transformer_smiles.py"
click node_fingerprint "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/optimize_morgan_fp.py"
click node_descriptor_mlp "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/fair_tune_descriptor_mlp.py"
click node_metrics "https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/baseline_harness.py"
click node_robustness "https://github.com/irfanhaider71/mag-net/tree/main/2-MAG-Net"
click node_paper_figures "https://github.com/irfanhaider71/mag-net/tree/main/2-MAG-Net"

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_descriptor_calc,node_descriptor_formulas toneBlue
class node_magnet_pipeline,node_joint_tuning,node_kfold_summary,node_interpretation toneAmber
class node_baseline_data,node_classical,node_smiles_cnn,node_cnn_search,node_transformer,node_fingerprint,node_descriptor_mlp toneMint
class node_metrics,node_robustness,node_paper_figures toneRose
class node_researcher,node_molecular_data,node_descriptor_table toneIndigo
```

## Components

### Descriptor analysis

- [Graph descriptor computation](https://github.com/irfanhaider71/mag-net/blob/main/1-Topological%20Descriptor%20Computation/topological_descriptors_computation.py): `1-Topological Descriptor Computation/topological_descriptors_computation.py`
- [Descriptor definitions](https://github.com/irfanhaider71/mag-net/blob/main/1-Topological%20Descriptor%20Computation/topological_formulas.py): `1-Topological Descriptor Computation/topological_formulas.py`

### MAG-Net workflow

- [Validated MAG-Net](https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/proposed_validated_pipeline.py): `2-MAG-Net/proposed_validated_pipeline.py`
- [Joint tuning](https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/magnet_joint_tuning.py): `2-MAG-Net/magnet_joint_tuning.py`
- [Fold summary](https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/magnet_tuned_kfold_summary.py): `2-MAG-Net/magnet_tuned_kfold_summary.py`
- [Gating and errors](https://github.com/irfanhaider71/mag-net/blob/main/2-MAG-Net/extract_gating_and_errors.py): `2-MAG-Net/extract_gating_and_errors.py`

### Baseline comparisons

- [Shared baseline data](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/baseline_harness.py): `3-Baselines/baseline_harness.py`
- [Classical models](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/classical_baselines.py): `3-Baselines/classical_baselines.py`
- [SMILES CNN](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/baseline_smiles_cnn.py): `3-Baselines/baseline_smiles_cnn.py`
- [CNN search](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/optimize_smiles_cnn.py): `3-Baselines/optimize_smiles_cnn.py`
- [Transformer search](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/optimize_transformer_smiles.py): `3-Baselines/optimize_transformer_smiles.py`
- [Fingerprint search](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/optimize_morgan_fp.py): `3-Baselines/optimize_morgan_fp.py`
- [Ungated MLP tuning](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/fair_tune_descriptor_mlp.py): `3-Baselines/fair_tune_descriptor_mlp.py`

### Evaluation outputs

- [Benchmark metrics](https://github.com/irfanhaider71/mag-net/blob/main/3-Baselines/baseline_harness.py): `3-Baselines/baseline_harness.py`
- [Robustness studies](https://github.com/irfanhaider71/mag-net/tree/main/2-MAG-Net): `2-MAG-Net`
- [Paper figures](https://github.com/irfanhaider71/mag-net/tree/main/2-MAG-Net): `2-MAG-Net`

### Other components

- **Researcher**
- **Molecular data**
- **Descriptor table**

## Connections

- Researcher → Graph descriptor computation: runs
- Researcher → Validated MAG-Net: runs
- Researcher → Joint tuning: runs
- Researcher → Classical models: runs
- Molecular data → Graph descriptor computation: provides SMILES
- Graph descriptor computation → Descriptor table: computes
- Researcher → Descriptor definitions: views definitions
- Molecular data → Validated MAG-Net: provides inputs
- Descriptor table → Validated MAG-Net: provides descriptors
- Validated MAG-Net → Benchmark metrics: evaluates model
- Molecular data → Joint tuning: provides inputs
- Descriptor table → Joint tuning: provides descriptors
- Molecular data → Fold summary: provides inputs
- Descriptor table → Fold summary: provides descriptors
- Molecular data → Gating and errors: provides inputs
- Descriptor table → Gating and errors: provides descriptors
- Gating and errors → Benchmark metrics: writes analysis
- Molecular data → Shared baseline data: loads and merges
- Shared baseline data → Classical models: supplies data
- Shared baseline data → SMILES CNN: supplies data
- Shared baseline data → CNN search: supplies data
- Shared baseline data → Transformer search: supplies data
- Shared baseline data → Fingerprint search: supplies data
- Shared baseline data → Ungated MLP tuning: supplies data
- SMILES CNN → CNN search: provides tokenization
- Classical models → Benchmark metrics: reports results
- CNN search → Benchmark metrics: reports results
- Transformer search → Benchmark metrics: reports results
- Fingerprint search → Benchmark metrics: reports results
- Ungated MLP tuning → Benchmark metrics: reports results
- Researcher → Robustness studies: runs documented studies
- Researcher → Paper figures: regenerates
