用板符号绘制图形模型的软件

发布于 2024-09-14 06:48:56 字数 404 浏览 8 评论 0原文

因此,我一直在研究论文和在线文章中看到以板符号表示的图形模型(例如: http://www.cs.princeton.edu/~blei/papers/BleiNgJordan2003.pdf)。

有没有一种快速简便的方法来生产这些?我搜索了又搜索,但我发现的只是像 GraphViz 这样的解决方案,它们确实比我需要的更强大(因此更难以使用)。 PGF/Tikz 似乎是我最好的选择,但又似乎有点矫枉过正。

也许我最好的选择是在 Inkscape 中制作它们,或者硬着头皮学习 PGF/Tikz。它们太受欢迎了,我以为会有一种更简单的方法来生产它们,但也许不是……TIA。

So I see graphical models expressed in plate notation in research papers and online all the time (for example: http://www.cs.princeton.edu/~blei/papers/BleiNgJordan2003.pdf).

Is there a quick and easy way to produce these?? I've searched and searched but all I've found are solutions like GraphViz which are really way more powerful than what I need (and hence much more difficult to use). PGF/Tikz seems like my best bet, but again it seems like overkill.

Maybe my best bet is to just produce them in Inkscape, or bite the bullet and learn PGF/Tikz. They're just so popular that I thought there would be a simpler way to churn them out, but maybe not... TIA.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

黑寡妇 2024-09-21 06:48:57

GraphViz 确实不难学。对于这类图表来说,基本语言非常简单。我只花了一些时间(或多或少)复制了该 pdf 中的第一个示例,它的好处是,由于它很简单,所以很容易从其他数据源按程序生成图形。

Digraph fig1 {
rankdir = LR; //order things from left to right

//define alpha and beta as existing
α [shape=circle];
β [shape=circle];
//not strictly nescessary but helps if you want to
//assign them specific shapes or colours

subgraph cluster_M //names beginning with "cluster" get a box drawn, an odd hack
{
    label = "M"

    θ [shape=circle];
    subgraph cluster_N
    {
        label = "N"
        z [shape=circle];
        w [shape=circle, style=filled]
        z->w; //quite literally z points at w
    }

    θ -> z;
}
α -> θ;
β -> w;
}

编译为
点-Tpng input.txt -o graph.png
它看起来像这样。如果气泡下方的标签很重要,您可以使用几行额外的线来做到这一点,同样,如果节点的特定位置很重要,您也可以调整它。事实上,如果您不指定图像格式,dot 的默认行为是输出输入文件的一个版本,其中包含每个元素位置的坐标。

输出图像

GraphViz really isn't that hard to learn. The basic language is really simple for these kinds of graphs. It took me just a few moments to replicate (more or less) the first example from that pdf, and the nice thing about it is that, due to it's simplicity, it's quite easy to generate graphs procedurally from some other data source.

Digraph fig1 {
rankdir = LR; //order things from left to right

//define alpha and beta as existing
α [shape=circle];
β [shape=circle];
//not strictly nescessary but helps if you want to
//assign them specific shapes or colours

subgraph cluster_M //names beginning with "cluster" get a box drawn, an odd hack
{
    label = "M"

    θ [shape=circle];
    subgraph cluster_N
    {
        label = "N"
        z [shape=circle];
        w [shape=circle, style=filled]
        z->w; //quite literally z points at w
    }

    θ -> z;
}
α -> θ;
β -> w;
}

compiled with
dot -Tpng input.txt -o graph.png
it comes out looking like this. If having the labels below the bubbles was important, you could do that with a couple of extra lines, similarly if specific placement of nodes is important you can adjust that too. In fact, if you don't specify an image format, the default behaviour of dot is to output a version of the input file with co-ordinates for the position of each element.

The output image

乞讨 2024-09-21 06:48:57

这是 Dietz 脚本的更精致的分支:https://github.com/jluttine/tikz-bayesnet

Here is a more refined fork of Dietz's scripts: https://github.com/jluttine/tikz-bayesnet

夜无邪 2024-09-21 06:48:57

查看 Laura Dietz 编写的优秀 Tikz 软件包,可从 http 获取://www.mpi-inf.mpg.de/~dietz/probabilistic-models-tikz.zip。包含一些示例的 pdf 文件可在 http://www. mpi-inf.mpg.de/~dietz/probabilistic-models-tikz.pdf

Check out the excellent Tikz-package by Laura Dietz, available from http://www.mpi-inf.mpg.de/~dietz/probabilistic-models-tikz.zip. A pdf with some examples is available at http://www.mpi-inf.mpg.de/~dietz/probabilistic-models-tikz.pdf.

晒暮凉 2024-09-21 06:48:57

我真的很喜欢 GLE(图形布局引擎)。克里斯托弗·毕肖普(Christopher Bishop)在他的书《模式识别和机器学习》中使用了这一点。它具有包含变量、循环和函数的简单语法,并且支持 TeX 方程。结果输出为 pdf 或 eps,看起来非常漂亮。

有很多示例可供使用,包括来自 PRML 的贝叶斯网络

I really like GLE (Graphics Layout Engine). It's what Christopher Bishop used in his book, "Pattern Recognition and Machine Learning". It has a simple syntax with variables, loops, and functions, and it supports TeX equations. Results output as either pdf or eps and look very nice.

Lots of examples are available, including this Bayes net from PRML.

苦妄 2024-09-21 06:48:57

作为对其他答案的补充:我使用的“低技能”方法是在 Google 幻灯片中绘制它们,并使用一些附加组件来生成公式。

As a complement to other answers: a "low-skills" approach I've used is to draw them in Google Slides, with some add-on for producing the formulas.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文