Skip to content

yiyg510/Deep-Subspace-Clustering

 
 

Repository files navigation

Deep-Subspace-Clustering

Description pending...

Sources used

Installation

Download or git clone the repository.

Prerequisites

  • Tensorflow - installed in a working Python environment such that import tensorflow throws no errors
  • Matlab - has an activated license, can be launched from desktop
  • OR Octave - can be launched via octave in console

M-files

Option 1: MATLAB API for Python

Requires a working and activated version of MATLAB.

Instructions taken from here.

Launch MATLAB and run:

>>> matlabroot

Run the following on the command line, substituting the previous result into the first line. Make sure that python references a python version that has tensorflow installed:

cd matlabroot
cd extern/engines/python
python setup.py install

If the last line fails due to denied permissions, point it to a directory that you have write permissions for. You can delete this directory afterwards:

python setup.py build --build-base=/full/path/to/temp install

Check the installation by running in Python:

>>> import matlab.engine
>>> eng = matlab.engine.start_matlab()
>>> eng.isprime(37)

Option 2: Python to Octave bridge

A viable substitute for not having MATLAB. Requires a working version of GNU Octave.

Install oct2py. Make sure that pip is tied to a python version that has tensorflow installed:

pip install oct2py

Check the installation by running in Python:

>>> from oct2py import octave
>>> octave.isprime(37)

Indicate that you'll be using Octave. If on linux, add this to your .bashrc. If on windows, use SETX:

export ENGINE_CHOICE=OCTAVE

If running kmeans in the Octave console says that it's undefined, you need to install the statistics package:

sudo apt-get install octave-statistics

Then, add the line pkg load statistics to SpectralClustering.m

If you don't have access to sudo, do the following instead. Make sure to substitute in the correct version number:

apt-get download octave-statistics
dpkg -x octave-statistics_1.2.4-1_all.deb dir
octave:1> addpath(genpath("~/path/to/dir/usr/share/octave/packages/statistics-1.2.4"))
octave:2> savepath

Verify that kmeans works:

octave:3> kmeans(randn(10, 2), 2)

Packages

Through pip or conda (some require -c conda-forge), install the following:

  • scikit-image
  • scikit-learn
  • scikit-optimize
  • munkres
  • scipy
  • matplotlib
  • mnist
  • pathlib
  • pillow
  • pympler

SSC using ADMM

Download code for SSC using ADMM. Unzip the contents into SSC_ADMM_v1.1, located at the root of the repository.

Datasets

Download and unzip any desired datasets. By default, the loading methods look for a data folder at the root of the repository.

Alternatively, you can just load the already preprocessed matrices from saved.

About

Description pending...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 56.1%
  • Jupyter Notebook 29.9%
  • MATLAB 14.0%