Code Monkey home page Code Monkey logo

clustergan's Introduction

ClusterGAN: A PyTorch Implementation

This is a PyTorch implementation of ClusterGAN, an approach to unsupervised clustering using generative adversarial networks.

Requirements

The package as well as the necessary requirements can be installed by running make -f Makefile or via

virtualenv -p /usr/local/bin/python3 venv
source venv/bin/activate
python setup.py install

Run ClusterGAN on MNIST

To run ClusterGAN on the MNIST dataset, ensure the package is setup and then run

python train.py -r test_run -s mnist -b 64 -n 300

where a directory runs/mnist/test_run will be made and contain the generated output (models, example generated instances, training figures) from the training run. The -r option denotes the run name, -s the dataset (currently MNIST and Fashion-MNIST), -b the batch size, and -n the number of training epochs.

Below is an example set of training curves for 200 epochs, batch size of 64 on the MNIST dataset.

Generated Examples

To generate examples from randomly sampled latent space variables,

python gen-examples.py -r test_run -s mnist -b 100

Here are some example generated images by specified class (each row) of the learned labels in latent space.

TSNE Figure

To produce a TSNE figure depicting the clustering of the latent space encoding of real images,

python tsne-cluster.py -r test_run -s mnist

Below is the tSNE clustering figure of the latent space vectors of true MNIST images fed into the encoder.

License

MIT License

Copyright (c) 2018 Zigfried Hampel-Arias

clustergan's People

Contributors

zhampel avatar ayoob7 avatar

Watchers

James Cloos avatar paper2code - bot avatar

Forkers

tharidhip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.