# genaibiomed/genaibiomedassignment1 architecture

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

- Interactive diagram: https://gitdiagram.com/genaibiomed/genaibiomedassignment1
- Repository: https://github.com/genaibiomed/genaibiomedassignment1

## Overview

This repository is an assignment-stage protein sequence language-modeling project, rather than the MkDocs preview workflow described in the README. Its intended user workflow is to load protein sequences, train a pretrained ProGen causal language model, then generate sequence designs. Training and inference remain incomplete: both contain NotImplementedError placeholders, and inference also leaves checkpoint loading and prediction unfinished. The architecture reflects only relationships visible in the supplied source excerpts and README; data files are inputs, not separately implemented subsystems.

Main entry points: [`inference.py`](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/inference.py) (Inference workflow), [`dataset.py`](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/dataset.py) (Dataset and batches), [`model.py`](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/model.py) (Causal LM), [`train.py`](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/train.py) (Training workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Sequence data"]
  node_protein_files["Protein splits"]
  node_dataset["Dataset and batches<br/>[dataset.py]"]
  node_vocab["Protein vocabulary<br/>[progen_vocab.py]"]
end

subgraph group_model["Model runtime"]
  node_causal_lm["Causal LM<br/>[model.py]"]
end

subgraph group_workflows["Training and design"]
  node_trainer["Training workflow<br/>[train.py]"]
  node_designer["Inference workflow<br/>[inference.py]"]
  node_checkpoint["Best checkpoint<br/>[train.py]"]
  node_design_output["Design sequences<br/>[inference.py]"]
end

node_engineer(("Assignment user"))
node_pretrained["Pretrained ProGen"]

node_engineer -->|"runs training"| node_trainer
node_engineer -->|"runs design"| node_designer
node_protein_files -->|"loads splits"| node_dataset
node_dataset -->|"encodes sequences"| node_vocab
node_trainer -->|"requests batches"| node_dataset
node_trainer -->|"loads and trains"| node_causal_lm
node_causal_lm -->|"saves weights"| node_checkpoint
node_designer -->|"requests test batches"| node_dataset
node_designer -->|"loads model"| node_causal_lm
node_pretrained -.->|"provides weights"| node_causal_lm
node_designer -.->|"loads weights"| node_checkpoint
node_designer -->|"writes designs"| node_design_output

click node_protein_files "https://github.com/genaibiomed/genaibiomedassignment1/tree/main/data"
click node_dataset "https://github.com/genaibiomed/genaibiomedassignment1/blob/main/dataset.py"
click node_vocab "https://github.com/genaibiomed/genaibiomedassignment1/blob/main/progen_vocab.py"
click node_trainer "https://github.com/genaibiomed/genaibiomedassignment1/blob/main/train.py"
click node_designer "https://github.com/genaibiomed/genaibiomedassignment1/blob/main/inference.py"
click node_causal_lm "https://github.com/genaibiomed/genaibiomedassignment1/blob/main/model.py"
click node_checkpoint "https://github.com/genaibiomed/genaibiomedassignment1/blob/main/train.py"
click node_design_output "https://github.com/genaibiomed/genaibiomedassignment1/blob/main/inference.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_protein_files,node_dataset,node_vocab,node_engineer toneBlue
class node_causal_lm toneAmber
class node_trainer,node_designer,node_checkpoint,node_design_output toneMint
class node_pretrained toneIndigo
```

## Components

### Sequence data

- [Protein splits](https://github.com/genaibiomed/genaibiomedassignment1/tree/main/data): `data`
- [Dataset and batches](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/dataset.py): `dataset.py`
- [Protein vocabulary](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/progen_vocab.py): `progen_vocab.py`

### Model runtime

- [Causal LM](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/model.py): `model.py`

### Training and design

- [Training workflow](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/train.py): `train.py`
- [Inference workflow](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/inference.py): `inference.py`
- [Best checkpoint](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/train.py): `train.py`
- [Design sequences](https://github.com/genaibiomed/genaibiomedassignment1/blob/main/inference.py): `inference.py`

### Other components

- **Assignment user**
- **Pretrained ProGen**

## Connections

- Assignment user → Training workflow: runs training (evidence: `train.py`)
- Assignment user → Inference workflow: runs design (evidence: `inference.py`)
- Protein splits → Dataset and batches: loads splits (evidence: `dataset.py`)
- Dataset and batches → Protein vocabulary: encodes sequences (evidence: `dataset.py`)
- Training workflow → Dataset and batches: requests batches (evidence: `train.py`)
- Training workflow → Causal LM: loads and trains (evidence: `train.py`)
- Causal LM → Best checkpoint: saves weights (evidence: `train.py`)
- Inference workflow → Dataset and batches: requests test batches (evidence: `inference.py`)
- Inference workflow → Causal LM: loads model (evidence: `inference.py`)
- Pretrained ProGen → Causal LM: provides weights
- Inference workflow → Best checkpoint: loads weights
- Inference workflow → Design sequences: writes designs (evidence: `inference.py`)
