# d9249/optgcn architecture

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

- Interactive diagram: https://gitdiagram.com/d9249/optgcn
- Repository: https://github.com/d9249/optgcn

## Overview

##### High-Level Architecture Components

The system should be divided into these main components:

a) Core Framework Layer:
- Base Module (`base/` directory)
- Model Implementation Layer (`model/graph/` directory)
- Data Management Layer (`data/` directory)
- Utility Services (`util/` directory)

b) Model Types:
- Graph-based Models
- Contrastive Learning Models
- Data Augmentation Models

##### Key Relationships to Highlight

a) Data Flow:
**Dataset -> Data Loader -> Model -> Embeddings -> Evaluation**

b) Model Inheritance Structure:
**Base Recommender**
- Graph Recommender
- Sequence Recommender
- SSL Interface

##### Detailed Component Breakdown

- Data Layer       |

- Raw Datasets        |
- Data Augmentation   |
- Graph Construction  |
- Feature Processing  |

- Model Layer       |

- Base Models         |
- Graph Models        |
- SSL Models          |
- Model Variants      |

- Training Layer     |

- Loss Functions      |
- Optimizers          |
- SSL Strategies      |

##### Connection Types

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

##### Additional Elements

- Version information
- Supported datasets
- Configuration flow
- Evaluation metrics
- Experimental components

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Core Framework"
        BaseModule["Base Module"]
        GraphRec["Graph Recommender"]
        SeqRec["Sequence Recommender"]
        SSLInterface["SSL Interface"]
        
        BaseModule --> GraphRec
        BaseModule --> SeqRec
        BaseModule --> SSLInterface
    end

    subgraph "Data Management"
        DataLoader["Data Loader"]
        DataAug["Data Augmentation"]
        GraphConst["Graph Construction"]
        FeatProc["Feature Processing"]
        
        DataLoader --> DataAug
        DataAug --> GraphConst
        GraphConst --> FeatProc
    end

    subgraph "Model Implementation"
        BaseModels["Base Models"]
        GraphModels["Graph Models"]
        SSLModels["SSL Models"]
        ModelVariants["Model Variants"]
        
        BaseModels --> GraphModels
        BaseModels --> SSLModels
        GraphModels --> ModelVariants
        SSLModels --> ModelVariants
    end

    subgraph "Training Layer"
        LossFuncs["Loss Functions"]
        Optimizers["Optimizers"]
        SSLStrat["SSL Strategies"]
        
        LossFuncs --> Optimizers
        SSLStrat --> Optimizers
    end

    subgraph "Storage & Output"
        Dataset["Dataset Storage"]
        Embeddings["Model Embeddings"]
        Config["Configuration Layer"]
        
        Dataset --> Embeddings
        Config --> Embeddings
    end

    Dataset --> DataLoader
    FeatProc --> BaseModels
    ModelVariants --> LossFuncs
    Optimizers --> Embeddings

    classDef core fill:#2374ab
    classDef data fill:#ff7f50
    classDef model fill:#4caf50
    classDef util fill:#9c27b0

    class BaseModule,GraphRec,SeqRec,SSLInterface core
    class DataLoader,DataAug,GraphConst,FeatProc data
    class BaseModels,GraphModels,SSLModels,ModelVariants model
    class LossFuncs,Optimizers,SSLStrat,Dataset,Embeddings,Config util

    click BaseModule "https://github.com/d9249/OptGCN/tree/main/base/"
    click GraphRec "https://github.com/d9249/OptGCN/blob/main/base/graph_recommender.py"
    click SeqRec "https://github.com/d9249/OptGCN/blob/main/base/seq_recommender.py"
    click SSLInterface "https://github.com/d9249/OptGCN/blob/main/base/ssl_interface.py"
    click DataLoader "https://github.com/d9249/OptGCN/blob/main/data/loader.py"
    click DataAug "https://github.com/d9249/OptGCN/blob/main/data/augmentor.py"
    click GraphConst "https://github.com/d9249/OptGCN/blob/main/data/graph.py"
    click FeatProc "https://github.com/d9249/OptGCN/blob/main/data/feature.py"
    click GraphModels "https://github.com/d9249/OptGCN/blob/main/model/graph/LightGCN.py"
    click SSLModels "https://github.com/d9249/OptGCN/blob/main/model/graph/SimGCL.py"
    click BaseModels "https://github.com/d9249/OptGCN/blob/main/model/graph/MF.py"
    click LossFuncs "https://github.com/d9249/OptGCN/blob/main/util/loss_torch.py"
    click Dataset "https://github.com/d9249/OptGCN/tree/main/dataset/"
    click Embeddings "https://github.com/d9249/OptGCN/tree/main/embedding/"
    click Config "https://github.com/d9249/OptGCN/tree/main/conf/"
```
