Files
maths-cs-ai-compendium-zh/images/hmm_structure.svg
T

68 lines
4.0 KiB
XML

<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="hmm-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#333"/>
</marker>
<marker id="hmm-arrow-blue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#3498db"/>
</marker>
</defs>
<text x="350" y="25" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Hidden Markov Model Structure</text>
<!-- Hidden states (top row) -->
<text x="60" y="60" fill="#e74c3c" font-size="12" font-weight="bold">Hidden states:</text>
<circle cx="170" cy="95" r="35" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="170" y="100" fill="#e74c3c" font-size="13" text-anchor="middle" font-weight="bold">z₁</text>
<circle cx="330" cy="95" r="35" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="330" y="100" fill="#e74c3c" font-size="13" text-anchor="middle" font-weight="bold">z₂</text>
<circle cx="490" cy="95" r="35" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="490" y="100" fill="#e74c3c" font-size="13" text-anchor="middle" font-weight="bold">z₃</text>
<text x="590" y="100" fill="#e74c3c" font-size="18">···</text>
<!-- Transition arrows (horizontal) -->
<line x1="205" y1="95" x2="290" y2="95" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#hmm-arrow)"/>
<text x="248" y="85" fill="#e74c3c" font-size="10" text-anchor="middle">P(z₂|z₁)</text>
<line x1="365" y1="95" x2="450" y2="95" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#hmm-arrow)"/>
<text x="408" y="85" fill="#e74c3c" font-size="10" text-anchor="middle">P(z₃|z₂)</text>
<line x1="525" y1="95" x2="580" y2="95" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#hmm-arrow)"/>
<!-- Emission arrows (vertical) -->
<line x1="170" y1="130" x2="170" y2="185" stroke="#3498db" stroke-width="1.5" marker-end="url(#hmm-arrow-blue)"/>
<line x1="330" y1="130" x2="330" y2="185" stroke="#3498db" stroke-width="1.5" marker-end="url(#hmm-arrow-blue)"/>
<line x1="490" y1="130" x2="490" y2="185" stroke="#3498db" stroke-width="1.5" marker-end="url(#hmm-arrow-blue)"/>
<text x="148" y="163" fill="#3498db" font-size="9">P(x₁|z₁)</text>
<text x="308" y="163" fill="#3498db" font-size="9">P(x₂|z₂)</text>
<text x="468" y="163" fill="#3498db" font-size="9">P(x₃|z₃)</text>
<!-- Observations (bottom row) -->
<text x="60" y="215" fill="#3498db" font-size="12" font-weight="bold">Observations:</text>
<rect x="140" y="190" width="60" height="40" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="170" y="215" fill="#3498db" font-size="13" text-anchor="middle" font-weight="bold">x₁</text>
<rect x="300" y="190" width="60" height="40" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="330" y="215" fill="#3498db" font-size="13" text-anchor="middle" font-weight="bold">x₂</text>
<rect x="460" y="190" width="60" height="40" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="490" y="215" fill="#3498db" font-size="13" text-anchor="middle" font-weight="bold">x₃</text>
<text x="590" y="215" fill="#3498db" font-size="18">···</text>
<!-- Legend -->
<text x="170" y="260" fill="#e74c3c" font-size="11" text-anchor="middle">Hidden states are not</text>
<text x="170" y="276" fill="#e74c3c" font-size="11" text-anchor="middle">directly observed</text>
<text x="400" y="260" fill="#3498db" font-size="11" text-anchor="middle">Each hidden state emits</text>
<text x="400" y="276" fill="#3498db" font-size="11" text-anchor="middle">an observable signal</text>
<text x="600" y="260" fill="#666" font-size="11" text-anchor="middle">Markov property:</text>
<text x="600" y="276" fill="#666" font-size="11" text-anchor="middle">z_t depends only on z_{t-1}</text>
</svg>