Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
probml
GitHub Repository: probml/pyprobml
Path: blob/master/tikz/hbnn-mlp-tikz.tex
1191 views
1
\documentclass[tikz, border=2pt]{standalone}
2
\usepackage[utf8]{inputenc}
3
\usepackage{tikz}
4
\usetikzlibrary{bayesnet}
5
\begin{document}
6
% \author{Karm Patel}
7
% \date{July 2022}
8
% \maketitle
9
\tikzstyle{constant} = [circle, draw=black!0, minimum size = 4mm]
10
11
\tikzstyle{detH} = [circle, double, thick, draw=black!75, minimum size=4mm]
12
\tikzstyle{det} = [circle, double, thick, draw=black!75, fill=gray!20, minimum size=4mm]
13
\begin{tikzpicture}
14
\node [obs](y_n){$y_{n}^e$};
15
\node [det, below= of y_n](z2_n){$z_{2n}^j$};
16
\edge{z2_n}{y_n};
17
\node [det, below= of z2_n](z1_n){$z_{1n}^j$};
18
\edge{z1_n}{z2_n};
19
\node [obs, below= of z1_n](x_n){$x_{n}^j$};
20
\edge{x_n}{z1_n};
21
\plate[inner sep=.3cm]{plate_inner}{(y_n)(z1_n)(z2_n)(x_n)}{$n=1:N_{j}$};
22
23
\node [detH, right=2cm of y_n](w3){$w_{3}^j$};
24
\node [latent, above left= 0.5cm of w3](e3){$\epsilon_{3}^j$};
25
\edge{e3}{w3};
26
\edge{w3}{y_n}
27
28
\node [detH, right=2cm of z2_n](w2){$w_{2}^j$};
29
\node [latent, above left= 0.5 cm of w2](e2){$\epsilon_{2}^j$};
30
\edge{e2}{w2};
31
\edge{w2}{z2_n}
32
33
\node [detH, right=2cm of z1_n](w1){$w_{1}^j$};
34
\node [latent, above left= 0.5 cm of w1](e1){$\epsilon_{1}^j$};
35
\edge{e1}{w1};
36
\edge{w1}{z1_n}
37
38
\plate[inner sep=.3cm]{plate_outer}{(plate_inner)(e3)(w1)(w2)(w3)}{$j=1:J$};
39
40
\node [latent, above right=1cm of w3](sigma3){$\sigma_{3}^0$};
41
\node[latent, right=1.2cm of w3](w30){$w_{3}^0$};
42
\edge{sigma3}{w3}
43
\edge{w30}{w3}
44
45
\node [latent, above right=1cm of w2](sigma2){$\sigma_{2}^0$};
46
\node[latent, right=1.2cm of w2](w20){$w_{2}^0$};
47
\edge{sigma2}{w2}
48
\edge{w20}{w2}
49
50
\node [latent, above right=1cm of w1](sigma1){$\sigma_{1}^0$};
51
\node[latent, right=1.2cm of w1](w10){$w_{1}^0$};
52
\edge{sigma1}{w1}
53
\edge{w10}{w1}
54
55
56
57
\end{tikzpicture}
58
\end{document}
59
60