Views
No views yet
MitoSeqTransformer), amino-acid
sequence in, codon sequence out.data/ and src/data/ for the pipeline)| Metric | MitoSeqGen (this model) |
|---|---|
| mean mt-CAI | 0.866 |
| genetic-code compliance rate | 1.000 |
| mean BLEU-4 vs. natural CDS | 0.313 |
| mean GC-content deviation from natural | 0.040 |
| mean MFE deviation from natural (kcal/mol) | 36.07 |
| novel-sequence rate | 1.000 |
pytorch_model.pt — inference-only checkpoint: {"model_state_dict", "config", "epoch", "val_loss"}. Optimizer/scheduler state was stripped (not needed for
inference); this is not a drop-in replacement for resuming training.config.json — the full training config (data paths, model hyperparameters,
training hyperparameters, hardware settings) for this run.MitoSeqTransformer class and vocabularies from the training repo
(src/models/transformer.py, src/genetic_codes.py). This checkpoint does not
include a HF transformers-compatible wrapper — load it directly with PyTorch:1import torch
2from src.models.transformer import MitoSeqTransformer
3from src.genetic_codes import AA_VOCAB, VOCAB # from the training repo
4
5ckpt = torch.load("pytorch_model.pt", map_location="cpu")
6cfg = ckpt["config"]["model"]
7
8model = MitoSeqTransformer(
9 src_vocab_size=len(AA_VOCAB),
10 tgt_vocab_size=len(VOCAB),
11 d_model=cfg["d_model"],
12 nhead=cfg["nhead"],
13 num_encoder_layers=cfg["num_encoder_layers"],
14 num_decoder_layers=cfg["num_decoder_layers"],
15 dim_feedforward=cfg["dim_feedforward"],
16 dropout=cfg["dropout"],
17 max_position_embeddings=cfg["max_position_embeddings"],
18)
19model.load_state_dict(ckpt["model_state_dict"])
20model.eval()
21
22# then use src.models.generate.generate_cds(model, protein_sequence, device="cpu")