## MNIST

Author: Joel Shor

### How to run


1.  Run the setup instructions in [tensorflow_gan/examples/README.md](https://github.com/tensorflow/gan/blob/master/tensorflow_gan/examples/README.md#steps-to-run-an-example)
1.  Run:

    ```shell
    python mnist/train.py --gan_type=[TYPE] --train_log_dir_mnist=/tmp/mnist
    ```

    here `[TYPE]` can be is one of `unconditional`, `conditional` or `infogan`.

### Description

We train a simple generator to produce [MNIST digits](http://yann.lecun.com/exdb/mnist/).
The unconditional case maps noise to MNIST digits. The conditional case maps
noise and digit class to MNIST digits.
[InfoGAN](https://arxiv.org/abs/1606.03657) learns to produce
digits of a given class without labels, as well as controlling style.
We use a classifier trained on MNIST digit classification for evaluation.

Unconditional | Conditional | InfoGAN
-------              | --------------                        | --------           |  --------
<img src="images/mnist_unconditional_gan.png" title="Unconditional GAN" width="330" /> | <img src="images/mnist_conditional_gan.png" title="Conditional GAN" width="330" /> | <img src="images/mnist_infogan.png" title="InfoGAN" width="330" />

## MNIST

Author: Joel Shor

### How to run


1.  Run the setup instructions in [tensorflow_gan/examples/README.md](https://github.com/tensorflow/gan/blob/master/tensorflow_gan/examples/README.md#steps-to-run-an-example)
1.  Run:

    ```shell
    python mnist/train.py --gan_type=[TYPE] --train_log_dir=/tmp/mnist
    ```

    here `[TYPE]` can be is one of `unconditional`, `conditional` or `infogan`.

### Description

We train a simple generator to produce [MNIST digits](http://yann.lecun.com/exdb/mnist/).
The unconditional case maps noise to MNIST digits. The conditional case maps
noise and digit class to MNIST digits.
[InfoGAN](https://arxiv.org/abs/1606.03657) learns to produce
digits of a given class without labels, as well as controlling style.
We use a classifier trained on MNIST digit classification for evaluation.

Unconditional | Conditional | InfoGAN
-------              | --------------                        | --------           |  --------
<img src="images/mnist_unconditional_gan.png" title="Unconditional GAN" width="330" /> | <img src="images/mnist_conditional_gan.png" title="Conditional GAN" width="330" /> | <img src="images/mnist_infogan.png" title="InfoGAN" width="330" />

Update MNIST Example Readme command
Update MNIST Example Readme command

When I run the original command, I get this error:
```
$ python mnist/train.py --gan_type=conditional --train_log_dir_mnist=/tmp/mnist
WARNING:tensorflow:From /home/username/Code/gan_examples/gan/tensorflow_gan/python/estimator/tpu_gan_estimator.py:42: The name tf.estimator.tpu.TPUEstimator is deprecated. Please use tf.compat.v1.estimator.tpu.TPUEstimator instead.

WARNING:tensorflow:From /home/username/.asdf/installs/python/anaconda3-2020.07/lib/python3.8/site-packages/tensorflow/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
FATAL Flags parsing error: Unknown command line flag 'train_log_dir_mnist'. Did you mean: train_log_dir ?
Pass --helpshort or --helpfull to see help on flags.
```

And indeed, changing the command as recommended fixes that issue and gets me into the training loop.
