heart-gen/BSVAE: v0.3.2

Read full text
Authors: Kynon J.M. Benjamin
Cited by: 0

Abstract

v0.3.2 — 2026-03-20 This release focuses on hierarchical-loss correctness, training stability, and extraction performance, including a ~46× speedup in hierarchical-loss computation during the GMM phase. Bug Fixes Hierarchical loss deduplication: Fixed a bug where repeated draws of the same isoform within a batch were treated as separate isoforms, incorrectly triggering hierarchical loss when only one distinct isoform was present. Deduplication now uses dataset feature indices with stable ordering before constructing within-gene pairs. normalize_input round-trip: Added a normalize_input flag to WarmupLoss and propagated it through save_model() and load_model(), ensuring the setting is preserved across checkpoints. Dead component revival: Fixed dead-component revival during training to reset to a uniform prior (0.0) rather than copying the best component's log_pi, which could bias recovery. Encoder call: Fixed an encoder() → encode() call bug in training.py. Self-similarity exclusion: extract_networks.py now correctly excludes self-edges when constructing cosine kNN graphs. Module extraction: Replaced an O(n) weight-index search with an O(1) dictionary lookup in module_extraction.py, and removed a spurious negative-weight assertion that could incorrectly fail on valid signed edges. save_model() stability: Stopped moving the model to CPU before saving, which could corrupt the on-disk state if torch.save() failed, such as during disk-full errors. Performance Hierarchical loss fast path (~46× speedup): Replaced O(G × n_iso) GPU tensor equality checks per batch with O(B) Python dictionary lookups. A precomputed idx_to_gene reverse mapping is now built once in Trainer.__init__ and passed to hierarchical_loss(). On a 12k-feature dataset, this reduces GMM-phase epoch time from ~46 s to ~1–2 s. Default Changes --free-bits default changed from 0.5 to 0.0: Non-zero values can floor γ toward a near-uniform distribution and impair GMM cluster recovery. --bal-strength default changed from 0.01 to 0.1: Updated across bsvae-train, sweep_k, and GMMVAELoss to better prevent dead components. Tests Added isoform-level tests covering hierarchical-loss deduplication. Added normalize_input=True round-trip tests for training and model I/O. v0.3.1 — 2026-02-27 New Features K-sweep CLI (bsvae-sweep-k): Added a command to train models across a range of K values and compare clustering quality metrics, helping users select the number of GMM components. Prior freezing: Added support for freezing GMM priors during specific training phases. Bug Fixes Clustering collapse: Fixed a bug where GMM components could collapse into a single cluster during training. Added stall detection and changed KMeans initialization to run on μ (encoder mean) rather than sampled z. ρ computation: Fixed a bug where ρ was not using the correct γ-weighted computation. gmm_weight scaling: Removed erroneous gmm_weight scaling that could distort the relative contribution of the GMM term during optimization.

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
21 March 2026