# qiunao-nzbgy/becat architecture

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

- Interactive diagram: https://gitdiagram.com/qiunao-nzbgy/becat
- Repository: https://github.com/qiunao-nzbgy/becat

## Overview

BECAT is a plug-and-play graph-domain-adaptation adapter, released alongside nine citation-experiment backbone integrations. The documented workflow is to train a selected backbone on source and target graph data, refine its latent representations with BECAT, and pass refined embeddings to the downstream classifier while retaining the backbone’s original adaptation branch. The shared adapter’s geometry stages are documented in the README; integration call details are not uniformly shown in the sampled excerpts, so those links are marked unverified.

Main entry points: [`becat/torch/becat.py`](https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py) (PyTorch adapter), [`backbones/DANN`](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/DANN) (DANN integration), [`backbones/ASN`](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/ASN) (ASN integration), [`backbones/UDAGCN`](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/UDAGCN) (UDAGCN integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_adapter["Shared adapters"]
  node_latent_graph["Latent graph<br/>[becat.py]"]
  node_curvature["Curvature signatures<br/>[becat.py]"]
  node_geometry_alignment["Geometry alignment<br/>[becat.py]"]
  node_sparse_refinement["Sparse refinement<br/>[becat.py]"]
  node_torch_adapter["PyTorch adapter<br/>[becat.py]"]
  node_tf_adapter["TensorFlow adapter<br/>[becat.py]"]
end

subgraph group_torch_backbones["PyTorch integrations"]
  node_dann["DANN integration"]
  node_asn["ASN integration"]
  node_udagcn["UDAGCN integration"]
  node_grade["GRADE integration"]
  node_specreg["SpecReg integration"]
  node_pairalign["PairAlign integration"]
  node_a2gnn["A2GNN integration"]
  node_dgsda["DGSDA integration"]
end

subgraph group_tf_backbone["TensorFlow integration"]
  node_adagnn["AdaGCN integration"]
end

node_researcher(("Experiment runner"))
node_citation_data[("Citation graphs")]

node_researcher -->|"runs transfer"| node_dann
node_researcher -->|"runs transfer"| node_asn
node_researcher -->|"runs transfer"| node_udagcn
node_researcher -->|"runs transfer"| node_grade
node_researcher -->|"runs transfer"| node_specreg
node_researcher -->|"runs transfer"| node_pairalign
node_researcher -->|"runs transfer"| node_a2gnn
node_researcher -->|"runs transfer"| node_dgsda
node_researcher -->|"runs transfer"| node_adagnn
node_citation_data -->|"supplies data"| node_dann
node_dann -.->|"builds from embeddings"| node_latent_graph
node_latent_graph -->|"supports curvature"| node_curvature
node_curvature -->|"aligns statistics"| node_geometry_alignment
node_geometry_alignment -->|"refines embeddings"| node_sparse_refinement
node_sparse_refinement -->|"feeds classifier"| node_dann
node_asn -.->|"uses adapter"| node_torch_adapter
node_udagcn -.->|"uses adapter"| node_torch_adapter
node_grade -.->|"uses adapter"| node_torch_adapter
node_specreg -.->|"uses adapter"| node_torch_adapter
node_pairalign -.->|"uses adapter"| node_torch_adapter
node_a2gnn -.->|"uses adapter"| node_torch_adapter
node_dgsda -.->|"uses adapter"| node_torch_adapter
node_adagnn -.->|"uses adapter"| node_tf_adapter

click node_latent_graph "https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py"
click node_curvature "https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py"
click node_geometry_alignment "https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py"
click node_sparse_refinement "https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py"
click node_torch_adapter "https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py"
click node_dann "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/DANN"
click node_asn "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/ASN"
click node_udagcn "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/UDAGCN"
click node_grade "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/GRADE"
click node_specreg "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/SpecReg"
click node_pairalign "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/PairAlign"
click node_a2gnn "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/A2GNN"
click node_dgsda "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/DGSDA"
click node_adagnn "https://github.com/qiunao-nzbgy/becat/tree/main/backbones/AdaGCN"
click node_tf_adapter "https://github.com/qiunao-nzbgy/becat/blob/main/becat/tensorflow/becat.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_latent_graph,node_curvature,node_geometry_alignment,node_sparse_refinement,node_torch_adapter,node_tf_adapter toneBlue
class node_dann,node_asn,node_udagcn,node_grade,node_specreg,node_pairalign,node_a2gnn,node_dgsda,node_citation_data toneAmber
class node_adagnn toneMint
class node_researcher toneIndigo
```

## Components

### Shared adapters

- [Latent graph](https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py): `becat/torch/becat.py`
- [Curvature signatures](https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py): `becat/torch/becat.py`
- [Geometry alignment](https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py): `becat/torch/becat.py`
- [Sparse refinement](https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py): `becat/torch/becat.py`
- [PyTorch adapter](https://github.com/qiunao-nzbgy/becat/blob/main/becat/torch/becat.py): `becat/torch/becat.py`
- [TensorFlow adapter](https://github.com/qiunao-nzbgy/becat/blob/main/becat/tensorflow/becat.py): `becat/tensorflow/becat.py`

### PyTorch integrations

- [DANN integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/DANN): `backbones/DANN`
- [ASN integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/ASN): `backbones/ASN`
- [UDAGCN integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/UDAGCN): `backbones/UDAGCN`
- [GRADE integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/GRADE): `backbones/GRADE`
- [SpecReg integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/SpecReg): `backbones/SpecReg`
- [PairAlign integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/PairAlign): `backbones/PairAlign`
- [A2GNN integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/A2GNN): `backbones/A2GNN`
- [DGSDA integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/DGSDA): `backbones/DGSDA`

### TensorFlow integration

- [AdaGCN integration](https://github.com/qiunao-nzbgy/becat/tree/main/backbones/AdaGCN): `backbones/AdaGCN`

### Other components

- **Experiment runner**
- **Citation graphs**

## Connections

- Experiment runner → DANN integration: runs transfer (evidence: `README.md`)
- Experiment runner → ASN integration: runs transfer (evidence: `README.md`)
- Experiment runner → UDAGCN integration: runs transfer (evidence: `README.md`)
- Experiment runner → GRADE integration: runs transfer (evidence: `README.md`)
- Experiment runner → SpecReg integration: runs transfer (evidence: `README.md`)
- Experiment runner → PairAlign integration: runs transfer (evidence: `README.md`)
- Experiment runner → A2GNN integration: runs transfer (evidence: `README.md`)
- Experiment runner → DGSDA integration: runs transfer (evidence: `README.md`)
- Experiment runner → AdaGCN integration: runs transfer (evidence: `README.md`)
- Citation graphs → DANN integration: supplies data (evidence: `README.md`)
- DANN integration → Latent graph: builds from embeddings
- Latent graph → Curvature signatures: supports curvature (evidence: `README.md`)
- Curvature signatures → Geometry alignment: aligns statistics (evidence: `README.md`)
- Geometry alignment → Sparse refinement: refines embeddings (evidence: `README.md`)
- Sparse refinement → DANN integration: feeds classifier (evidence: `README.md`)
- ASN integration → PyTorch adapter: uses adapter
- UDAGCN integration → PyTorch adapter: uses adapter
- GRADE integration → PyTorch adapter: uses adapter
- SpecReg integration → PyTorch adapter: uses adapter
- PairAlign integration → PyTorch adapter: uses adapter
- A2GNN integration → PyTorch adapter: uses adapter
- DGSDA integration → PyTorch adapter: uses adapter
- AdaGCN integration → TensorFlow adapter: uses adapter
