GithubHelp home page GithubHelp logo

mafrasiabi / ncrp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ferrumofomega/ncrp

0.0 1.0 0.0 10 KB

This is a repository and tutorial for nest Chinese Restaurant processes.

License: MIT License

Python 100.00%

ncrp's Introduction

nCRP

This is a repository and tutorial for the nested Chinese Restaurant process (https://github.com/Ferrumofomega/nCRP.git).

This model is inspired by Blei 2010 (https://cocosci.berkeley.edu/tom/papers/ncrp.pdf) and implemented using Edward (http://edwardlib.org/).

This nCRP was used to model decision making using structured uncertainty in an OUP volumne on Transformational Experience.

Non-Parametric Clustering Using the Nested Chinese Restaurant Process

The generative model we described for creating new food instances is the nested Chinese Restaurant Process (nCRP). The nCRP is an unsupervised, non-parametric, generative model for assigning probability distributions to branching tree structures. See Blei above for a more in-depth discussion of the nested Chinese Restaurant Process.

While the model in the paper leverages the hierarchical categorization that the nCRP offers, our models offers a finite, deterministic tree depth. The original paper places an IID over the tree depth as well, enabling for an infinite depth to the trees.

Model Definition

First we need to define a food object's partition, or it's possible paths throughout the structured generative model defined above.

Here, consider a set of an N i.i.d. input food vectors, indicating an agent's previously eaten foods. Our model uses a three-level category hierarchy. The food vectors are partitioned into C level-one categories. We represent the partition via a vector vb of length N, where each vbn in {1,....,C}.

The C basic-level categories are then partitioned into B second-level categories (where K <= N) which are represented via the vector vsn of length C.

Finally, the B second-level categories are then partitioned into A third-level categories which are represented via the vector vtn. We define pn as the triple {vbn, vsn, vtn}, which defines for each n in N a path through the three-level tree.

As the name suggests, the nCRP is composted of nested Chinese Restaurant Processes. The CRP provides a way to partition food instances at each level of the hierarchy as they enter which is represented via a single $\alpha parameter. Imagine a Chinese Restaurant with an infinite number of tables that can each seat an infinite number of persons. At a given time t, after a number of other people have been seated, the CRP provides the probability a person has of sitting at all the occupied tables, and a new table. The CRP is defined as:

Image

Where pi is the partition define above, $\alpha$CRP is the concentration parameter that encodes how frequently a new partition is produced, K is the total number of tables, taui is the partition that food vector n is places at, and $\delta_{\tau}$ is the distribution that puts it's mass at a given partition, We embed a CRP at each category-level A,B,C.

In our model we found that (2 .5 .5) for the $\alpha$ parameters in the nCRP corresponding to 'category', 'sub-category' and 'instance' level concentration parameters performed well.

This enables our agent to infer the placement of a novel experience with respect to an agent's previous structured knowledge and experiences, further informing their expected utility at a given time.

Placement of new item in hierarchy We considered first the location of the new food in the existing hierarchy. The agent places a greater degree of belief on the new food being a type of grape.

[INSERT FIGURE]

ncrp's People

Contributors

ferrumofomega avatar

Watchers

James Cloos 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.