Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a9cc0c3
chore: add mirpy-free requirements and standardizer equivalence check
demidovamaria Jul 17, 2026
439f8f1
refactor(datasets): add encode_fn injection point to Forward/InverseD…
demidovamaria Jul 17, 2026
83f1e39
feat: add WordPiece train-corpus preparation script
demidovamaria Jul 17, 2026
a14a44a
feat: restructure WordPiece output layout, mark vocab_size=100 as san…
demidovamaria Jul 17, 2026
489f9d1
feat: add no-cache batch loader as alternative to shard-based batch_c…
demidovamaria Jul 21, 2026
695d572
feat: add tokenization statistics script with alarm checks and plots
demidovamaria Jul 21, 2026
ff5b759
fix: switch train_forward.py to use batch_nocache (streaming reader b…
demidovamaria Jul 21, 2026
6614f61
calc_tokenization_stats: read vocab_size grid from training summary, …
demidovamaria Jul 22, 2026
6709f87
add convert_pool_to_airr.py: adapt Zenodo pool file to AIRR schema
demidovamaria Jul 22, 2026
70aac1b
calc_tokenization_stats: add compact top_tokens_summary.txt
demidovamaria Jul 22, 2026
78a6460
add tokenizer_stats_report.ipynb: unified visual report for tokenizat…
demidovamaria Jul 22, 2026
7e9ea7e
calc_tokenization_stats: integrate top-token position analysis
demidovamaria Jul 23, 2026
3969b86
calc_tokenization_stats: add relative-position histogram, enrich text…
demidovamaria Jul 23, 2026
e9f65a5
tokenizer_stats_report.ipynb: add top-token position analysis section
demidovamaria Jul 23, 2026
ceaaf67
Saved the splits in data, summary contains with info.
Consoooomer Jul 29, 2026
d13a4da
Match special-token numbering between char and WordPiece tokenizers
demidovamaria Jul 29, 2026
e1c5bc6
Add WordPiece tokenizer as an alternative to the char one
demidovamaria Jul 29, 2026
c409174
Add missing __len__ to ForwardDataset and InverseDataset
demidovamaria Jul 29, 2026
44aaa0e
Let train_forward pick char or WordPiece from the command line
demidovamaria Jul 29, 2026
52c2bde
Add one shared place to resolve char vs WordPiece
demidovamaria Jul 29, 2026
65ccee4
Note where WordPiece support and the length_logits bug need fixing.
demidovamaria Jul 29, 2026
412a171
Add a harness to compare char vs WordPiece on the forward task
demidovamaria Jul 29, 2026
08011f1
Add a harness to compare char vs WordPiece on the forward task
demidovamaria Jul 29, 2026
2fba211
Actually apply the computed embedding standardizer before training
demidovamaria Jul 29, 2026
7ec484e
Save results incrementally and make runs resumable
demidovamaria Jul 29, 2026
978f8d0
Add a notebook to visualize the char vs WordPiece comparison
demidovamaria Jul 30, 2026
8790782
Save per-epoch train/val metrics for each run
demidovamaria Jul 30, 2026
2c137fb
Add vocab filtering by max token length
demidovamaria Aug 1, 2026
8b9e423
Add --max-token-len to filter WordPiece vocabs by token length
demidovamaria Aug 1, 2026
245e823
Fix PAD/UNK leaking into decode() output after filtering
demidovamaria Aug 1, 2026
ce7b00c
Point report notebooks at latest runs, add convergence-curves noteboo…
demidovamaria Aug 1, 2026
a827d67
Ignore the reports/ folder
demidovamaria Aug 1, 2026
f5f9d66
Add padding-investigation scripts: per-vocab max_len vs fixed
demidovamaria Aug 2, 2026
29760f1
Add frozen-representation caching and PCA bottleneck for reconstructi…
Consoooomer Aug 3, 2026
555180d
script for slurm
Consoooomer Aug 4, 2026
c1d828c
Add reconstruction results collector and trim the array time limit
Consoooomer Aug 4, 2026
f53870a
fix comment in script
Consoooomer Aug 4, 2026
8eac79d
fix for write to out
Consoooomer Aug 4, 2026
db17d9b
add report results
Consoooomer Aug 4, 2026
4d31ef6
Pretrain the sequence-to-TCRemP encoder on the benchmark split
Consoooomer Aug 4, 2026
fd203ff
Add Pgen benchmark arms, Slurm array and results collector
Consoooomer Aug 4, 2026
3a57bce
Add anchored padding as an alternative to end-padding
demidovamaria Aug 6, 2026
1558cc7
Expose dropout as a CLI flag
demidovamaria Aug 6, 2026
e48434d
Wire up --pad-layout in the comparison script
demidovamaria Aug 6, 2026
7837d28
Add anchored-padding experiment scripts, with and without extra dropout
demidovamaria Aug 6, 2026
666ad4d
Set PYTHONPATH inside the scripts
demidovamaria Aug 6, 2026
166b485
Fix encode_wordpiece silently truncating on overflow
demidovamaria Aug 6, 2026
67f05c1
Fix the epoch-curves notebook silently dropping anchored-padding runs
demidovamaria Aug 7, 2026
adef5a2
Fix the epoch-curves notebook silently dropping anchored-padding runs
demidovamaria Aug 7, 2026
c6b1156
Fix mixed pad_layout/max_token_len
demidovamaria Aug 7, 2026
b6c4fe3
Add --hidden-dim/--num-conv-blocks, tracked like pad_layout
demidovamaria Aug 7, 2026
4f23461
Add architecture-sweep scripts (hidden_dim / num_conv_blocks)
demidovamaria Aug 7, 2026
16df081
Add extra-seed array, end-to-end speed benchmark and a significance test
Consoooomer Aug 8, 2026
53ae419
Call training directly instead of through an inner srun
Consoooomer Aug 8, 2026
1950f3b
Extend the extra-seed array to the 1k and 10k splits
Consoooomer Aug 8, 2026
ddcb927
Add Pgen results and limitations to the report
Consoooomer Aug 8, 2026
54acc94
Add cosine LR schedule and a dependency chain for the Pgen rerun
Consoooomer Aug 8, 2026
d3c0b91
Update Pgen results after the cosine-schedule rerun
Consoooomer Aug 9, 2026
d437f96
Point the report at the archived constant-lr results
Consoooomer Aug 11, 2026
93b63b6
Add benchmark result CSVs
Aug 11, 2026
e5fefbb
Add hidden_dim/num_conv_blocks awareness to both notebooks
demidovamaria Aug 11, 2026
7b0e7f1
Add a unified notebook comparing all 5 architecture runs
demidovamaria Aug 11, 2026
603ea76
Add reconstruction result CSVs
Consoooomer Aug 13, 2026
b96f06e
Merge reconstruction results from issue-2 branch
Consoooomer Aug 13, 2026
9abb43c
Add multitask tokenizer and evaluation pipeline
VEK239 Aug 14, 2026
bf973c3
Merge Maria Demidova tokenizer experiments preserving original commits
VEK239 Oct 4, 2026
672dc1e
Merge student reconstruction and Pgen benchmarks preserving original …
VEK239 Oct 4, 2026
c053934
Merge VEK239 main after student work, retaining memory-mapped prepara…
VEK239 Oct 4, 2026
2a59bfd
Merge author multitask tokenizer and evaluation pipeline preserving s…
VEK239 Oct 4, 2026
296404b
Preserve local author benchmark, geometry-loss, factorial and VDJdb work
VEK239 Oct 4, 2026
461ef56
Prepare canonical publication repository and resolve cross-branch com…
VEK239 Oct 4, 2026
27ac824
Normalize publication file endings
VEK239 Oct 4, 2026
2aa33a0
Preserve author result summaries and normalize UTF-8 release text
VEK239 Oct 4, 2026
436cf4e
Archive author publication tables with their recorded provenance
VEK239 Oct 4, 2026
f191aca
Preserve empty result-table fields and explicit publication line endings
VEK239 Oct 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto
*.py text eol=lf
*.sh text eol=lf
*.sbatch text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.md text eol=lf
*.tsv text eol=lf whitespace=-blank-at-eol
*.csv text eol=lf
*.json text eol=lf
18 changes: 18 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CPU tests
on:
push:
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- run: python -m pip install torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu
- run: python -m pip install -r requirements-dev.txt
- run: python -m compileall -q irrm_codec benchmark scripts tests
- run: python -m pytest -q
- run: find scripts slurm benchmark/slurm -type f \( -name '*.sh' -o -name '*.sbatch' \) -print0 | xargs -0 -n1 bash -n
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,16 @@ data/

# Reports
reports/

# Generated experiments and local publication scratch
.publish-*/
.tmp*/
tmp/
output/
manuscript/
*.pt
*.pth
*.npy
*.npz
experiments/**/wandb/
experiments/**/predictions/
46 changes: 43 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,51 @@ working with TCR CDR3 amino-acid sequences, TCRemP embeddings, and generation pr

- forward model: predicts a TCRemP embedding from CDR3 sequence input
- inverse model: reconstructs a CDR3 sequence from a TCRemP embedding
- joint Transformer: maps char- or WordPiece-tokenized CDR3s through one 320-D
bottleneck and jointly predicts TCRemP, `log10(pgen)`, and the original CDR3
- joint Transformer: maps char- or WordPiece-tokenized CDR3s through a configurable latent
bottleneck (320 dimensions by default; 128 in the DATA-ANCHOR study) and jointly predicts TCRemP, `log10(pgen)`, and the original CDR3

The repository is organized as a small training package with Python entrypoints, Slurm launchers, and analysis notebooks for both single-run and multi-chain workflows.

## Canonical repository and publication workflows

The maintained repository is [VEK239/irrm-codec](https://github.com/VEK239/irrm-codec).
It combines the original Antigenomics implementation, student contributions, and
Elizaveta Vlasova's joint RTP-CODEC and evaluation work. Original contributor
commits remain in the Git history; see [integration provenance](docs/integration_provenance.md).

The joint codec uses **R** (sequence reconstruction), **T** (TCRemP prediction),
and **P** (generation-probability prediction) supervision. Input tokenizers include
characters, WordPiece, and sequence-only terminal anchors. Reconstruction always
uses character tokens. Latent width is configurable and is independent of the
Transformer hidden width.

- Joint codec and matched objective/tokenizer studies: `irrm_codec/train_multitask.py`,
`benchmark/prepare_trb_joint.py`, `experiments/trb/`, and [tokenizer study](docs/anchored_tokenizer_study.md).
- Student reconstruction/Pgen benchmarks: `benchmark/prepare_splits.py`,
`benchmark/train_decoder.py`, `benchmark/train_pgen_arm.py`, and [historical report](REPORT.md).
- Author external-model, residue-PCA, latent, and VDJdb evaluations: `benchmark/`
and their matching launchers in `slurm/`.
- Historical result tables: `results/` (student runs) and `results/author/` (author runs). They describe the original runs, not a
new rerun of this integrated revision.

For a CPU development setup without the Pgen-generation dependency:

```bash
python -m venv .venv
# Linux/macOS: source .venv/bin/activate
# PowerShell: .\.venv\Scripts\Activate.ps1
python -m pip install torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements-dev.txt
python -m pytest -q
python -m irrm_codec.train_multitask --help
```

Install `requirements.txt` for OLGA/Pgen generation through mirpy. Install
`requirements-benchmark.txt` only when running the optional ESM/TCR-BERT/SCEPTR
encoders; their model weights and external datasets are obtained separately.
See [reproduction and compatibility notes](docs/publication.md) before reusing
historical checkpoints or submitting cluster examples.

## Repository layout

- `irrm_codec/`: package with data loading, tokenization, datasets, models, losses, utilities and training entrypoints
Expand Down Expand Up @@ -48,7 +88,7 @@ Register the environment as a Jupyter kernel:
python -m ipykernel install --user --name irrm-codec --display-name "Python (irrm-codec)"
```

Project dependencies, including notebook packages, are installed from [requirements.txt](/c:/Users/lizzka239/projects/irrm-codec/requirements.txt).
Project dependencies, including notebook packages, are installed from [requirements.txt](requirements.txt).

## Input data

Expand Down
Loading
Loading