Giter Club home page Giter Club logo

uai2dot's Introduction

uai2dot: convert ".uai" graphical models to DOT format

Summary

Visualizing a graphical model is a great way to gain some quick insight into a distribution's structure. This script will parse a model description in the UAI08 file format and output a representation of the corresponding factor graph, Markov random field, or Bayesian network in the DOT language used by Graphviz. In addition to Graphviz's own visualization algorithms, files in this format are compatible with a variety of other graph visualization packages.

This code is released under the very permissive MIT license, so do with it as you please. That said, if you make any fixes or enhancements that might be generally useful, please consider submitting a patch or pull request.

Usage

./uai2dot -o mygraph.dot mygraph.uai

Sample factor graph

markov.uai

MARKOV
4
2 2 2 2
4
2 0 1
2 0 2
2 1 3
3 1 2 3
4 1 1 1 1
4 1 1 1 1
4 1 1 1 1
8 1 1 1 1 1 1 1 1

markov.dot

graph "markov.uai" {
node [shape=circle, fixedsize=true]; V0 [label=0]; V1 [label=1]; V2 [label=2]; V3 [label=3];
node [shape=square, fixedsize=true]; F0 [label=0]; F1 [label=1]; F2 [label=2]; F3 [label=3];
F0 -- V0;
F0 -- V1;
F1 -- V0;
F1 -- V2;
F2 -- V1;
F2 -- V3;
F3 -- V1;
F3 -- V2;
F3 -- V3;
overlap=scale;
label="markov.uai";
}

markov.png

generated with graphviz using the neato laytout

uai2dot's People

Contributors

drewfrank avatar lotten avatar

Stargazers

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