Git Product home page Git Product logo

Comments (1)

brandonwillard avatar brandonwillard commented on May 27, 2024 1

After merging #28 we'll be in a situation where work on this can get started. The situation is still extremely simple right now and is primarily motivated by a need to simplify the current and very redundant "matching" for the supported negative-binomial samplers.

Currently, each negative-binomial sampler step is addressing a distinct part of a somewhat generalized negative-binomial regression model, but it's doing so in an overly rigid and piecemeal fashion. We need to make the logic of each distinct sampling step as independent and "reusable" as possible, and then add a means of incrementally identifying sample steps for each component in a model.

For example, we shouldn't need <model>_match and <model>_gibbs functions that just match/sample expansions/elaborations of essentially the same form of model(s). We don't want to have to write such functions for a negative-binomial model with a fixed dispersion term and one with a non-fixed dispersion term. Instead, we need to walk graphs and determine when/if sub-graphs match an implemented sample step, and, as a result, arrive at the kinds of combinations of sample steps that we currently have.

One basic requirement is a mapping between (sub-)model graph structures and their sample steps. At the moment, we could use the sub-graph "templates" that are used for unification (e.g. the etuples used in nbinom_horseshoe_match) as keys in a map to their corresponding sample step constructors (e.g. nbinom_horseshoe_gibbs). In other words, we can build a DB-like "index" out of the forms used for unification, and perhaps even find a fairly efficient approach for such unifications—e.g. similar to what's done in kanren.facts.Relation.

There are two ways we can approach this and leverage existing code:

  1. If we use kanren for the graph walking, then things like multiple-results handling, Relations, and some aspects of condition-checking + unification (e.g. constraints/disequality) are all immediately available; however, some basic aspects of the graph relations aren't very scalable and would need to be addressed almost immediately.

  2. If we use Aesara's graph rewriting framework, then we might have a more scalable approach; however, we would need to implement support for generating multiple rewrite results and the aforementioned "index"-like matching capabilities. As well, the relational framework would not be available, which means that we would still be reimplementing aspects of the relations we're ultimately using (e.g. applying one "direction" of an equality in one place and the opposite in another).

from aemcmc.

Related Issues (20)

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.