Home

Awesome

Semi-Supervised Learning with Deep Generative Models

Chainer implementation of Variational AutoEncoder(VAE) model M1, M2, M1+M2

この記事で実装したコードです。

Requirements

To visualize results, you need

Download MNIST

run mnist-tools.py to download and extract MNIST.

How to label my own dataset?

You can provide label information by filename.

format:

{label_id}_{unique_filename}.{extension}

regex:

([0-9]+)_.+\.(bmp|png|jpg)

e.g. MNIST

labeling

M1

Parameters

paramsvalue
OSWindows 7
GPUGeForce GTX 970M
ndim_z2
encoder_apply_dropoutFalse
decoder_apply_dropoutFalse
encoder_apply_batchnormTrue
decoder_apply_batchnormTrue
encoder_apply_batchnorm_to_inputTrue
decoder_apply_batchnorm_to_inputTrue
encoder_units[600, 600]
decoder_units[600, 600]
gradient_clipping1.0
learning_rate0.0003
gradient_momentum0.9
gradient_clipping1.0
nonlinearsoftplus

Result

Latent space

M1

M2

Parameters
paramsvalue
OSWindows 7
GPUGeForce GTX 970M
ndim_z50
encoder_xy_z_apply_dropoutFalse
encoder_x_y_apply_dropoutFalse
decoder_apply_dropoutFalse
encoder_xy_z_apply_batchnorm_to_inputTrue
encoder_x_y_apply_batchnorm_to_inputTrue
decoder_apply_batchnorm_to_inputTrue
encoder_xy_z_apply_batchnormTrue
encoder_x_y_apply_batchnormTrue
decoder_apply_batchnormTrue
encoder_xy_z_hidden_units[500]
encoder_x_y_hidden_units[500]
decoder_hidden_units[500]
batchnorm_before_activationTrue
gradient_clipping5.0
learning_rate0.0003
gradient_momentum0.9
gradient_clipping1.0
nonlinearsoftplus

Result

Classification
Training details
data#
labeled100
unlabeled49900
validation10000
test10000
*#
epochs490
minutes1412
weight updates per epoch2000
Validation accuracy:

M2

Test accuracy: 0.9018
Analogies

run analogy.py after training

Model was trained with...

data#
labeled100
unlabeled49900

M2

data#
labeled10000
unlabeled40000

M2

data#
labeled50000
unlabeled0

M2

M1+M2

Parameters
M1
paramsvalue
OSWindows 7
GPUGeForce GTX 970M
ndim_z2
encoder_apply_dropoutFalse
decoder_apply_dropoutFalse
encoder_apply_batchnormTrue
decoder_apply_batchnormTrue
encoder_apply_batchnorm_to_inputTrue
decoder_apply_batchnorm_to_inputTrue
encoder_units[600, 600]
decoder_units[600, 600]
gradient_clipping1.0
learning_rate0.0003
gradient_momentum0.9
gradient_clipping1.0
nonlinearsoftplus

We trained M1 for 500 epochs before starting training of M2.

*#
epochs500
minutes860
weight updates per epoch2000
M2
paramsvalue
OSWindows 7
GPUGeForce GTX 970M
ndim_z50
encoder_xy_z_apply_dropoutFalse
encoder_x_y_apply_dropoutFalse
decoder_apply_dropoutFalse
encoder_xy_z_apply_batchnorm_to_inputTrue
encoder_x_y_apply_batchnorm_to_inputTrue
decoder_apply_batchnorm_to_inputTrue
encoder_xy_z_apply_batchnormTrue
encoder_x_y_apply_batchnormTrue
decoder_apply_batchnormTrue
encoder_xy_z_hidden_units[500]
encoder_x_y_hidden_units[500]
decoder_hidden_units[500]
batchnorm_before_activationTrue
gradient_clipping5.0
learning_rate0.0003
gradient_momentum0.9
gradient_clipping1.0
nonlinearsoftplus

Result

Classification
Training details
data#
labeled100
unlabeled49900
validation10000
test10000
*#
epochs600
minutes4920
weight updates per epoch5000
Validation accuracy:

M1+M2

Test accuracy

seed1: 0.954

seed2: 0.951