Skip to content

Sequences, streaming data, robotics, and scientific extensions · Entry index · SEQ011 · Model

MVAE: product-of-experts multimodal variational autoencoder

A multimodal variational autoencoder using modality-specific inference experts to combine available evidence about a shared latent variable.

Partly runs in CodeSplash (Experimental) Component demo, not a trained model CodeSplash's own run

In CodeSplash

A CodeSplash method covers part of this entry; some options or variants aren't built yet. The methods that run it are Experimental.

Do it in CodeSplash Run it on your own data. It's in the Experimental lane in the app.

Availability
Partly runs in CodeSplash (Experimental)
Code example
Component demo, not a trained model
Who ran it
CodeSplash's own run
CodeSplash's run
Verified in Python and R through discover.vae. The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review, but on a different version of the code. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

A multimodal variational autoencoder using modality-specific inference experts to combine available evidence about a shared latent variable. It supports inference from different observed modality subsets and training with incomplete multimodal observations. This is a particular probabilistic construction, not a universal solution for arbitrary missing data.

Question / hypotheses

What shared latent representation and missing-modality predictions are supported by the modalities currently observed? There is no built-in H0. Evaluate held-out conditional likelihood, reconstruction/generation quality, and uncertainty under relevant patterns of missing modalities.

Architecture / computational structure

Each observed modality contributes an approximate latent expert; their product with the prior defines a fused latent distribution. Modality decoders reconstruct or generate observations from latent samples. Removing an unavailable expert changes the posterior calculation without requiring a separate encoder for every subset.

Assumptions

The generative model commonly assumes observations are conditionally independent given the latent state. Gaussian product-of-experts inference is an approximation whose experts can become overly concentrated. Missingness patterns and paired training coverage matter; a shared latent variable does not automatically separate causal factors or remove modality-specific bias.

Formula / computational definition

Write q(z∣xS)∝p(z)∏m∈Sq~m(z∣xm)q(z\mid x_S)\propto p(z)\prod_{m\in S}\tilde q_m(z\mid x_m), where q~m\tilde q_m denotes an expert factor, avoiding an implicit repeated-prior interpretation. For scalar Gaussian experts, τ=τ0+∑mτm\tau=\tau_0+\sum_m\tau_m and μ=(τ0μ0+∑mτmμm)/τ\mu=(\tau_0\mu_0+\sum_m\tau_m\mu_m)/\tau. Training uses suitable subset ELBOs with reconstruction terms and a KL penalty.

Parameters and notation

Learned parameters: each modality encoder/expert and decoder, shared latent model, and variance outputs. Hyperparameters: latent dimension, expert parameterization, reconstruction likelihoods, subset sampling, KL weighting, and modality loss scaling. Larger expert precision increases its influence and may produce unjustified certainty if miscalibrated.

Fitting, fine-tuning, and adaptation

Fit subset-specific objectives on available paired/unpaired observations according to the paper’s scheme. On adding a modality, train its encoder/decoder against a stable shared latent system first, then jointly fine-tune with old-modality retention checks. Validate observed-subset patterns explicitly; reconstruction loss scales must reflect their likelihood definitions.

How to use and calibrate

Evaluate every deployment-relevant modality subset, including genuinely incomplete cases rather than only randomly dropped inputs. Inspect cross-modal predictions, posterior variance, and whether one expert dominates. Use patient/person/object group splits when multiple modalities describe the same underlying entity.

Example application

Combine two noisy synthetic sensor channels to estimate a shared latent position, then remove one sensor and verify that the example posterior variance increases.

Interpretation / pitfalls

Watch out

Python: a custom PyTorch/JAX MVAE or authors’ implementation; R: reticulate for training and native Gaussian calculations. The example evaluates exact scalar Gaussian expert multiplication with fixed inputs; it does not fit encoders, decoders, or an ELBO.

Python and R code examples (dependencies/validation)

Python uses NumPy and the shared mse helper when called; base R uses the shared helper when called. Validation: Python component executed; R companion reviewed, not executed. Scope: the specific component described above, not the full model or its training.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — synthetic mathematical component, not a full-model implementation

Shared setup for this chapter
import numpy as np

def mse(a,b):
    a,b=np.asarray(a),np.asarray(b)
    if a.shape!=b.shape or a.size==0:
        raise ValueError("MSE needs nonempty equal shapes")
    return float(np.mean((a-b)**2))
mu=np.array([.8,1.2]); variance=np.array([.25,.5]); precision=1/variance
post_var=1/(1+precision.sum()); post_mean=post_var*np.sum(precision*mu)
missing_var=1/(1+precision[0]); assert missing_var>post_var
result={"mean":float(post_mean),"variance":float(post_var),"one_modality_variance":float(missing_var)}
print(result)
R

Component demo, not a trained model — synthetic mathematical component, not a full-model implementation

Shared setup for this chapter
mse <- function(a,b) {
  stopifnot(length(a)>0L, identical(dim(a),dim(b)), length(a)==length(b))
  mean((a-b)^2)
}
mu <- c(.8,1.2); variance <- c(.25,.5); precision <- 1/variance
post_var <- 1/(1+sum(precision)); post_mean <- post_var*sum(precision*mu)
missing_var <- 1/(1+precision[1]); stopifnot(missing_var>post_var)
result <- c(mean=post_mean,variance=post_var,one_modality_variance=missing_var)
print(result)

Sources

From the CodeSplash reference, entry SEQ011.