Downloads · 30 days
17
32% of all-time downloads
Sravankumarbonthada/mitoseqgen
mitoseqgen is a machine learning model from Sravankumarbonthada. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
📄 Preprint: https://www.researchsquare.com/article/rs-10901669/v1
Downloads · 30 days
17
32% of all-time downloads
All-time downloads
53
Public
Repo size
404 MB
Likes
0
Public
Click a slice to open those files.
.pt404 MB · 100%
From the Hugging Face model README
📄 Preprint: https://www.researchsquare.com/article/rs-10901669/v1
MitoSeqGen is a sequence-to-sequence Transformer that generates mitochondrial coding sequences (CDS) from an input amino-acid (protein) sequence, respecting the vertebrate mitochondrial genetic code and codon usage patterns learned from mitochondrial genomes.
This checkpoint is the cross-entropy baseline model (referred to as "Model 1" in the project's internal comparisons) — of the variants evaluated so far it has the best BLEU / mt-CAI tradeoff and the lowest GC-content drift from natural sequences.
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 |
mt-CAI = mitochondrial codon adaptation index; MFE = minimum free energy (RNA secondary structure, via ViennaRNA). Compared against lookup-table, random-synonymous, most-frequent-codon, and CodonTransformer-remap baselines in the source repo's evaluation reports.
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.Requires the 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:
import torch
from src.models.transformer import MitoSeqTransformer
from src.genetic_codes import AA_VOCAB, VOCAB # from the training repo
ckpt = torch.load("pytorch_model.pt", map_location="cpu")
cfg = ckpt["config"]["model"]
model = MitoSeqTransformer(
src_vocab_size=len(AA_VOCAB),
tgt_vocab_size=len(VOCAB),
d_model=cfg["d_model"],
nhead=cfg["nhead"],
num_encoder_layers=cfg["num_encoder_layers"],
num_decoder_layers=cfg["num_decoder_layers"],
dim_feedforward=cfg["dim_feedforward"],
dropout=cfg["dropout"],
max_position_embeddings=cfg["max_position_embeddings"],
)
model.load_state_dict(ckpt["model_state_dict"])
model.eval()
# then use src.models.generate.generate_cds(model, protein_sequence, device="cpu")