Downloads · 30 days
0
Sloudis/controllable-amp-design
controllable-amp-design is a machine learning model from Sloudis. 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.
Trained checkpoints for a conditional VAE that generates antimicrobial peptide (AMP) sequences targeting a user-specified potency (MIC, minimum inhibitory concentration) against E. coli, plus an independently trained…
Downloads · 30 days
0
Access
Public
Updated Aug 5, 2026
Repo size
34.6 MB
Likes
1
Public
Click a slice to open those files.
.pt17.3 MB · 100%
From the Hugging Face model README
Trained checkpoints for a conditional VAE that generates antimicrobial peptide (AMP) sequences targeting a user-specified potency (MIC, minimum inhibitory concentration) against E. coli, plus an independently trained CNN ("the Judge") that predicts MIC from sequence and is used to evaluate generated candidates.
report/report.pdf in the GitHub repo (methodology, training dynamics, evaluation)| File | Model | Params | Description |
|---|---|---|---|
cvae_best.pt | CVAE generator | ~3.99M | Bi-GRU encoder / autoregressive-GRU decoder, 32-dim latent |
judge_best.pt | Judge predictor | ~329K | Multi-scale residual 1-D CNN (kernel sizes 3/5/7) |
Generator (CVAE): a bidirectional, 3-layer GRU encoder (256 hidden units) maps a peptide sequence + a shared learned embedding of the normalized target log10(MIC) to a 32-dimensional diagonal-Gaussian latent. A 3-layer unidirectional GRU decoder (256 hidden units) is re-conditioned on the latent sample and the score embedding at every timestep, generating logits over a 22-symbol vocabulary (20 amino acids + PAD + EOS) autoregressively. Trained with a β-rescaled, free-bits ELBO objective (free bits = 0.1, β annealed over 50 epochs) and 30% word dropout to prevent posterior collapse.
Judge: parallel 1-D convolutions (kernel sizes 3, 5, 7) extract motifs at different receptive fields, concatenated to 128 channels, expanded to 256, passed through a residual block (with a 1×1-conv shortcut) back down to 128 channels, global-max-pooled, and regressed to a scalar (normalized log10 MIC) through a small MLP head. Trained independently of the CVAE, purely as a post-hoc evaluator — it never sees the conditioning score.
Requires the model definitions from the GitHub repo
(src/models/cvae.py, src/models/judge.py) and its data/dataset.py for the
vocabulary/encoding utilities.
import torch
from huggingface_hub import hf_hub_download
from models.cvae import CVAE
from models.judge import Judge
from data.dataset import decode_sequence, normalize_score, denormalize_score
cvae_path = hf_hub_download("Sloudis/controllable-amp-design", "cvae_best.pt")
judge_path = hf_hub_download("Sloudis/controllable-amp-design", "judge_best.pt")
cvae = CVAE()
cvae.load_state_dict(torch.load(cvae_path, map_location="cpu"))
cvae.eval()
judge = Judge()
judge.load_state_dict(torch.load(judge_path, map_location="cpu"))
judge.eval()
# See src/evaluation/generate.py in the GitHub repo for a full generation CLI,
# including score normalization against the training set's log_mic mean/std.
Measured on a held-out test set (1,000 sequences):
Stavros Loudis. "Controllable Antimicrobial Peptide Design via Conditional Variational
Autoencoders." Technical University of Crete, 2026.
MIT — see LICENSE in the GitHub repo.