/VAE-Paddle

VAE paddlepaddle implement

Primary LanguagePython

1.Overview

This is the PaddlePaddle implementation of variational auto-encoder, applying on MNIST dataset.
Currently, the following models are supported:
✔️ VAE
✔️ Conv-VAE

2.Usage

Train Model:

CUDA_VISIBLE_DEVICES=0
sh run.sh

or

CUDA_VISIBLE_DEVICES=0 \
python train.py \
    --mode=convVAE \
    --result_dir=result \
    --save_dir=checkpoint \
    --batch_size=128 \
    --epoches=100 \
    --lr=1e-3 \
    --z_dim=20 \
    --input_dim=28*28 \
    --input_channels=1

you can also specify some customized options in train.py

Generate Mnist Image:

python generate.py \
    --mode=convVAE \
    --ckpt='' \ #指定模型参数文件路径
    --result_dir=generate_result

3.Result

Here are some visualization results:

ConvVAE:

random_sampled_90 random_sampled_80

VAE:

random_sampled_89 random_sampled_99