| 1 |
.PS |
| 2 |
# Masked_Autoencoder.m4 |
| 3 |
gen_init |
| 4 |
NeedDpicTools |
| 5 |
|
| 6 |
circlerad = 0.2 |
| 7 |
circlesep = 0.5 |
| 8 |
rowsep = 0.9 |
| 9 |
arrowht = arrowht*0.8 |
| 10 |
arrowwid = arrowwid*1.4 |
| 11 |
linethick = 1 |
| 12 |
|
| 13 |
define plan { |
| 14 |
m = 0 |
| 15 |
for i=1 to 4 do { |
| 16 |
for j=1 to ncircles[i] do { |
| 17 |
exec sprintf("C[i,j]: circle thick 1.6 at Here \"\large\sf $%g\"",m+j) |
| 18 |
if i>1 then { |
| 19 |
if "$1"=="" then { |
| 20 |
for k=1 to ncircles[i-1] do { arrow from C[i,j] to C[i-1,k] chop } } |
| 21 |
} |
| 22 |
if j!=ncircles[i] then { move right_ circlesep from C[i,j] } |
| 23 |
} |
| 24 |
m += ncircles[i] |
| 25 |
case(i, |
| 26 |
move to C[1,1]+(-circlesep/2,-rowsep), |
| 27 |
move to C[2,1]+(0,-rowsep), |
| 28 |
move to C[3,1]+(circlesep/2,-rowsep), ) |
| 29 |
} |
| 30 |
} |
| 31 |
gridsiz = 0.78/4 |
| 32 |
define grid { [ SW: 0,0 |
| 33 |
for i=1 to $1 do { |
| 34 |
move to (0,(0.5-i)*gridsiz) |
| 35 |
exec sprintf("fv = $%g",2+i) |
| 36 |
for j=1 to $2 do { fl = 1-(int(fv / 2^(j-1)) % 2) |
| 37 |
box wid gridsiz ht gridsiz outlined "gray" shaded rgbstring(fl,fl,fl) } |
| 38 |
} ]} |
| 39 |
define cxt { |
| 40 |
m = 1 |
| 41 |
for i=2 to 4 do { |
| 42 |
for j=1 to ncircles[i] do { |
| 43 |
exec sprintf("narrows = $%g",m) |
| 44 |
for k=1 to narrows do { |
| 45 |
exec sprintf("cnum = $%g",m+k) |
| 46 |
arrow from C[i,j] to C[i-1,cnum] chop |
| 47 |
} |
| 48 |
m += narrows+1 |
| 49 |
} } } |
| 50 |
|
| 51 |
array(ncircles,3,4,4,3) |
| 52 |
plan() |
| 53 |
for j=1 to 3 do { |
| 54 |
sprintf("$\hat{x}_%g$",j) at C[1,j].n above |
| 55 |
sprintf("$x_%g$",j) at C[4,j].s+(0,-2bp__) below |
| 56 |
} |
| 57 |
"V" at 0.5 between C[2,1].w and C[1,1].w |
| 58 |
"W$^2$" at 0.5 between C[3,1].w and C[2,1].w |
| 59 |
"W$^1$" at 0.5 between C[3,1].w and C[4,1].w |
| 60 |
|
| 61 |
GV: grid(3,4,0,15,6) with .w at C[2,4]+(circlerad*2,rowsep/2) |
| 62 |
"$=\hbox{M}^{\hbox{V}}$" at GV.e ljust |
| 63 |
G2: grid(4,4,13,0,0,13) with .w at (GV.w,C[3,4]+(circlerad*2,rowsep/2)) |
| 64 |
"$=\hbox{M}^{\hbox{V}^2}$" at G2.e ljust |
| 65 |
G1: grid(4,3,1,5,1,1) with .w at (GV.w,C[4,3]+(circlerad*2,rowsep/2)) |
| 66 |
"$=\hbox{M}^{\hbox{V}^1}$" at G1.e ljust |
| 67 |
|
| 68 |
move to (GV.x+3*circlesep,C[1,1].y) |
| 69 |
plan(3,1,2,1,2,2,1,2,1,2,2,3,1,2) |
| 70 |
for i=2 to 4 do { |
| 71 |
rgbdraw(0.5,0.5,0.5, |
| 72 |
cxt(2,1,3,0,0,2,1,3, 0,4,1,2,3,4,0,0, 0,4,1,2,3,4,0) ) |
| 73 |
cxt(0,1,1,1,1,0, 2,2,3,0,2,2,3,2,2,3, 0,0,3,1,3,4) |
| 74 |
} |
| 75 |
for j=1 to 3 do { sprintf("$x_%g$",j) at C[4,j].s+(0,-2bp__) below } |
| 76 |
arrow dotted from C[1,2].n up circlesep/2; "$p(x_2)$" above |
| 77 |
"$p(x_3|x_2)$" at (C[1,3]+(circlesep/2,0),last "") above |
| 78 |
arrow dotted from C[1,3] to last "".s chop circlerad chop textoffset |
| 79 |
"$p(x_1|x_2,x_3)$" at (C[1,1]+(-circlesep/2,0),last "") above |
| 80 |
arrow dotted from C[1,1] to last "".s chop circlerad chop textoffset |
| 81 |
|
| 82 |
.PE |