fidabspd / latent-cnf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latent CNF (Continuous Normalizing Flows)

An implementation of the mnist image generator using CNF.
(CNF is generative model which is introduced in NeuralODE.)

Get a latent of image using an image encoder and train CNF to generate latent.
During inference, generated latent is decoded by image decoder.

Generation Result

  • $t_0 = 0,\ t_1 = 10$
  • $\mathbf{z}_{t_0} \sim \mathcal{N}(0, I)$
  • $\mathbf{z}_{t_1}: target\ distribution$

(In the code, the covariance matrix of $\mathbf{z}_{t_0}$ is not $I$, but a diagonal matrix with a diagonal element of $0.1$. For convenience, Denoted as $I$.)

Visualize the sample of $\mathbf{z}_{t_0}$ flowing to $t_1$ through the CNF. (Decoded into image)

Without Encoder Condition
Without Discriminator
Latent Dimension = 2
With Encoder Condition
With Discriminator
Latent Dimension = 8

Latent Visualization

Latent dimension is set to 2.

Latent Generated by ImageEncoder Latent Generated by CNF

Usage

Train

python3 train.py

About


Languages

Language:Jupyter Notebook 94.1%Language:Python 5.9%