Home

Awesome

Improved Deep Embedded Clustering (IDEC)

Keras implementation for our IJCAI-17 paper:

and re-implementation (not exactly for pre-training part) for paper:

This code is used for quick start with DEC and IDEC algorithms. The results are not same with that reported in our paper. Use IDEC code to exactly re-implement the experiments.

Differences with IDEC implementation used in paper

Usage

The code is compatible with Python 2.7 and Python 3.6.

  1. Install Keras v2.0, scikit-learn and git
    sudo pip install keras scikit-learn
    sudo apt-get install git

  2. Clone the code to local.
    git clone https://github.com/XifengGuo/IDEC-toy.git IDEC-toy

  3. Prepare datasets.

     cd IDEC-toy/data/usps   
     bash ./download_usps.sh   
     cd ../pendigits   
     bash ./download_pendigits.sh   
     cd ../reuters  
     bash ./get_data.sh   
     cd ../..
    
  4. Run experiment on MNIST.
    python IDEC.py mnist or python DEC.py mnist
    The pretrained autoencoder weights are saved to "ae_weights.h5" and the IDEC (or DEC) model is saved to "results/idec/IDEC_model_final.h5" (or "results/dec/DEC_model_final.h5"). Then we can run IDEC algorithm or DEC with the trained autoencoder weights:
    python IDEC.py mnist --ae_weights ae_weights.h5
    or
    python DEC.py mnist --ae_weights ae_weights.h5

  5. Run experiment on USPS.
    python IDEC.py usps
    python DEC.py usps

  6. Run experiment on pendigits.
    python IDEC.py pendigits
    python DEC.py pendigits

  7. Run experiment on REUTERSIDF10K.
    python IDEC.py reutersidf10k --n_clusters 4
    python DEC.py reutersidf10k --n_clusters 4