GithubHelp home page GithubHelp logo

daft-dev / daft Goto Github PK

View Code? Open in Web Editor NEW
672.0 672.0 120.0 3.85 MB

Render probabilistic graphical models using matplotlib

Home Page: https://docs.daft-pgm.org

License: MIT License

Python 100.00%

daft's People

Contributors

bmcfee avatar daft-bot avatar davidwhogg avatar dfm avatar dobos avatar dsfulf avatar lindemann09 avatar murphyk avatar nstarman avatar parleur avatar pre-commit-ci[bot] avatar varunagrawal avatar

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

daft's Issues

Allow HMMs to be diagramed

It looks like currently nodes that connect back to themselves are ignored. A curve line segment should be drawn with the arrow pointing back to the node.

mention DAGs and Bayesian networks on web pages

The reason I want to mention directed acyclic graphs and Bayesian networks is for "SEO" or so we are discoverable on the web by people who refer to these things by these other names. Indeed, I see DAG more than I see PGM these days.

notify pundits

Koller, Sontag, Fergus, LeCun, Murray, Marshall, Harmeling, Hirsch, etc. And people at CMML. And the CMMLU. And etc.

deal with Iain Murray suggestions

I think I have already done this in the pull request, but my solutions are CLUNKY.

I think there are much more elegant ways of doing all this; not sure what we should do?

One problem is that I have options like observed=True and nogray=True. These mix concepts like "observed" with typographical commands like "nogray". We kind-of have to decide whether we are letting people set the "look" of the Nodes or the "function" of the nodes. I slightly prefer the latter, with then a style sheet of what each "function" looks like. That could be a good idea -- and would force users to set a style up-front.

setup.py and dependencies

setup.py imports the daft module, which imports matplotlib, which is a dependency, and not necessarily installed when running pip! This means that "pip install daft" in a new virtualenv will fail with: ImportError: No module named 'matplotlib'.

Thanks for daft!

explain `rect`

The rect input to plate takes four numbers in some order. What numbers and in what order?

Python 3 support

The 2to3 tool shows a small number of changes for full Python 3 compatibility. Most of those changes don't seem needed (m.keys() to list(m.keys()). I only needed one change to make Daft work for my simple use case:

--- ./daft.py   (original)
+++ ./daft.py   (refactored)
@@ -126,7 +126,7 @@
         for edge in self._edges:
             edge.render(self._ctx)

-        for name, node in self._nodes.iteritems():
+        for name, node in self._nodes.items():
             node.render(self._ctx)

         return self.ax

Another possible issue is the exec src in ns statement in docs/gen_example.py which would need to be converted to exec(src, ns). The six library provides a simple wrapper for this.

thumbnail suggestions

convert -crop 150x150+230+115 nocircles.png nocircles-thumb.png
convert -crop 150x150+230+115 wordy.png wordy-thumb.png
convert -crop 150x150+50+18 classic.png classic-thumb.png
convert -crop 150x150+50+18 nogray.png nogray-thumb.png

`text` method

I often want to just write text on my PGM. We should provide a general text method or label method that permits this. Am hacking Plate right now (and feeling dirty).

labeling the graph

We should either give facilities for giving the graph other kinds of labels (notes, title, etc) or else make an example that does so by pgm.ax.annotate() or whatever.

oxford comma

I'm all for it: Dan Foreman-Mackey, David W. Hogg, and contributors.

Including external tex

Hey @davidwhogg,

I'm trying to do a PGM with external LaTeX definitions. Your weak lensing example claims to do this but I can't seem to get it to work. Can you add your .tex file for this example to the repository so that I can try to diagnose?

Thanks!

what are we going to do *next* Friday?

I think we should start something new.

I also think we shouldn't work on Daft any more after 23:59 today (Friday), except inasmuch as it helps us write papers.

setup.py doesn't work for me

[hogg@172-26-28-219 Daft]$ python setup.py build
running build 
running build_py
error: package directory 'daft' does not exist

make small filled nodes easier to make

The "alpha" node in classic.py is a standard; we should make it easy with some kind of blah=True input to the daft.Node() call.

Feel free to assign this to me, but only after you tell me what those kinds of nodes are called.

This project sure is a fun distraction for me!

it is LaTeX, not TeX

that's a problem with the "subtitle" or "description" field in the github repo...

overlay graph on image?

Hi.

Could I ask for a basic example of how I might overlay a daft graph on an image?

(context = I'm making a diagram of a small network of brain regions; an image in the background would be v. handy for visual interpretation)

I'm expecting/hoping that the matplotlib base should make this more straightforward than e.g. with graphviz.

Ta.

Actually document the API.

It's useful to have some prose on the API page. In particular: include a comment about what the _rendering_context is.

favicon

let's get serious about this whole web thing

permit non-square grids

I like putting the nodes on an integer grid, for consistent-style reasons (for example, I want to do that in Data Analysis Recipes). But sometimes you might want that grid (in increasing order of difficulty):

  • rectangular (think neural networks where the vertical spacing is always much larger than the horizontal)
  • triangular (think again neural networks or (even better) equilateral triangular)
  • other geometries (like polar etc)

This is an enhanced goal because we don't need this for present goals. (For some reason I don't have the right to label the issues with tags.)

width, height, or rect?

I hate to say this, but I think the original PGM() call should take a rect quad (not a width, height double). The reason is, if you lay out a sick PGM and then want to adjust the bounding box lower-left corner up or over, you have to re-set every x,y position of every node and plate. Whereas if it had a rect at call, that's all you need to change. See, for example, my changeset 7231308 which would have been a one-liner if the input was rect rather than w,h.

let the user decide what's beautiful

I would change "beautifully rendered probabilistic" to "rendering probabilistic" on the slug-line below "DAFT" on the top page. I would also remove "pixel-perfect" from the first paragraph. The examples should give this sense without us saying it. Just sayin

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.