# bengutteridge/drew architecture

> Architecture diagram of the GitHub repository bengutteridge/drew, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bengutteridge/drew
- Repository: https://github.com/bengutteridge/drew

## Overview

##### Main Components

a) Core Architecture Components:
- DRew Message Passing System
- Model Implementations (GCN, GIN, GAT, etc.)
- Training Pipeline
- Dataset Handlers

b) Experimental Frameworks:
- LRGB Framework
- QM9 Framework
- RingTransfer Framework

**[Data Layer]**
- ↓
**[Processing Layer]**
- ↓
**[Model Layer]**
- ↓
**[Training Layer]**
- ↓
**[Evaluation Layer]**

##### Specific Component Details

Data Layer:
- LRGB Datasets (PCQM, Peptides, etc.)
- QM9 Dataset
- RingTransfer Dataset
- Data transformation components
- Data loading pipelines

Processing Layer:
- Graph Processing Components
- Feature Extraction
- Data Augmentation
- Encoding Modules

Model Layer:
- DRew Core Implementation
- Message Passing Networks:
- GCN
- GIN
- GAT
- Custom Implementations
- Model Configurations

Training Layer:
- Training Loops
- Loss Functions
- Optimization Components
- Experiment Tracking

Evaluation Layer:
- Metrics Collection
- Results Aggregation
- Performance Analysis

##### Additional Elements

Specific callouts for:
- Configuration Management
- Experiment Tracking
- Model Parameter Management
- Dataset Split Handling

##### Implementation Details

- Message Passing Mechanisms
- Dynamic Rewiring Process
- Delay Implementation
- Model Architecture Variations

##### Subcomponent Details

For each major component, include:
- Input/Output specifications
- Key parameters
- Dependencies
- Configuration options

- Modular nature of the implementation
- Experimental framework separation
- Clear boundaries between different implementation approaches
- Version control and dependency management aspects
- Critical paths and potential bottlenecks

Remember to include version information and any critical dependencies, as this will be important for reproduction and maintenance of the system.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Data["Data Layer"]
        PCQM["PCQM4M Dataset"]:::data
        PepF["Peptides Functional"]:::data
        PepS["Peptides Structural"]:::data
        RingD["Ring Transfer Dataset"]:::data
        QM9D["QM9 Dataset"]:::data
        DL["Dataset Loaders"]:::data
    end

    subgraph Process["Processing Layer"]
        GP["Graph Processing"]:::process
        FE["Feature Extraction"]:::process
        DA["Data Augmentation"]:::process
        PE["Position Encoding"]:::process
    end

    subgraph Models["Model Layer"]
        subgraph Drew["DRew Core"]
            DMP["Message Passing System"]:::drew
            DGC["DRew GCN Conv"]:::drew
            DGG["DRew Gated GCN"]:::drew
            DGIN["DRew GIN"]:::drew
        end

        subgraph BaseModels["Base Models"]
            GCN["GCN"]:::model
            GAT["GAT"]:::model
            GIN["GIN"]:::model
            GINE["GINE"]:::model
        end
    end

    subgraph Train["Training Layer"]
        TL["Training Loops"]:::train
        LF["Loss Functions"]:::train
        OC["Optimization"]:::train
        ET["Experiment Tracking"]:::train
    end

    subgraph Eval["Evaluation Layer"]
        MC["Metrics Collection"]:::eval
        RA["Results Aggregation"]:::eval
        PA["Performance Analysis"]:::eval
    end

    subgraph Config["Configuration"]
        CM["Config Management"]:::config
        MP["Model Parameters"]:::config
        DS["Dataset Splits"]:::config
    end

    %% Connections
    Data --> Process
    Process --> Models
    Models --> Train
    Train --> Eval
    Config --> Models
    Config --> Train
    Config --> Process

    %% Framework Connections
    LRGB["LRGB Framework"]:::framework --> Drew
    QM9F["QM9 Framework"]:::framework --> BaseModels
    RTF["RingTransfer Framework"]:::framework --> RingD

    %% Style Definitions
    classDef data fill:#90EE90
    classDef process fill:#ADD8E6
    classDef model fill:#FFB6C1
    classDef drew fill:#4169E1
    classDef train fill:#DDA0DD
    classDef eval fill:#F0E68C
    classDef config fill:#D3D3D3
    classDef framework fill:#FFA07A

    %% Click Events
    click DMP "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/layer/drew_gcnconv.py"
    click DGC "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/layer/drew_gcnconv.py"
    click DGG "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/layer/drew_gatedgcn_layer.py"
    click DGIN "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/network/drew_gin.py"
    click GCN "https://github.com/BenGutteridge/DRew/blob/main/qm9/src/models/gcn.py"
    click GAT "https://github.com/BenGutteridge/DRew/blob/main/qm9/src/models/gat.py"
    click GIN "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/network/GIN.py"
    click GINE "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/network/GINE.py"
    click TL "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/train/custom_train.py"
    click DL "https://github.com/BenGutteridge/DRew/blob/main/qm9/src/utils/dataset_loader.py"
    click RingD "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/loader/dataset/ring_transfer.py"
    click LRGB "https://github.com/BenGutteridge/DRew/tree/main/lrgb/graphgps/"
    click QM9F "https://github.com/BenGutteridge/DRew/tree/main/qm9/src/"
    click RTF "https://github.com/BenGutteridge/DRew/tree/main/lrgb/configs/paper_configs/RINGTRANSFER/"
    click CM "https://github.com/BenGutteridge/DRew/tree/main/lrgb/graphgps/config/"
    click MC "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/metrics_ogb.py"
    click RA "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/metric_wrapper.py"
    click PA "https://github.com/BenGutteridge/DRew/blob/main/lrgb/aggr_results/gather_results.p"
    click PepF "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/loader/dataset/peptides_functional.py"
    click PepS "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/loader/dataset/peptides_structural.py"
    click PCQM "https://github.com/BenGutteridge/DRew/blob/main/lrgb/graphgps/loader/dataset/pcqm4mv2_contact.py"
```
