MedLatents Documentation

Discrete and continuous latent generative models for medical imagery.

API Reference

Indices and tables

Features

Core Models

  • Autoregressive Transformer: Unidirectional generation with causal attention

  • MaskGIT: Bidirectional masked transformer for parallel decoding

  • Discrete DiT: Diffusion transformer for discrete latent spaces (D3PM)

  • Flow Matching: Discrete and continuous flow-based generation

  • Bayesian Flow Networks: Probabilistic flow models

Advanced Features

  • Halton Scheduler: Spatially-dispersed unmasking for MaskGIT

  • KLASS Early Stopping: Adaptive stopping based on KL divergence

  • Time-Dependent CFG: Dynamic classifier-free guidance schedules

  • Speculative Decoding: Accelerated autoregressive generation

  • Rectified Flow++: Iterative reflow for straighter trajectories

Medical Domain

  • Rasterization: Space-filling curves (Hilbert, Z-order) for spatial-to-sequence

  • Inpainting: Fill missing regions in medical images

  • Super-Resolution: Upscale low-resolution medical scans

  • Clinical Metrics: Dice, IoU, PSNR, SSIM evaluation