# hiyouga/dual-contrastive-learning architecture

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

- Interactive diagram: https://gitdiagram.com/hiyouga/dual-contrastive-learning
- Repository: https://github.com/hiyouga/dual-contrastive-learning

## Overview

No explanation provided

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        style Legend fill:#f5f5f5,stroke:#333
        L1[Processing Module]:::process
        L2[(Data Storage)]:::storage
        L3{Decision Point}:::decision
        L4([Technology]):::tech
    end

    subgraph Data_Processing["Data Processing Layer"]
        style Data_Processing fill:#e6f3ff,stroke:#333
        DataUtils["Data Utilities"]:::process
        click DataUtils "https://github.com/hiyouga/Dual-Contrastive-Learning/blob/main/data_utils.py"
        
        subgraph Datasets["Input Datasets"]
            style Datasets fill:#f0f0f0
            CR[("CR Dataset")]:::storage
            SST2[("SST2 Dataset")]:::storage
            SUBJ[("SUBJ Dataset")]:::storage
            TREC[("TREC Dataset")]:::storage
            ProCon[("ProCon Dataset")]:::storage
            click CR "https://github.com/hiyouga/Dual-Contrastive-Learning/tree/main/data"
            click SST2 "https://github.com/hiyouga/Dual-Contrastive-Learning/tree/main/data"
            click SUBJ "https://github.com/hiyouga/Dual-Contrastive-Learning/tree/main/data"
            click TREC "https://github.com/hiyouga/Dual-Contrastive-Learning/tree/main/data"
            click ProCon "https://github.com/hiyouga/Dual-Contrastive-Learning/tree/main/data"
        end
    end

    subgraph Model_Architecture["Model Architecture Layer"]
        style Model_Architecture fill:#e6ffe6,stroke:#333
        DualCL["Core DualCL Model"]:::process
        click DualCL "https://github.com/hiyouga/Dual-Contrastive-Learning/blob/main/model.py"
        Loss["Loss Computation"]:::process
        click Loss "https://github.com/hiyouga/Dual-Contrastive-Learning/blob/main/loss_func.py"
        Config["Configuration Management"]:::process
        click Config "https://github.com/hiyouga/Dual-Contrastive-Learning/blob/main/config.py"
    end

    subgraph Training_Pipeline["Training Pipeline"]
        style Training_Pipeline fill:#fff2e6,stroke:#333
        Main["Main Execution Flow"]:::process
        click Main "https://github.com/hiyouga/Dual-Contrastive-Learning/blob/main/main.py"
        Train{"Training Loop"}:::decision
        Eval{"Evaluation"}:::decision
    end

    subgraph Tech_Stack["Technical Stack"]
        style Tech_Stack fill:#f5f5f5,stroke:#333
        PyTorch(["PyTorch"]):::tech
        Python(["Python 3.7"]):::tech
        Transformers(["Transformers"]):::tech
        NumPy(["NumPy"]):::tech
    end

    %% Relationships
    CR & SST2 & SUBJ & TREC & ProCon --> DataUtils
    DataUtils --> DualCL
    DualCL --> Loss
    Config --> DualCL
    Config --> Loss
    DualCL & Loss --> Train
    Train --> Eval
    Main --> Train

    %% Styles
    classDef process fill:#fff,stroke:#333
    classDef storage fill:#ddd,stroke:#333
    classDef decision fill:#ffe6cc,stroke:#333
    classDef tech fill:#f9f9f9,stroke:#666,stroke-dasharray: 5 5
```
