Skip to content

Introducing coarse-grained molecular dynamics simulations and updates to training - #9

Open
datagato wants to merge 7 commits into
mainfrom
cg-experiments
Open

Introducing coarse-grained molecular dynamics simulations and updates to training#9
datagato wants to merge 7 commits into
mainfrom
cg-experiments

Conversation

@datagato

@datagato datagato commented Jun 27, 2026

Copy link
Copy Markdown
Owner

High-level updates from this PR:

  • Introduce coarse grained MD simulations using the Martini 3 force field (with solvent subtraction) for faster Proteogram generation (5-10x faster than atomistic)
  • Fixes to atomistic Proteogram creation for more consistent channel logic and stacking
  • New training script that does train/test split on-the-fly with seed argument for reproducibility (this can be used for k-fold cross-validation later on by simply changing the seed); also introduces use of focal loss (a flag on the command line) for the training loss function
  • PDB download script by date cutoff for future data pulls (when going beyond SCOPe)
  • Annotation script updates (want a "GO slim" as a future label for Proteograms for classification according to the Gene Ontology annotations (biological process, molecular function and cellular component)
  • Triplet-hierarchy metric learning (new proteogram/v2/losses.py): HierarchicalTripletLoss
    with SCOPe-distance-scaled margins + HierarchicalPKSampler (optional fold/superfamily
    stratification). Wired into the train script as --loss triplet_hierarchy, producing an
    L2-normalized embedding model trained and early-stopped on validation Precision@K rather
    than a classifier. Fully parameterized (embed_dim, triplet_p/k, margins, base_margin,
    families_per_stratum, min_family_size, stratify_level, early_stop_level) with collapse
    diagnostics (pos/neg distance, valid_anchor_frac, paired_frac). This is an optional path and the previous usage still applies.
  • ViT-B/16 architecture option (--model vit) alongside the from-scratch CNN and ResNet18,
    including fixed 224x224 resize handling (224x224 is required for this model so all proteograms must be resized) and trailing-block fine-tuning.
  • Self-describing checkpoints + padding consistency: Img2Vec auto-detects the {state_dict,
    meta} embedding format and exposes embedding_meta; measure_similarity_v2 and
    query_similar_proteins now derive the search-time pad target (and query length cutoff) from
    the checkpoint's recorded max_image_size, falling back to a new config search_pad_size.
    Fixes a silent train/eval mismatch that cropped/rescaled larger proteins at search time.
  • Bug fixes: DataLoader crash when --batch_size is omitted (config fallback wasn't written
    back to args, yielding batch_size=None), and roc_auc_score failure on 2-class eval sets.
  • Documentation updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant