Source-linked AI summary

Monge-Ampère Flow for Generative Modeling

Linfeng Zhang, Weinan E, Lei Wang

arXiv:1809.10188v1cs.LGcond-mat.stat-mechmath.DSstat.ML

TL;DR

Flow-based generative models face a tradeoff between expressive transformations and efficient training and sampling, alongside challenges in imposing symmetries. The paper introduces Monge-Ampère flow, a continuous-time gradient-flow model driven by a learnable scalar potential, and demonstrates it on MNIST density estimation and the critical two-dimensional Ising model.

  • Problem

    Flow-based generative models must balance expressive generative maps with efficient training and sampling, while also imposing symmetry conditions that give symmetry-related configurations equal probability.

  • Method

    Monge-Ampère flow models probability as a compressible fluid evolving under the gradient flow of a learnable scalar potential, with training formulated as an optimal-control problem.

  • Results

    The model provides tractable likelihoods, equal computational complexity for sampling and inference, easier symmetry construction, and applications to MNIST density estimation and variational calculation of the critical two-dimensional Ising model.

  • Takeaways & Limitations

    Monge-Ampère flow combines optimal transport, fluid dynamics, and dynamical-systems ideas into a lightweight generative modeling framework.

  • Takeaways & Limitations

    The implementation is minimalist, and the authors identify architecture, integration-scheme, and memory-consumption improvements as open directions.

Abstract

from arXiv · show

We present a deep generative model, named Monge-Ampère flow, which builds on continuous-time gradient flow arising from the Monge-Ampère equation in optimal transport theory. The generative map from the latent space to the data space follows a dynamical system, where a learnable potential function guides a compressible fluid to flow towards the target density distribution. Training of the model amounts to solving an optimal control problem. The Monge-Ampère flow has tractable likelihoods and supports efficient sampling and inference. One can easily impose symmetry constraints in the generative model by designing suitable scalar potential functions. We apply the approach to unsupervised density estimation of the MNIST dataset and variational calculation of the two-dimensional Ising model at the critical point. This approach brings insights and techniques from Monge-Ampère equation, optimal transport, and fluid dynamics into reversible flow-based generative models.

1 INTRODUCTION

Flow-based generative models offer tractable transformations between simple latent distributions and complex data, but their expressiveness, efficiency, and symmetry constraints remain challenging. The Monge-Ampère flow addresses these issues by combining optimal transport with continuous-time gradient dynamics and a learnable scalar potential.

  • Flow-based models connect simple latent variables to complex data through sequences of diffeomorphisms, while targeting the full joint distribution for generation.
  • Expressiveness versus training and sampling efficiency remains a central flow-model tradeoff, and architectural constraints can weaken the model.
  • Symmetry conditions are difficult to impose in generative models while ensuring symmetry-related configurations receive equal probability.
  • The Monge-Ampère flow uses optimal transport and dynamical-systems ideas to define a continuous-time gradient flow driven by a learnable scalar potential.
  • The model represents probability as a compressible fluid, with tractable likelihoods, equal sampling and inference complexity, and easier symmetry construction through the scalar potential.

2 THEORETICAL BACKGROUND

The Monge-Ampère formulation replaces a difficult finite transformation with a continuous-time flow from a latent density to a target density. Its dynamics conserve probability through a curl-free velocity field, while training optimizes a terminal density-matching objective rather than necessarily an optimal-transport cost.

  • A scalar Brenier potential produces the generative map through x=∇u(z), reducing the vector-valued mapping to a gradient of a convex function.
  • Solving the Monge-Ampère equation is difficult because of determinant nonlinearity, limited access to both densities, and Hessian-determinant cost scaling as O(N^3).
  • The model initializes x(0)=z with density p(z) and evolves it over a fixed horizon T until p(x,T)=q(x), defining the generative map.
  • Training is an optimal-control problem that minimizes a functional measuring terminal-density mismatch, instantiated with KL or reverse-KL divergence in the examples.
  • The coupled ODEs describe parcel trajectories and density evolution under v=∇ϕ(x), yielding a curl-free compressible-fluid flow that conserves total probability mass.
  • Optimal transport motivates the gradient-flow architecture, but the control objective need not be an optimal-transport objective because generative modeling typically fixes only one density endpoint.

3 PRACTICAL METHODOLOGY

The practical model parameterizes a differentiable scalar potential with a neural network and integrates its coupled ODEs to transform samples and log-likelihoods. Numerical integration yields a residual or recurrent network, with integration depth and potential expressiveness providing a controllable design tradeoff.

  • A feedforward neural network parameterizes the potential, while ODE integration transforms both data and log-likelihoods and backpropagation tunes the potential toward the desired distribution.
  • The minimalist implementation uses a one-hidden-layer densely connected network with softplus activations, allowing automatic differentiation of the potential's gradient and Laplacian.
  • Numerical ODE integration is equivalent to forward evaluation of a deep residual network or iterative evaluation of a recurrent network.
  • Fourth-order Runge-Kutta integration uses four neural-network layers per step, so 100 steps correspond to 400 layers and produce samples with their log-likelihoods.
  • Longer integration creates a deeper network in which each step can learn a simpler transformation, trading integration depth against potential-function expressiveness.

4 APPLICATIONS

The Monge-Ampère flow is applied to MNIST density estimation and variational free-energy calculation for the Ising model, using ODE-based density transformations and KL-based objectives. It achieves lower MNIST test NLL than reported flow-based baselines and approaches the exact Ising free energy while generating symmetry-respecting configurations.

  • Applications: The Monge-Ampère flow transforms data distributions by integrating ODEs and optimizes their discrepancy from desired densities using the KL divergence.The model starts from a Gaussian base distribution and tracks both samples and likelihoods during integration.
  • Density estimation on the MNIST dataset: Lower MNIST test NLL than previously reported MADE, RealNVP, and MAF values demonstrates the density-estimation performance of the Monge-Ampère flow.The model uses about one-tenth as many learnable parameters as MAF.
  • Density estimation on the MNIST dataset: The MNIST flow continuously removes image features when mapping samples to the Gaussian base distribution and maps Gaussian noise forward to meaningful images.This realizes Gaussianization in continuous time.
  • Variational learning for statistical mechanics problem: The Ising objective minimizes reverse KL divergence against a Boltzmann distribution whose partition function is intractable, while the loss provides an upper bound on physical free energy.The critical-point setting tests whether the model captures long-range correlations and critical fluctuations.
  • Variational learning for statistical mechanics problem: Symmetry is imposed by averaging the scalar potential over group elements, with shared parameters and stochastic term sampling during numerical integration.Linearity of the ODEs in the potential makes this construction feasible for training and generation.
  • Variational learning for statistical mechanics problem: The Ising variational loss decreases toward the exact free-energy solution while generated configurations develop varied domains and respect physical symmetries.The model also provides likelihoods and an inverse mapping that can support Monte Carlo procedures.

5 RELATED WORK

The paper relates Monge-Ampère flow to normalizing, autoregressive, diffusive, and control-based generative models, emphasizing its continuous-time gradient-flow formulation.

  • Normalizing Flows: Normalizing flows balance expressive power and computational efficiency by imposing structural constraints that make Jacobian determinants tractable.The paper places its approach within this broader tradeoff in bijective generative networks.
  • (Inverse) Autoregressive Flows: Autoregressive flows reduce Jacobian cost through triangular structure, but forward and inverse transformations have different computational roles.The paper notes that ordinary autoregressive flows suit density estimation, whereas inverse autoregressive flows suit variational inference.
  • Continuous-time diffusive flow: Unlike diffusive generative models, Monge-Ampère flow uses deterministic, reversible advection without stochastic forces during simulation.The flow is integrated over a finite time interval rather than generated by a diffusion process.
  • Dynamical system and control based methods: The approach defines a dynamical system with a target terminal condition, so training is naturally formulated as a control problem.This connects Monge-Ampère flow to dynamical-system and control-based methods, including Neural ODE backpropagation.

6 DISCUSSIONS

The discussion presents Monge-Ampère flow as a compact synthesis of optimal transport, fluid dynamics, and dynamical systems, while identifying implementation improvements and broader applications.

  • 6 DISCUSSIONS: Monge-Ampère flow models generative dynamics as gradient flow of a compressible fluid in a learnable potential.The method combines optimal transport, fluid dynamics, and differential dynamical systems for generative modeling.
  • 6 DISCUSSIONS: The reported implementation is deliberately minimalist, using a scalar potential represented by a single-hidden-layer densely connected neural network.The authors suggest task-specific architectures, improved reversible integration, and memory-saving ODE backpropagation as immediate improvements.
  • 6 DISCUSSIONS: Wasserstein-distance objectives and batch normalization are possible extensions, but batch normalization may conflict with the physical interpretation of continuous fluid gradient flow.The practical and theoretical significance of batch normalization in this setting remains unresolved.
  • 6 DISCUSSIONS: A time-dependent potential can produce richer gradient flows, including optimal-transport dynamics that interpolate between initial and final densities with constant velocity.The cited optimal transport flow minimizes spatial-time integrated kinetic energy, which upper-bounds squared Wasserstein-2 distance.
  • 6 DISCUSSIONS: Beyond the demonstrated MNIST and Ising applications, the framework is positioned for broader machine-learning and physics problems.The discussion specifically mentions larger symmetry groups, realistic molecular free-energy calculations, and latent-space hybrid Monte Carlo.

A SOLUTION OF A 1-D GAUSSIAN DISTRIBUTION

The one-dimensional Gaussian example gives a closed-form illustration of density evolution under a quadratic potential, showing exponential changes in distribution width.

  • A SOLUTION OF A 1-D GAUSSIAN DISTRIBUTION: The toy analysis uses a one-dimensional Gaussian initial density and a time-dependent Gaussian ansatz to solve the Monge-Ampère flow equations.The initial condition is p(x, 0) = N(x), with α(0) = 1.
  • A SOLUTION OF A 1-D GAUSSIAN DISTRIBUTION: A quadratic potential induces only a scale transformation, so an initially Gaussian distribution remains Gaussian with a different variance.The potential is specified as ϕ(x) = λx^2/2.
  • A SOLUTION OF A 1-D GAUSSIAN DISTRIBUTION: Under the quadratic potential, the fluid parcel follows dx/dt = −λ, while α(t) = exp(−λt).These relations follow after substituting the Gaussian ansatz into the density-flow equation.
  • A SOLUTION OF A 1-D GAUSSIAN DISTRIBUTION: The resulting dynamics make parcels farther from the origin move faster and change the Gaussian width exponentially over time.The example provides intuition for how the potential controls compressible probability flow.

B CONTINUOUS FORMULATION OF THE ISING MODEL

The continuous Ising formulation transforms the discrete model into a tractable continuous-variable representation while preserving its physical properties up to known energy and free-energy offsets.

  • B CONTINUOUS FORMULATION OF THE ISING MODEL: The two-dimensional Ising model is introduced as a statistical-mechanics system with an exact solution.The partition function provides the starting point for its continuous reformulation.
  • B CONTINUOUS FORMULATION OF THE ISING MODEL: The coupling matrix is shifted to K + αI with positive eigenvalues, which changes energies only by a constant offset and leaves physical properties unchanged.The construction chooses the shift so the minimal eigenvalue is 0.1.
  • B CONTINUOUS FORMULATION OF THE ISING MODEL: A Gaussian integration trick and tracing out the Ising variables yield an energy function for continuous variables.After solving the continuous problem, original Ising configurations can be recovered by direct sampling from p(s|x) = Q.
  • B CONTINUOUS FORMULATION OF THE ISING MODEL: The continuous representation has a free energy related to the Ising free energy by determinant and constant-offset terms.The expression includes −ln ZIsing, −1/2 ln det(K + αI), and an N/2-dependent correction.

C HYPERPARAMETERS

Table 2 reports the network and training hyperparameters used in the experiments shown in Figures 3 and 4.

  • The integration step ϵ and number of integration steps d determine the total integration time T = ϵd.
  • The potential function uses h hidden neurons, while B specifies the training mini-batch size.
  • Table 2 lists the hyperparameters for the experiments reported in Figures 3 and 4.
Loading 1809.10188v1…