Coder Social home page Coder Social logo

afcarl / dpmmlowvar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jstraub/dpmmlowvar

0.0 1.0 0.0 2.83 MB

Bayesian nonparametric small-variance asymptotic clustering algorithms

CMake 5.20% Makefile 0.56% Cuda 19.33% C++ 41.23% MATLAB 12.57% Python 20.31% Shell 0.80%

dpmmlowvar's Introduction

Bayesian Nonparametric Small-Variance Asymptotic Clustering

DP-vMF-means Direcitonal Segmentation of the NYU RGB-D dataset DDP-vMF-means Real-time Direcitonal Segmentation

This is a library of Bayesian nonparametric small-variance asymptotic clustering algorithms: DP-means, Dynamic means, DP-vMF-means, DDP-vMF-means. For comparison reasons the library also implements k-means as well as spherical k-means.

This library comes with an executable that allows batch clustering using DP-vMF-means, DP-means, spherical k-means and k-means.

The pure python implementation of DP-vMF-means shows the simplicity of the algorithm.

For an example of using DDP-vMF-means refer to rtDDPvMF, which relies on this package's dpMMlowVar library to perform real-time directional segmentation from Kinect RGB-D streams using DDP-vMF-means. Real-time Directional Segmentation using DDP-vMF-means

If you use DP-vMF-means or DDP-vMF-means please cite:

Julian Straub, Trevor Campbell, Jonathan P. How, John W. Fisher III. 
"Small-Variance Nonparametric Clustering on the Hypersphere", In CVPR,
2015.

If you use Dynamic-means please cite:

T. Campbell, M. Liu, B. Kulis, J. How, and L. Carin. "Dynamic
Clustering via Asymptotics of the Dependent Dirichlet Process Mixture".
In Advances in Neural Information Processing Systems (NIPS), 2013.

Dependencies

This code is dependent on Eigen3, Boost, CUDA, OpenCV, OpenMP and PCL. It has been tested on Ubuntu 14.04 with

  • Eigen3 (3.0.5)
  • Boost (1.54)
  • CUDA (6.5)
  • OpenCV (2.4)
  • PCL (1.7)

Install

This package uses the pods build system. Used widely at CSAIL MIT the build system makes it easy to break up software projects into small packages that can be checked out and compiled automatically (see below).

  • Linux:

    Install Eigen3, Boost, OpenCV, and PCL

    sudo apt-get install libeigen3-dev libboost-dev libopencv-dev libpcl-1.7-all-dev
    

    Install the appropriate CUDA version matching with your nvidia drivers. On our machines we use nvidia-340-dev with libcuda1-340 cuda-6-5 cuda-toolkit-6-5

    Clone this repository and compile the code:

    git clone [email protected]:jstraub/dpMMlowVar; cd dpMMlowVar;
    make checkout; make configure; make -j6; make install;
    

    Note that this will checkout several other necessary repositories. To update all repositories run

    make update; make configure; make -j6; make install;
    

Getting Started

After you have compiled the code you can run clustering of the surface normals of an example data set in the ./data/ folder by running:

cd ./python; python dpView.py

Note that the extraction of surface normals necessitates matlab. An alternative is to directly run segmentation from Kinect RGB-D frames using the rtDDPvMF package.

The pure python implementation of DP-vMF-means and of DP-means shows the simplicity of the nonparametric algorithms.

Usage

./dpMMlowVarCluster -h
Allowed options:
  -h [ --help ]         produce help message
  --seed arg            seed for random number generator
  -N [ --N ] arg        number of input datapoints
  -D [ --D ] arg        number of dimensions of the data
  -T [ --T ] arg        iterations
  -a [ --alpha ] arg    alpha parameter of the DP (if single value assumes all 
                        alpha_i are the same
  -K [ --K ] arg        number of initial clusters 
  --base arg            which base measure to use (only spkm, kmeans, 
                        DPvMFmeans right now)
  -p [ --params ] arg   parameters of the base measure
  -i [ --input ] arg    path to input dataset .csv file (rows: dimensions; 
                        cols: different datapoints)
  -o [ --output ] arg   path to output labels .csv file (rows: time; cols: 
                        different datapoints)
  --mlInds              output ml indices
  --centroids           output centroids of clusters
  --silhouette          output average silhouette
  --shuffle             shuffle the data before processing

Examples:

  • DPvMFmeans clustering: First compute the lambda parameter of DPvMFmeans as lambda = cos(angleInRadians) - 1. so for example lambda = -0.06 for an angle of 20deg.
./dpMMlowVarCluster -N 10000 -D 3 --base DPvMFmeans -p -0.06 -i ./data/rndSphereDataIwUncertain.csv -o test

Contributors

Julian Straub and Trevor D. Campbell

dpmmlowvar's People

Contributors

dshayden avatar jstraub avatar trevorcampbell avatar

Watchers

 avatar

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.