Deployed 2536c93 with MkDocs version: 1.6.1
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
<svg width="720" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<marker id="s2s-arrow" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
|
||||
<polygon points="0 0, 7 2.5, 0 5" fill="#555"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<text x="360" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Sequence-to-Sequence (Encoder-Decoder) Architecture</text>
|
||||
|
||||
<!-- Encoder label -->
|
||||
<rect x="40" y="38" width="280" height="24" rx="4" fill="#3498db" opacity="0.1"/>
|
||||
<text x="180" y="55" fill="#3498db" font-size="12" font-weight="bold" text-anchor="middle">Encoder</text>
|
||||
|
||||
<!-- Encoder cells -->
|
||||
<rect x="60" y="80" width="60" height="40" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
|
||||
<text x="90" y="105" fill="#3498db" font-size="11" text-anchor="middle">h₁</text>
|
||||
|
||||
<rect x="150" y="80" width="60" height="40" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
|
||||
<text x="180" y="105" fill="#3498db" font-size="11" text-anchor="middle">h₂</text>
|
||||
|
||||
<rect x="240" y="80" width="60" height="40" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
|
||||
<text x="270" y="105" fill="#3498db" font-size="11" text-anchor="middle">h₃</text>
|
||||
|
||||
<!-- Encoder arrows -->
|
||||
<line x1="120" y1="100" x2="145" y2="100" stroke="#3498db" stroke-width="1.5" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="210" y1="100" x2="235" y2="100" stroke="#3498db" stroke-width="1.5" marker-end="url(#s2s-arrow)"/>
|
||||
|
||||
<!-- Input words -->
|
||||
<text x="90" y="150" fill="#333" font-size="12" text-anchor="middle">le</text>
|
||||
<text x="180" y="150" fill="#333" font-size="12" text-anchor="middle">chat</text>
|
||||
<text x="270" y="150" fill="#333" font-size="12" text-anchor="middle">dort</text>
|
||||
<line x1="90" y1="138" x2="90" y2="120" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="180" y1="138" x2="180" y2="120" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="270" y1="138" x2="270" y2="120" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
|
||||
<!-- Context vector -->
|
||||
<line x1="300" y1="100" x2="380" y2="100" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#s2s-arrow)"/>
|
||||
<rect x="325" y="70" width="55" height="20" rx="4" fill="#e74c3c" opacity="0.1"/>
|
||||
<text x="352" y="84" fill="#e74c3c" font-size="9" text-anchor="middle" font-weight="bold">context</text>
|
||||
|
||||
<!-- Decoder label -->
|
||||
<rect x="390" y="38" width="290" height="24" rx="4" fill="#27ae60" opacity="0.1"/>
|
||||
<text x="535" y="55" fill="#27ae60" font-size="12" font-weight="bold" text-anchor="middle">Decoder</text>
|
||||
|
||||
<!-- Decoder cells -->
|
||||
<rect x="390" y="80" width="60" height="40" rx="6" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
|
||||
<text x="420" y="105" fill="#27ae60" font-size="11" text-anchor="middle">s₁</text>
|
||||
|
||||
<rect x="480" y="80" width="60" height="40" rx="6" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
|
||||
<text x="510" y="105" fill="#27ae60" font-size="11" text-anchor="middle">s₂</text>
|
||||
|
||||
<rect x="570" y="80" width="60" height="40" rx="6" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
|
||||
<text x="600" y="105" fill="#27ae60" font-size="11" text-anchor="middle">s₃</text>
|
||||
|
||||
<!-- Decoder arrows -->
|
||||
<line x1="450" y1="100" x2="475" y2="100" stroke="#27ae60" stroke-width="1.5" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="540" y1="100" x2="565" y2="100" stroke="#27ae60" stroke-width="1.5" marker-end="url(#s2s-arrow)"/>
|
||||
|
||||
<!-- Decoder input words (teacher forcing) -->
|
||||
<text x="420" y="150" fill="#999" font-size="11" text-anchor="middle"><SOS></text>
|
||||
<text x="510" y="150" fill="#999" font-size="11" text-anchor="middle">the</text>
|
||||
<text x="600" y="150" fill="#999" font-size="11" text-anchor="middle">cat</text>
|
||||
<line x1="420" y1="138" x2="420" y2="120" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="510" y1="138" x2="510" y2="120" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="600" y1="138" x2="600" y2="120" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
|
||||
<!-- Output words -->
|
||||
<line x1="420" y1="80" x2="420" y2="45" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="510" y1="80" x2="510" y2="45" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
<line x1="600" y1="80" x2="600" y2="45" stroke="#555" stroke-width="1" marker-end="url(#s2s-arrow)"/>
|
||||
|
||||
<text x="420" y="40" fill="#27ae60" font-size="12" text-anchor="middle" font-weight="bold">the</text>
|
||||
<text x="510" y="40" fill="#27ae60" font-size="12" text-anchor="middle" font-weight="bold">cat</text>
|
||||
<text x="600" y="40" fill="#27ae60" font-size="12" text-anchor="middle" font-weight="bold">sleeps</text>
|
||||
|
||||
<!-- Labels -->
|
||||
<text x="180" y="175" fill="#3498db" font-size="10" text-anchor="middle">French input</text>
|
||||
<text x="510" y="175" fill="#27ae60" font-size="10" text-anchor="middle">English output</text>
|
||||
|
||||
<!-- Bottom explanation -->
|
||||
<rect x="50" y="195" width="620" height="50" rx="8" fill="#f5f5f5" stroke="#ddd" stroke-width="1"/>
|
||||
<text x="360" y="213" fill="#555" font-size="10" text-anchor="middle">The encoder compresses the input into a fixed-size context vector (final hidden state).</text>
|
||||
<text x="360" y="228" fill="#555" font-size="10" text-anchor="middle">The decoder generates output tokens one at a time, conditioned on this context.</text>
|
||||
<text x="360" y="243" fill="#e74c3c" font-size="10" text-anchor="middle">Bottleneck: all information must squeeze through one vector → motivates attention.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
Reference in New Issue
Block a user