zoukankan      html  css  js  c++  java
  • 使用 LaTeX 绘制 PGM(Probabilistic Graphical Models)中的贝叶斯网络(bayesian networks)

    Software for drawing bayesian networks (graphical models)

    这里需要调用 latex 中的绘图库:TikZ and PGF


    这里写图片描述

    注意,下述 tex 代码使用 pdflatex (不是 pdflex)进行编译。

    documentclass[11pt]{report}
    usepackage{tikz}
    usetikzlibrary{fit,positioning}
    egin{document}
    egin{figure}
    centering
    egin{tikzpicture}
    	ikzstyle{main}=[circle, minimum size = 10mm, thick, draw =black!80, node distance = 16mm]
    	ikzstyle{connect}=[-latex, thick]
    	ikzstyle{box}=[rectangle, draw=black!100]
    
        % 节点的定义,图中的圆
      
    ode[main, fill = white!100] (alpha) [label=below:$alpha$] { };
      
    ode[main] (theta) [right=of alpha,label=below:$	heta$] { };
      
    ode[main] (z) [right=of theta,label=below:z] {};
      
    ode[main] (beta) [above=of z,label=below:$eta$] { };
      
    ode[main, fill = black!10] (w) [right=of z,label=below:w] { };
    
        % 边的定义,
      path (alpha) edge [connect] (theta)
            (theta) edge [connect] (z)
            (z) edge [connect] (w)
            (beta) edge [connect] (w);
    
        % 节点的定义,图中的矩形
      
    ode[rectangle, inner sep=0mm, fit= (z) (w),label=below right:N, xshift=13mm] {};
      
    ode[rectangle, inner sep=4.4mm,draw=black!100, fit= (z) (w)] {};
      
    ode[rectangle, inner sep=4.6mm, fit= (z) (w),label=below right:M, xshift=12.5mm] {};
      
    ode[rectangle, inner sep=9mm, draw=black!100, fit = (theta) (z) (w)] {};
    
    end{tikzpicture}
    end{figure}
    end{document}
    %note - compiled with pdflatex
  • 相关阅读:
    python 基于gevent协程实现socket并发
    python asyncio
    python 池 协程
    python
    python 守护进程
    python 线程 threading模块
    python 安装Django失败处理
    python 队列
    python 锁
    继承,抽象类,多态,封装
  • 原文地址:https://www.cnblogs.com/mtcnn/p/9421564.html
Copyright © 2011-2022 走看看