Giter Site home page Giter Site logo

dpmm's Introduction

This is a matlab library for Gaussian Dirichlet Process Mixture Models (DPMMs).
It includes both variational and Monte Carlo inference.

To test / see how this program works, run demodpmm.m in matlab

This code was mostly written in 2007. When I found out it was
referenced in a paper in 2012, I made a few cosmetic changes and put
it on Github. It's not guaranteed to work perfectly. You should
check it before using it for anything really important.

Some of the sampling code is built on top of software by Michael
Mandel, which was also released under GPL.

=====================================================
COPYRIGHT / LICENSE
=====================================================
Unless otherwise indicated in the specific file, code was written by 
Jacob Eisenstein, and is copyrighted under the GPL:

  Copyright (C) 2007-2012  Jacob Eisenstein

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

dpmm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dpmm's Issues

Has anyone tried to derive deriv_up and deriv_down?

Hi all, in line 108, deriv_up is defined as 2 / (n - k + 3/2) while deriv_down is defined as k * n / (n - k + 1). Has anyone actually tried to derive these 2 equations since author mentioned it is guaranteed to produce positive and negative derivative?

I tried deriving myself thinking they are linked to the equation of hprime. However, if I tried to let hprime = 0, I will get stuck with the harmonic series. Unless my direction is wrong, such that those two equation are not related to hprime.

Update (Here is what I tried):
If I have to let HPrime be more than 0, I would have to approximate the harmonic series as na and eventually derive the equation that a must be bigger than 1/(2(n-k-3/2) which I can easily assume that deriv_up = 1 / (n - k + 3/2) or deriv_up = 2 / (n - k + 3/2) (as written in the code) which are both bigger than 1/(2*(n-k-3/2).

Whereas for HPrime be less than 0 (a(k-3/2)+1+a^2(digamma(a)-a^2(digamma(a+n) <0). Firstly, a must be a postive value for MATLAB psi to work and digamma(a) must produce a positive number so no matter how big k is, as long as a is bigger than k then we would get a negative derivative. So letting deriv_down = k +1 would produce a negative derivative as well. However, I am not sure if my assumptions are correct though..

p_prior

In the code, p_prior is written as p_prior = params(it).counts + params(it).alpha * (params(it).counts == 0);
which lets the number of observations in k cluster be the probability of joining k cluster.

But i thought, it should be divided by (a+N-1) ? which will gives

p_prior = (params(it).counts + params(it).alpha * (params(it).counts == 0))./(params(it).alpha+sum(params(it).counts)-1);

Or is the division redundant?

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.