Practical overview
When it fits
Use it when you want a focused code example for semi-supervised GAN training on MNIST, rather than a hosted model service or a general-purpose image-generation tool.
Who it is for
- Researchers and learners exploring semi-supervised image classification with MNIST.
- PyTorch users studying feature matching and GAN implementation choices.
Documented uses
- Train an MNIST model using a small labeled set alongside unlabeled examples.
- Study how feature matching and generated samples relate to class separation.
- Inspect a GAN implementation that includes a supplied trained model and documented CPU or CUDA execution.
Requirements & limits
The repository is public and identified as open source. Its README documents command-line use; Python 3.7, PyTorch 1.2, tensorboardX and torchvision are specified.
- The documented dataset and example configuration are specific to MNIST.
- The README's default configuration uses CPU, with a documented
--cudaoption for GPU execution. - The maintainer reports changing the generator's final layer to Softplus after encountering reproduction difficulties and exploding gradients.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run the MNIST implementation
Start the repository's documented training script with its default CPU configuration or CUDA option.
Before you start
- Python 3.7
- PyTorch 1.2, tensorboardX and torchvision
- The repository files, including ImprovedGAN.py
Steps
Install the documented Python dependencies.
Run the command below for the default CPU configuration.
python ImprovedGAN.pyUse the command below to select GPU execution.
python ImprovedGAN.py --cuda
Expected outcome
The script runs the MNIST semi-supervised GAN configuration; the README says default settings include saving, autoloading and TensorBoard-format log generation.
Guide limitations
- The README's reported 98.5% test accuracy is tied to its stated setup of 100 labeled and 59,000 unlabeled examples after 100 epochs, and is not a general performance guarantee.
- The README does not give additional GPU setup instructions.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 20 November 2026
- Original website title
- Sleepychord/ImprovedGAN-pytorch · Official homepage title · retained in its source language

