This project is a tensorflow implementation of my ongoing work for semi-supervised learning with deep generative models and metric embedding.
- Tensorflow. We tested our method with the 1.13.1 tensorflow version. You can Install Tensorflow by following the instructions on its website: https://www.tensorflow.org/install/pip?lang=python2.
- Caveat: Tensorflow released the 2.0 version with different changes that will not allow to execute this implementation directly. Check the migration guide for executing this implementation in the 2.0 tensorflow version.
- Python 2.7. We implemented our method with the 2.7 version. Additional libraries include: numpy, scipy and matplotlib.
-
We used docker and nvidia-docker for ubuntu to train and test our models. The official tensorflow image can be obtained from Docker Hub. The 1.13.1 version can be downloaded by using the following command:
$ docker pull tensorflow/tensorflow:1.13.1-gpu
-
Note: The official tensorflow image does not include matplotlib and keras. You will have to install them inside your container using the pip install command.
- To execute a single run of the semi-supervised model for a specific dataset:
$ ./run.sh <dataset-name>
where dataset-name can be mnist or svhn.
- To change parameter values,
$ ./run.sh <dataset-name> -num_epochs 200 -seed 50 -verbose 1
More details about the parameters can be found in the parameters file.
To reproduce the results from our paper, you can run these models multiple times and then average the results. By default random seeds will be used, optionally you can specify different manual seeds by setting the -seed
parameter.
Tested with the following datasets: MNIST and SVHN. Details about each dataset can be found in the README file located in the dataset folder.
If you find our code useful in your researches, please consider citing:
@report{Arias2019,
author = {Arias, Jhosimar},
title = {Semi-supervised Learning using Deep Generative Models and Metric Embedding Auxiliary Task},
year = {2019}
}