Deployed 2536c93 with MkDocs version: 1.6.1

This commit is contained in:
2026-05-03 11:47:30 +08:00
commit 1ff86b66fc
418 changed files with 617336 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 220" width="650" height="220">
<defs>
<marker id="ab-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="325" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">A/B Testing: Measuring Model Impact</text>
<!-- Users -->
<rect x="30" y="70" width="80" height="80" rx="10" fill="#555" fill-opacity="0.1" stroke="#555" stroke-width="1.5"/>
<text x="70" y="105" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#555">All Users</text>
<text x="70" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#555">100%</text>
<!-- Random split -->
<line x1="110" y1="90" x2="175" y2="75" stroke="#3498db" stroke-width="2" marker-end="url(#ab-arr)"/>
<line x1="110" y1="130" x2="175" y2="145" stroke="#e74c3c" stroke-width="2" marker-end="url(#ab-arr)"/>
<text x="148" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">random</text>
<text x="148" y="112" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">split</text>
<!-- Control group -->
<rect x="183" y="50" width="130" height="55" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="2"/>
<text x="248" y="72" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Control (50%)</text>
<text x="248" y="88" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">Old Model v1</text>
<text x="248" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">CTR = 4.2%</text>
<!-- Treatment group -->
<rect x="183" y="115" width="130" height="55" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="2"/>
<text x="248" y="137" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Treatment (50%)</text>
<text x="248" y="153" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">New Model v2</text>
<text x="248" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">CTR = 4.5%</text>
<!-- Results -->
<line x1="313" y1="77" x2="370" y2="110" stroke="#3498db" stroke-width="1.2" marker-end="url(#ab-arr)"/>
<line x1="313" y1="142" x2="370" y2="115" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#ab-arr)"/>
<rect x="378" y="80" width="240" height="65" rx="10" fill="#27ae60" fill-opacity="0.06" stroke="#27ae60" stroke-width="1.5"/>
<text x="498" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Statistical Analysis</text>
<text x="498" y="118" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">Δ CTR = +0.3% (p = 0.02, significant)</text>
<text x="498" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">Guardrails: latency OK, errors OK</text>
<!-- Decision -->
<text x="498" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">→ Ship v2 to 100%</text>
<text x="325" y="205" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Run for 1-2 weeks to capture day-of-week effects and reach statistical significance</text>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

+65
View File
@@ -0,0 +1,65 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 220" width="700" height="220">
<defs>
<marker id="at-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Action Tokenisation: Continuous → Discrete Bins → Tokens</text>
<!-- Continuous action -->
<rect x="30" y="55" width="160" height="110" rx="10" fill="#3498db" fill-opacity="0.08" stroke="#3498db" stroke-width="1.5"/>
<text x="110" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">Continuous Action</text>
<text x="110" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#3498db">Δx = 0.023 m/s</text>
<text x="110" y="116" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#3498db">Δy = -0.051 m/s</text>
<text x="110" y="132" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#3498db">grip = 0.8</text>
<text x="110" y="152" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">7 dimensions</text>
<line x1="190" y1="110" x2="228" y2="110" stroke="#666" stroke-width="1.5" marker-end="url(#at-arr)"/>
<!-- Binning -->
<rect x="236" y="55" width="180" height="110" rx="10" fill="#f39c12" fill-opacity="0.08" stroke="#f39c12" stroke-width="1.5"/>
<text x="326" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#f39c12">Discretise (256 bins)</text>
<!-- Bin visualisation for one dimension -->
<g transform="translate(256, 90)">
<rect x="0" y="0" width="140" height="20" fill="#eee" stroke="#ccc" stroke-width="0.5" rx="3"/>
<!-- Bins -->
<rect x="0" y="0" width="11.7" height="20" fill="#f39c12" fill-opacity="0.1" stroke="#ddd" stroke-width="0.3"/>
<rect x="82" y="0" width="11.7" height="20" fill="#f39c12" fill-opacity="0.4" stroke="#f39c12" stroke-width="1"/>
<!-- Marker -->
<line x1="87" y1="-5" x2="87" y2="25" stroke="#e74c3c" stroke-width="1.5"/>
<text x="87" y="40" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">bin 159</text>
</g>
<text x="326" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">each dim → nearest bin index</text>
<line x1="416" y1="110" x2="454" y2="110" stroke="#666" stroke-width="1.5" marker-end="url(#at-arr)"/>
<!-- Token sequence -->
<rect x="462" y="55" width="210" height="110" rx="10" fill="#27ae60" fill-opacity="0.08" stroke="#27ae60" stroke-width="1.5"/>
<text x="567" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">Token Sequence</text>
<!-- Tokens -->
<g transform="translate(477, 90)">
<rect x="0" y="0" width="26" height="24" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="13" y="16" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">159</text>
<rect x="30" y="0" width="26" height="24" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="43" y="16" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">63</text>
<rect x="60" y="0" width="26" height="24" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="73" y="16" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">143</text>
<rect x="90" y="0" width="26" height="24" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="103" y="16" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">...</text>
<rect x="120" y="0" width="26" height="24" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="133" y="16" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">204</text>
<rect x="150" y="0" width="26" height="24" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="163" y="16" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">91</text>
</g>
<text x="567" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">fed to LLM like text tokens</text>
<!-- Bottom note -->
<text x="350" y="205" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Each action dimension is independently binned into 256 discrete tokens → LLM generates them autoregressively</text>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

+51
View File
@@ -0,0 +1,51 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Common Activation Functions</text>
<!-- === ReLU (top-left) === -->
<text x="130" y="48" fill="#3498db" font-size="12" font-weight="bold" text-anchor="middle">ReLU</text>
<!-- Axes -->
<line x1="50" y1="130" x2="210" y2="130" stroke="#999" stroke-width="0.8"/>
<line x1="130" y1="60" x2="130" y2="145" stroke="#999" stroke-width="0.8"/>
<!-- Curve: flat at 0 for x<0, linear for x>0 -->
<path d="M 50,130 L 130,130 L 210,60" fill="none" stroke="#3498db" stroke-width="2.2"/>
<text x="160" y="80" fill="#3498db" font-size="9">max(0, x)</text>
<!-- === Sigmoid (top-right) === -->
<text x="300" y="48" fill="#e74c3c" font-size="12" font-weight="bold" text-anchor="middle">Sigmoid</text>
<line x1="220" y1="130" x2="380" y2="130" stroke="#999" stroke-width="0.8"/>
<line x1="300" y1="60" x2="300" y2="145" stroke="#999" stroke-width="0.8"/>
<path d="M 220,128 C 240,128 260,127 270,122 C 280,115 290,100 300,95 C 310,90 320,78 330,72 C 340,67 360,63 380,62" fill="none" stroke="#e74c3c" stroke-width="2.2"/>
<text x="365" y="58" fill="#e74c3c" font-size="9">1</text>
<text x="365" y="133" fill="#e74c3c" font-size="9">0</text>
<line x1="220" y1="62" x2="380" y2="62" stroke="#e74c3c" stroke-width="0.5" stroke-dasharray="3,3" opacity="0.5"/>
<!-- === Tanh (bottom-left) === -->
<text x="130" y="175" fill="#27ae60" font-size="12" font-weight="bold" text-anchor="middle">Tanh</text>
<line x1="50" y1="240" x2="210" y2="240" stroke="#999" stroke-width="0.8"/>
<line x1="130" y1="185" x2="130" y2="280" stroke="#999" stroke-width="0.8"/>
<path d="M 50,275 C 70,274 85,272 95,265 C 105,255 115,245 130,240 C 145,235 155,225 165,215 C 175,208 190,206 210,205" fill="none" stroke="#27ae60" stroke-width="2.2"/>
<text x="45" y="279" fill="#27ae60" font-size="9">-1</text>
<text x="215" y="202" fill="#27ae60" font-size="9">1</text>
<line x1="50" y1="205" x2="210" y2="205" stroke="#27ae60" stroke-width="0.5" stroke-dasharray="3,3" opacity="0.5"/>
<line x1="50" y1="275" x2="210" y2="275" stroke="#27ae60" stroke-width="0.5" stroke-dasharray="3,3" opacity="0.5"/>
<!-- === GELU (bottom-right) === -->
<text x="300" y="175" fill="#9b59b6" font-size="12" font-weight="bold" text-anchor="middle">GELU</text>
<line x1="220" y1="240" x2="380" y2="240" stroke="#999" stroke-width="0.8"/>
<line x1="300" y1="185" x2="300" y2="270" stroke="#999" stroke-width="0.8"/>
<!-- GELU: smooth curve, slightly negative dip around x=-1 -->
<path d="M 220,243 C 240,245 255,246 270,244 C 280,243 290,241 300,240 C 310,237 320,228 340,215 C 355,205 370,195 380,185" fill="none" stroke="#9b59b6" stroke-width="2.2"/>
<text x="330" y="198" fill="#9b59b6" font-size="9">x·Φ(x)</text>
<!-- Summary boxes on the right -->
<rect x="420" y="55" width="260" height="105" rx="6" fill="#f5f5f5" stroke="#ddd" stroke-width="1"/>
<text x="550" y="75" fill="#333" font-size="11" text-anchor="middle" font-weight="bold">Properties</text>
<text x="435" y="95" fill="#3498db" font-size="10">ReLU: sparse, fast, can "die"</text>
<text x="435" y="112" fill="#e74c3c" font-size="10">Sigmoid: (0,1), vanishing gradients</text>
<text x="435" y="129" fill="#27ae60" font-size="10">Tanh: (-1,1), zero-centred</text>
<text x="435" y="146" fill="#9b59b6" font-size="10">GELU: smooth ReLU, used in GPT</text>
<!-- Bottom note -->
<rect x="140" y="280" width="420" height="18" rx="4" fill="#f5f5f5" stroke="#333" stroke-width="0.8"/>
<text x="350" y="293" fill="#333" font-size="10" text-anchor="middle">Nonlinearities are essential: without them, stacking layers collapses to one linear map</text>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

+45
View File
@@ -0,0 +1,45 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="ac-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="none" stroke="#555" stroke-width="1"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Actor-Critic Architecture</text>
<!-- Shared input -->
<rect x="280" y="240" width="140" height="30" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1.5"/>
<text x="350" y="260" fill="#333" font-size="11" font-weight="bold" text-anchor="middle">State s_t</text>
<!-- Shared backbone (optional) -->
<line x1="320" y1="240" x2="200" y2="195" stroke="#555" stroke-width="1.5" marker-end="url(#ac-arrow)"/>
<line x1="380" y1="240" x2="500" y2="195" stroke="#555" stroke-width="1.5" marker-end="url(#ac-arrow)"/>
<!-- Actor head (left) -->
<rect x="115" y="140" width="170" height="55" rx="8" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="200" y="162" fill="#3498db" font-size="13" font-weight="bold" text-anchor="middle">Actor (Policy)</text>
<text x="200" y="180" fill="#3498db" font-size="11" text-anchor="middle">pi(a|s; theta)</text>
<!-- Critic head (right) -->
<rect x="415" y="140" width="170" height="55" rx="8" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="500" y="162" fill="#e74c3c" font-size="13" font-weight="bold" text-anchor="middle">Critic (Value)</text>
<text x="500" y="180" fill="#e74c3c" font-size="11" text-anchor="middle">V(s; phi)</text>
<!-- Actor output -->
<line x1="200" y1="140" x2="200" y2="105" stroke="#3498db" stroke-width="1.5" marker-end="url(#ac-arrow)"/>
<rect x="135" y="75" width="130" height="30" rx="14" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<text x="200" y="95" fill="#3498db" font-size="11" font-weight="bold" text-anchor="middle">Action a_t</text>
<!-- Critic output -->
<line x1="500" y1="140" x2="500" y2="105" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#ac-arrow)"/>
<rect x="430" y="75" width="140" height="30" rx="14" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1.5"/>
<text x="500" y="95" fill="#e74c3c" font-size="11" font-weight="bold" text-anchor="middle">Value estimate</text>
<!-- Advantage signal from critic to actor -->
<path d="M 430,85 C 380,55 320,55 285,75" fill="none" stroke="#9b59b6" stroke-width="1.8" stroke-dasharray="5,3" marker-end="url(#ac-arrow)"/>
<text x="350" y="48" fill="#9b59b6" font-size="11" font-weight="bold" text-anchor="middle">advantage = r + gamma*V(s') - V(s)</text>
<text x="350" y="64" fill="#9b59b6" font-size="10" text-anchor="middle">(guides policy update)</text>
<!-- Summary -->
<rect x="120" y="280" width="460" height="18" rx="4" fill="#f5f5f5" stroke="#333" stroke-width="0.8"/>
<text x="350" y="293" fill="#333" font-size="10" text-anchor="middle">Actor decides what to do. Critic evaluates how good the decision was.</text>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

+21
View File
@@ -0,0 +1,21 @@
<svg width="320" height="100" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow-inv-v" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#e74c3c"/>
</marker>
<marker id="arrow-inv-neg" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3498db"/>
</marker>
</defs>
<!-- v going right -->
<line x1="30" y1="45" x2="118" y2="45" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#arrow-inv-v)"/>
<text x="75" y="35" fill="#e74c3c" font-size="14" font-weight="bold" text-anchor="middle">v</text>
<!-- -v going back left from tip of v -->
<line x1="126" y1="45" x2="38" y2="45" stroke="#3498db" stroke-width="2.5" marker-end="url(#arrow-inv-neg)"/>
<text x="85" y="70" fill="#3498db" font-size="14" font-weight="bold" text-anchor="middle">-v</text>
<circle cx="30" cy="45" r="3" fill="#333"/>
<!-- equals zero -->
<text x="155" y="50" fill="#333" font-size="18">=</text>
<circle cx="195" cy="45" r="5" fill="#999"/>
<text x="195" y="75" fill="#999" font-size="14" font-weight="bold" text-anchor="middle">0</text>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+33
View File
@@ -0,0 +1,33 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 220" width="650" height="220">
<text x="325" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Amdahl's Law: The Serial Bottleneck</text>
<!-- 1 processor -->
<text x="30" y="62" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">1 core:</text>
<rect x="100" y="48" width="100" height="24" rx="3" fill="#e74c3c" fill-opacity="0.3" stroke="#e74c3c" stroke-width="1"/>
<text x="150" y="64" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">serial (10%)</text>
<rect x="200" y="48" width="400" height="24" rx="3" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="1"/>
<text x="400" y="64" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">parallel (90%)</text>
<!-- 4 processors -->
<text x="30" y="107" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">4 cores:</text>
<rect x="100" y="93" width="100" height="24" rx="3" fill="#e74c3c" fill-opacity="0.3" stroke="#e74c3c" stroke-width="1"/>
<text x="150" y="109" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">serial (10%)</text>
<rect x="200" y="93" width="100" height="24" rx="3" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="1"/>
<text x="250" y="109" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">90% ÷ 4</text>
<text x="320" y="109" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#27ae60">→ 3.1x speedup</text>
<!-- 16 processors -->
<text x="30" y="147" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">16 cores:</text>
<rect x="100" y="133" width="100" height="24" rx="3" fill="#e74c3c" fill-opacity="0.3" stroke="#e74c3c" stroke-width="1"/>
<text x="150" y="149" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">serial (10%)</text>
<rect x="200" y="133" width="25" height="24" rx="3" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="1"/>
<text x="253" y="149" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#27ae60">→ 6.4x speedup</text>
<!-- Infinite processors -->
<text x="30" y="187" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">∞ cores:</text>
<rect x="100" y="173" width="100" height="24" rx="3" fill="#e74c3c" fill-opacity="0.3" stroke="#e74c3c" stroke-width="1"/>
<text x="150" y="189" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">serial (10%)</text>
<text x="220" y="189" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">→ 10x max!</text>
<text x="325" y="215" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">The serial fraction (red) cannot be parallelised — it limits the maximum speedup to 1/(1−p)</text>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

+187
View File
@@ -0,0 +1,187 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 350" width="800" height="350">
<defs>
<marker id="arrow-ata" viewBox="0 0 10 7" refX="10" refY="3.5" markerWidth="8" markerHeight="6" orient="auto-start-reverse">
<path d="M0,0 L10,3.5 L0,7z" fill="#666"/>
</marker>
<marker id="arrow-ata-purple" viewBox="0 0 10 7" refX="10" refY="3.5" markerWidth="8" markerHeight="6" orient="auto-start-reverse">
<path d="M0,0 L10,3.5 L0,7z" fill="#9b59b6"/>
</marker>
</defs>
<!-- Title -->
<text x="400" y="24" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Any-to-Any Model Architectures</text>
<!-- ===== Column 1: CoDi ===== -->
<text x="135" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#333">CoDi</text>
<!-- Diffusion models -->
<rect x="35" y="68" width="70" height="30" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="70" y="87" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">Image Diff.</text>
<rect x="115" y="68" width="70" height="30" rx="6" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="150" y="87" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">Text Diff.</text>
<rect x="195" y="68" width="70" height="30" rx="6" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="230" y="87" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">Audio Diff.</text>
<!-- Arrows down to shared latent -->
<line x1="70" y1="98" x2="70" y2="126" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="150" y1="98" x2="150" y2="126" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="230" y1="98" x2="230" y2="126" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<!-- Aligned Conditioning bridge -->
<rect x="30" y="128" width="240" height="34" rx="8" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="150" y="149" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">Aligned Conditioning (Shared Latent)</text>
<!-- Arrows down to output diffusion -->
<line x1="70" y1="162" x2="70" y2="188" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="150" y1="162" x2="150" y2="188" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="230" y1="162" x2="230" y2="188" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<!-- Output diffusion models -->
<rect x="35" y="190" width="70" height="30" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="70" y="209" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">Image Out</text>
<rect x="115" y="190" width="70" height="30" rx="6" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="150" y="209" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">Text Out</text>
<rect x="195" y="190" width="70" height="30" rx="6" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="230" y="209" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">Audio Out</text>
<text x="150" y="242" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666" font-style="italic">Composable Diffusion</text>
<!-- ===== Column 2: NExT-GPT ===== -->
<text x="420" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#333">NExT-GPT</text>
<!-- Frozen Encoders -->
<rect x="310" y="68" width="60" height="28" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="340" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">Img Enc</text>
<text x="376" y="78" font-family="Arial, sans-serif" font-size="10" fill="#3498db">*</text>
<rect x="390" y="68" width="60" height="28" rx="6" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="420" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#27ae60">Aud Enc</text>
<text x="456" y="78" font-family="Arial, sans-serif" font-size="10" fill="#27ae60">*</text>
<rect x="460" y="68" width="60" height="28" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="490" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">Vid Enc</text>
<text x="526" y="78" font-family="Arial, sans-serif" font-size="10" fill="#f39c12">*</text>
<text x="312" y="63" font-family="Arial, sans-serif" font-size="9" fill="#999">* = frozen</text>
<!-- Projection layers (input) -->
<rect x="315" y="104" width="50" height="14" rx="3" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="340" y="114" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">Proj.</text>
<rect x="395" y="104" width="50" height="14" rx="3" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="420" y="114" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">Proj.</text>
<rect x="465" y="104" width="50" height="14" rx="3" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="490" y="114" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">Proj.</text>
<!-- Arrows encoder → proj -->
<line x1="340" y1="96" x2="340" y2="103" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="420" y1="96" x2="420" y2="103" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="490" y1="96" x2="490" y2="103" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<!-- LLM Hub -->
<rect x="325" y="126" width="190" height="46" rx="8" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="2"/>
<text x="420" y="153" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#9b59b6">LLM Hub</text>
<!-- Arrows proj → LLM -->
<line x1="340" y1="118" x2="370" y2="124" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="420" y1="118" x2="420" y2="124" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="490" y1="118" x2="470" y2="124" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<!-- Projection layers (output) -->
<rect x="315" y="180" width="50" height="14" rx="3" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="340" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">Proj.</text>
<rect x="395" y="180" width="50" height="14" rx="3" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="420" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">Proj.</text>
<rect x="465" y="180" width="50" height="14" rx="3" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="490" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">Proj.</text>
<!-- Arrows LLM → proj -->
<line x1="370" y1="172" x2="340" y2="179" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="420" y1="172" x2="420" y2="179" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="470" y1="172" x2="490" y2="179" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<!-- Frozen Decoders -->
<rect x="310" y="202" width="60" height="28" rx="6" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="340" y="219" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">Img Dec</text>
<text x="376" y="210" font-family="Arial, sans-serif" font-size="10" fill="#e74c3c">*</text>
<rect x="390" y="202" width="60" height="28" rx="6" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="420" y="219" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">Aud Dec</text>
<text x="456" y="210" font-family="Arial, sans-serif" font-size="10" fill="#e74c3c">*</text>
<rect x="460" y="202" width="60" height="28" rx="6" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="490" y="219" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">Vid Dec</text>
<text x="526" y="210" font-family="Arial, sans-serif" font-size="10" fill="#e74c3c">*</text>
<!-- Arrows proj → decoders -->
<line x1="340" y1="194" x2="340" y2="201" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="420" y1="194" x2="420" y2="201" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<line x1="490" y1="194" x2="490" y2="201" stroke="#666" stroke-width="1" marker-end="url(#arrow-ata)"/>
<text x="420" y="248" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666" font-style="italic">LLM as Hub</text>
<!-- ===== Column 3: Gemini-style ===== -->
<text x="670" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#333">Gemini-style</text>
<!-- One large encompassing box -->
<rect x="595" y="64" width="150" height="170" rx="10" fill="#1abc9c" fill-opacity="0.10" stroke="#1abc9c" stroke-width="2"/>
<text x="670" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#1abc9c">Natively Multimodal</text>
<text x="670" y="97" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#1abc9c">Transformer</text>
<!-- Interleaved tokens inside -->
<rect x="615" y="110" width="22" height="16" rx="3" fill="#e74c3c" fill-opacity="0.3" stroke="#e74c3c" stroke-width="0.8"/>
<text x="626" y="121" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#e74c3c">T</text>
<rect x="641" y="110" width="22" height="16" rx="3" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="0.8"/>
<text x="652" y="121" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">I</text>
<rect x="667" y="110" width="22" height="16" rx="3" fill="#e74c3c" fill-opacity="0.3" stroke="#e74c3c" stroke-width="0.8"/>
<text x="678" y="121" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#e74c3c">T</text>
<rect x="693" y="110" width="22" height="16" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<text x="704" y="121" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#27ae60">A</text>
<rect x="615" y="132" width="22" height="16" rx="3" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="0.8"/>
<text x="626" y="143" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">I</text>
<rect x="641" y="132" width="22" height="16" rx="3" fill="#f39c12" fill-opacity="0.3" stroke="#f39c12" stroke-width="0.8"/>
<text x="652" y="143" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">V</text>
<rect x="667" y="132" width="22" height="16" rx="3" fill="#e74c3c" fill-opacity="0.3" stroke="#e74c3c" stroke-width="0.8"/>
<text x="678" y="143" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#e74c3c">T</text>
<rect x="693" y="132" width="22" height="16" rx="3" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="0.8"/>
<text x="704" y="143" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">I</text>
<!-- Self-attention lines -->
<text x="670" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#1abc9c">Cross-modal</text>
<text x="670" y="176" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#1abc9c">self-attention</text>
<!-- Attention arcs -->
<path d="M630,155 Q650,185 670,155" fill="none" stroke="#1abc9c" stroke-width="0.8" stroke-dasharray="2,2"/>
<path d="M660,155 Q685,190 710,155" fill="none" stroke="#1abc9c" stroke-width="0.8" stroke-dasharray="2,2"/>
<!-- Output arrow -->
<text x="670" y="200" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">Any modality in → Any out</text>
<text x="670" y="215" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">(single model)</text>
<text x="670" y="248" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666" font-style="italic">Native Integration</text>
<!-- ===== Spectrum Arrow ===== -->
<line x1="60" y1="290" x2="740" y2="290" stroke="#9b59b6" stroke-width="2" marker-end="url(#arrow-ata-purple)"/>
<line x1="60" y1="290" x2="740" y2="290" stroke="#9b59b6" stroke-width="2" marker-start="url(#arrow-ata-purple)"/>
<text x="130" y="310" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#9b59b6">Shallow Integration</text>
<text x="670" y="310" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#9b59b6">Deep Integration</text>
<!-- Vertical dividers -->
<line x1="280" y1="42" x2="280" y2="265" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<line x1="560" y1="42" x2="560" y2="265" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

+40
View File
@@ -0,0 +1,40 @@
<svg width="380" height="200" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="auc-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#ccc"/>
</marker>
</defs>
<!-- Axes -->
<line x1="40" y1="165" x2="360" y2="165" stroke="#ccc" stroke-width="1" marker-end="url(#auc-arr)"/>
<line x1="40" y1="165" x2="40" y2="15" stroke="#ccc" stroke-width="1" marker-end="url(#auc-arr)"/>
<text x="365" y="168" fill="#999" font-size="10">x</text>
<text x="35" y="12" fill="#999" font-size="10">y</text>
<!-- Rectangles (Riemann sum) -->
<rect x="80" y="110" width="30" height="55" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="110" y="85" width="30" height="80" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="140" y="65" width="30" height="100" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="170" y="50" width="30" height="115" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="200" y="42" width="30" height="123" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="230" y="40" width="30" height="125" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="260" y="48" width="30" height="117" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="290" y="68" width="30" height="97" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="0.8"/>
<!-- Curve -->
<path d="M 60,145 Q 110,110 150,70 Q 190,40 230,38 Q 270,42 300,65 Q 330,95 345,120"
fill="none" stroke="#e74c3c" stroke-width="2.5"/>
<text x="348" y="118" fill="#e74c3c" font-size="11">f(x)</text>
<!-- Boundary markers -->
<line x1="80" y1="165" x2="80" y2="160" stroke="#333" stroke-width="1.5"/>
<text x="80" y="178" text-anchor="middle" fill="#333" font-size="10">a</text>
<line x1="320" y1="165" x2="320" y2="160" stroke="#333" stroke-width="1.5"/>
<text x="320" y="178" text-anchor="middle" fill="#333" font-size="10">b</text>
<!-- Delta x annotation -->
<line x1="140" y1="165" x2="170" y2="165" stroke="#3498db" stroke-width="2"/>
<text x="155" y="158" text-anchor="middle" fill="#3498db" font-size="9">Δx</text>
<text x="200" y="195" text-anchor="middle" fill="#666" font-size="10">more rectangles → better approximation → integral</text>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

+65
View File
@@ -0,0 +1,65 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 300" width="700" height="300">
<defs>
<marker id="arrow1" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#333"/>
</marker>
<marker id="arrow1blue" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#3498db"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">ASR Pipeline: Audio to Text</text>
<!-- Waveform box -->
<rect x="15" y="70" width="95" height="55" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="62" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Waveform</text>
<!-- Mini waveform drawing -->
<polyline points="25,108 33,100 38,115 43,98 48,112 53,100 58,110 63,97 68,113 73,102 78,108 83,97 88,110 95,105" fill="none" stroke="#3498db" stroke-width="1" stroke-opacity="0.6"/>
<!-- Arrow 1 -->
<line x1="115" y1="97" x2="142" y2="97" stroke="#333" stroke-width="1.5" marker-end="url(#arrow1)"/>
<!-- Feature Extraction box -->
<rect x="148" y="70" width="110" height="55" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="203" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Feature</text>
<text x="203" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Extraction</text>
<text x="203" y="117" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">(MFCCs / Mel)</text>
<!-- Arrow 2 -->
<line x1="263" y1="97" x2="290" y2="97" stroke="#333" stroke-width="1.5" marker-end="url(#arrow1)"/>
<!-- Acoustic Model box -->
<rect x="296" y="70" width="110" height="55" rx="8" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="351" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Acoustic</text>
<text x="351" y="105" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Model</text>
<!-- Arrow 3 -->
<line x1="411" y1="97" x2="438" y2="97" stroke="#333" stroke-width="1.5" marker-end="url(#arrow1)"/>
<!-- Decoder box -->
<rect x="444" y="70" width="100" height="55" rx="8" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="494" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">Decoder</text>
<!-- Arrow 4 -->
<line x1="549" y1="97" x2="576" y2="97" stroke="#333" stroke-width="1.5" marker-end="url(#arrow1)"/>
<!-- Text output box -->
<rect x="582" y="70" width="100" height="55" rx="8" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="632" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#9b59b6">Text</text>
<text x="632" y="109" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">"hello world"</text>
<!-- Language Model box below decoder -->
<rect x="434" y="180" width="120" height="45" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="494" y="200" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Language</text>
<text x="494" y="213" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Model</text>
<!-- Arrow from Language Model to Decoder -->
<line x1="494" y1="178" x2="494" y2="130" stroke="#3498db" stroke-width="1.5" marker-end="url(#arrow1blue)"/>
<text x="510" y="160" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#3498db">P(word seq)</text>
<!-- Note box -->
<rect x="40" y="248" width="620" height="38" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="264" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">Traditional pipeline: each component trained separately.</text>
<text x="350" y="278" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">End-to-end: single neural network replaces the entire pipeline.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

+79
View File
@@ -0,0 +1,79 @@
<svg width="500" height="380" xmlns="http://www.w3.org/2000/svg">
<text x="250" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Attention Alignment: French → English Translation</text>
<!-- Column headers (source/French) -->
<text x="140" y="58" fill="#3498db" font-size="11" text-anchor="middle">le</text>
<text x="200" y="58" fill="#3498db" font-size="11" text-anchor="middle">chat</text>
<text x="260" y="58" fill="#3498db" font-size="11" text-anchor="middle">noir</text>
<text x="320" y="58" fill="#3498db" font-size="11" text-anchor="middle">dort</text>
<text x="380" y="58" fill="#3498db" font-size="11" text-anchor="middle">bien</text>
<text x="260" y="45" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">Source (French)</text>
<!-- Row headers (target/English) -->
<text x="90" y="100" fill="#27ae60" font-size="11" text-anchor="end">the</text>
<text x="90" y="160" fill="#27ae60" font-size="11" text-anchor="end">black</text>
<text x="90" y="220" fill="#27ae60" font-size="11" text-anchor="end">cat</text>
<text x="90" y="280" fill="#27ae60" font-size="11" text-anchor="end">sleeps</text>
<text x="90" y="340" fill="#27ae60" font-size="11" text-anchor="end">well</text>
<text x="55" y="220" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold" transform="rotate(-90, 55, 220)">Target (English)</text>
<!-- Grid cells - row 1: "the" -->
<rect x="110" y="75" width="60" height="50" rx="3" fill="#3498db" opacity="0.75" stroke="white" stroke-width="1"/>
<text x="140" y="105" fill="white" font-size="11" text-anchor="middle">.82</text>
<rect x="170" y="75" width="60" height="50" rx="3" fill="#3498db" opacity="0.08" stroke="white" stroke-width="1"/>
<text x="200" y="105" fill="#999" font-size="11" text-anchor="middle">.05</text>
<rect x="230" y="75" width="60" height="50" rx="3" fill="#3498db" opacity="0.05" stroke="white" stroke-width="1"/>
<text x="260" y="105" fill="#999" font-size="11" text-anchor="middle">.03</text>
<rect x="290" y="75" width="60" height="50" rx="3" fill="#3498db" opacity="0.06" stroke="white" stroke-width="1"/>
<text x="320" y="105" fill="#999" font-size="11" text-anchor="middle">.06</text>
<rect x="350" y="75" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="380" y="105" fill="#999" font-size="11" text-anchor="middle">.04</text>
<!-- Row 2: "black" -->
<rect x="110" y="135" width="60" height="50" rx="3" fill="#3498db" opacity="0.05" stroke="white" stroke-width="1"/>
<text x="140" y="165" fill="#999" font-size="11" text-anchor="middle">.03</text>
<rect x="170" y="135" width="60" height="50" rx="3" fill="#3498db" opacity="0.08" stroke="white" stroke-width="1"/>
<text x="200" y="165" fill="#999" font-size="11" text-anchor="middle">.06</text>
<rect x="230" y="135" width="60" height="50" rx="3" fill="#3498db" opacity="0.80" stroke="white" stroke-width="1"/>
<text x="260" y="165" fill="white" font-size="11" text-anchor="middle">.85</text>
<rect x="290" y="135" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="320" y="165" fill="#999" font-size="11" text-anchor="middle">.03</text>
<rect x="350" y="135" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="380" y="165" fill="#999" font-size="11" text-anchor="middle">.03</text>
<!-- Row 3: "cat" -->
<rect x="110" y="195" width="60" height="50" rx="3" fill="#3498db" opacity="0.06" stroke="white" stroke-width="1"/>
<text x="140" y="225" fill="#999" font-size="11" text-anchor="middle">.04</text>
<rect x="170" y="195" width="60" height="50" rx="3" fill="#3498db" opacity="0.75" stroke="white" stroke-width="1"/>
<text x="200" y="225" fill="white" font-size="11" text-anchor="middle">.80</text>
<rect x="230" y="195" width="60" height="50" rx="3" fill="#3498db" opacity="0.08" stroke="white" stroke-width="1"/>
<text x="260" y="225" fill="#999" font-size="11" text-anchor="middle">.07</text>
<rect x="290" y="195" width="60" height="50" rx="3" fill="#3498db" opacity="0.05" stroke="white" stroke-width="1"/>
<text x="320" y="225" fill="#999" font-size="11" text-anchor="middle">.05</text>
<rect x="350" y="195" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="380" y="225" fill="#999" font-size="11" text-anchor="middle">.04</text>
<!-- Row 4: "sleeps" -->
<rect x="110" y="255" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="140" y="285" fill="#999" font-size="11" text-anchor="middle">.02</text>
<rect x="170" y="255" width="60" height="50" rx="3" fill="#3498db" opacity="0.06" stroke="white" stroke-width="1"/>
<text x="200" y="285" fill="#999" font-size="11" text-anchor="middle">.05</text>
<rect x="230" y="255" width="60" height="50" rx="3" fill="#3498db" opacity="0.05" stroke="white" stroke-width="1"/>
<text x="260" y="285" fill="#999" font-size="11" text-anchor="middle">.04</text>
<rect x="290" y="255" width="60" height="50" rx="3" fill="#3498db" opacity="0.75" stroke="white" stroke-width="1"/>
<text x="320" y="285" fill="white" font-size="11" text-anchor="middle">.83</text>
<rect x="350" y="255" width="60" height="50" rx="3" fill="#3498db" opacity="0.06" stroke="white" stroke-width="1"/>
<text x="380" y="285" fill="#999" font-size="11" text-anchor="middle">.06</text>
<!-- Row 5: "well" -->
<rect x="110" y="315" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="140" y="345" fill="#999" font-size="11" text-anchor="middle">.03</text>
<rect x="170" y="315" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="200" y="345" fill="#999" font-size="11" text-anchor="middle">.02</text>
<rect x="230" y="315" width="60" height="50" rx="3" fill="#3498db" opacity="0.04" stroke="white" stroke-width="1"/>
<text x="260" y="345" fill="#999" font-size="11" text-anchor="middle">.03</text>
<rect x="290" y="315" width="60" height="50" rx="3" fill="#3498db" opacity="0.08" stroke="white" stroke-width="1"/>
<text x="320" y="345" fill="#999" font-size="11" text-anchor="middle">.06</text>
<rect x="350" y="315" width="60" height="50" rx="3" fill="#3498db" opacity="0.75" stroke="white" stroke-width="1"/>
<text x="380" y="345" fill="white" font-size="11" text-anchor="middle">.86</text>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

+116
View File
@@ -0,0 +1,116 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 300" width="700" height="300" font-family="Arial, sans-serif">
<defs>
<marker id="ac-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#666"/>
</marker>
<marker id="ac-arrow-strong" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#e74c3c"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="24" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Attention-Based Image Captioning</text>
<!-- Image patch grid (3x3) -->
<text x="100" y="52" font-size="11" fill="#666" text-anchor="middle">Image Patches</text>
<!-- Row 1 -->
<rect x="35" y="60" width="42" height="42" rx="3" fill="#3498db" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="56" y="85" font-size="8" fill="#999" text-anchor="middle">sky</text>
<rect x="79" y="60" width="42" height="42" rx="3" fill="#3498db" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="100" y="85" font-size="8" fill="#999" text-anchor="middle">tree</text>
<rect x="123" y="60" width="42" height="42" rx="3" fill="#3498db" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="144" y="85" font-size="8" fill="#999" text-anchor="middle">sky</text>
<!-- Row 2 -->
<rect x="35" y="104" width="42" height="42" rx="3" fill="#3498db" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="56" y="129" font-size="8" fill="#999" text-anchor="middle">grass</text>
<rect x="79" y="104" width="42" height="42" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="2"/>
<text x="100" y="126" font-size="8" fill="#e74c3c" text-anchor="middle" font-weight="bold">dog</text>
<rect x="123" y="104" width="42" height="42" rx="3" fill="#3498db" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="144" y="129" font-size="8" fill="#999" text-anchor="middle">fence</text>
<!-- Row 3 -->
<rect x="35" y="148" width="42" height="42" rx="3" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1"/>
<text x="56" y="173" font-size="8" fill="#999" text-anchor="middle">ball</text>
<rect x="79" y="148" width="42" height="42" rx="3" fill="#3498db" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="100" y="173" font-size="8" fill="#999" text-anchor="middle">grass</text>
<rect x="123" y="148" width="42" height="42" rx="3" fill="#3498db" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="144" y="173" font-size="8" fill="#999" text-anchor="middle">grass</text>
<!-- Attention arrows from patches to decoder word "dog" -->
<!-- Strong attention from dog patch -->
<line x1="121" y1="125" x2="315" y2="131" stroke="#e74c3c" stroke-width="2.5" stroke-opacity="0.8" marker-end="url(#ac-arrow-strong)"/>
<!-- Weak attention from other patches -->
<line x1="121" y1="81" x2="315" y2="128" stroke="#ccc" stroke-width="0.8" stroke-opacity="0.5"/>
<line x1="165" y1="125" x2="315" y2="131" stroke="#ccc" stroke-width="1" stroke-opacity="0.4"/>
<line x1="77" y1="169" x2="315" y2="134" stroke="#f39c12" stroke-width="1.2" stroke-opacity="0.5"/>
<line x1="56" y1="146" x2="315" y2="132" stroke="#ccc" stroke-width="0.7" stroke-opacity="0.3"/>
<!-- Attention weights label -->
<text x="220" y="110" font-size="9" fill="#e74c3c" text-anchor="middle" font-style="italic">strong attention</text>
<text x="220" y="175" font-size="9" fill="#ccc" text-anchor="middle" font-style="italic">weak attention</text>
<!-- Decoder generating words -->
<text x="460" y="52" font-size="11" fill="#666" text-anchor="middle">Decoder Output</text>
<!-- Word boxes -->
<rect x="320" y="65" width="50" height="28" rx="5" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.2"/>
<text x="345" y="84" font-size="11" fill="#9b59b6" text-anchor="middle" font-weight="bold">"A"</text>
<rect x="320" y="118" width="50" height="28" rx="5" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<text x="345" y="137" font-size="11" fill="#e74c3c" text-anchor="middle" font-weight="bold">"dog"</text>
<rect x="320" y="170" width="60" height="28" rx="5" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.2"/>
<text x="350" y="189" font-size="11" fill="#9b59b6" text-anchor="middle" font-weight="bold">"plays"</text>
<!-- Arrows between words (autoregressive) -->
<line x1="345" y1="93" x2="345" y2="116" stroke="#666" stroke-width="1" marker-end="url(#ac-arrow)"/>
<line x1="345" y1="146" x2="350" y2="168" stroke="#666" stroke-width="1" marker-end="url(#ac-arrow)"/>
<!-- Attention heatmap visualization -->
<text x="560" y="52" font-size="11" fill="#666" text-anchor="middle">Attention Map</text>
<text x="560" y="65" font-size="9" fill="#999" text-anchor="middle">(for "dog")</text>
<!-- Heatmap grid 3x3 -->
<rect x="510" y="75" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.05" stroke="#ddd" stroke-width="0.5"/>
<text x="526" y="95" font-size="7" fill="#999" text-anchor="middle">0.02</text>
<rect x="544" y="75" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.1" stroke="#ddd" stroke-width="0.5"/>
<text x="560" y="95" font-size="7" fill="#999" text-anchor="middle">0.05</text>
<rect x="578" y="75" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.05" stroke="#ddd" stroke-width="0.5"/>
<text x="594" y="95" font-size="7" fill="#999" text-anchor="middle">0.02</text>
<rect x="510" y="109" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.1" stroke="#ddd" stroke-width="0.5"/>
<text x="526" y="129" font-size="7" fill="#999" text-anchor="middle">0.06</text>
<rect x="544" y="109" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.7" stroke="#e74c3c" stroke-width="1.5"/>
<text x="560" y="129" font-size="8" fill="white" text-anchor="middle" font-weight="bold">0.65</text>
<rect x="578" y="109" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.08" stroke="#ddd" stroke-width="0.5"/>
<text x="594" y="129" font-size="7" fill="#999" text-anchor="middle">0.04</text>
<rect x="510" y="143" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.15" stroke="#ddd" stroke-width="0.5"/>
<text x="526" y="163" font-size="7" fill="#999" text-anchor="middle">0.08</text>
<rect x="544" y="143" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.08" stroke="#ddd" stroke-width="0.5"/>
<text x="560" y="163" font-size="7" fill="#999" text-anchor="middle">0.04</text>
<rect x="578" y="143" width="32" height="32" rx="2" fill="#e74c3c" fill-opacity="0.08" stroke="#ddd" stroke-width="0.5"/>
<text x="594" y="163" font-size="7" fill="#999" text-anchor="middle">0.04</text>
<!-- Caption sentence at bottom -->
<text x="350" y="230" font-size="11" fill="#333" text-anchor="middle">Generated Caption: </text>
<text x="350" y="248" font-size="12" fill="#9b59b6" text-anchor="middle" font-weight="bold">"A dog plays with a ball on the grass"</text>
<!-- Note -->
<text x="350" y="280" font-size="9" fill="#999" text-anchor="middle">At each decoding step, the model attends to different spatial regions of the image</text>
</svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

+48
View File
@@ -0,0 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 230" width="700" height="230">
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Attention Patterns: Full vs Sliding Window vs Sparse</text>
<!-- Full attention -->
<text x="120" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">Full Attention</text>
<text x="120" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">O(n²)</text>
<rect x="40" y="70" width="160" height="120" rx="4" fill="#eee" stroke="#ccc" stroke-width="1"/>
<!-- Lower triangle filled (causal mask) -->
<polygon points="40,70 200,190 40,190" fill="#e74c3c" fill-opacity="0.25"/>
<text x="100" y="160" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">every token attends</text>
<text x="100" y="172" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">to all previous</text>
<text x="40" y="205" font-family="Arial, sans-serif" font-size="8" fill="#666">queries →</text>
<text x="35" y="80" font-family="Arial, sans-serif" font-size="8" fill="#666" transform="rotate(-90, 35, 80)">keys →</text>
<!-- Sliding window -->
<text x="350" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">Sliding Window</text>
<text x="350" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">O(n·w)</text>
<rect x="270" y="70" width="160" height="120" rx="4" fill="#eee" stroke="#ccc" stroke-width="1"/>
<!-- Diagonal band -->
<polygon points="270,70 320,70 430,153 430,190 380,190 270,107" fill="#3498db" fill-opacity="0.25"/>
<!-- Clip to box -->
<rect x="270" y="70" width="160" height="120" rx="4" fill="none" stroke="#ccc" stroke-width="1"/>
<text x="350" y="160" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">each token attends</text>
<text x="350" y="172" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">to w previous only</text>
<!-- Local + Global -->
<text x="580" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">Local + Global</text>
<text x="580" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">O(n·w + n·g)</text>
<rect x="500" y="70" width="160" height="120" rx="4" fill="#eee" stroke="#ccc" stroke-width="1"/>
<!-- Diagonal band (local) -->
<polygon points="500,70 540,70 660,148 660,190 620,190 500,107" fill="#27ae60" fill-opacity="0.2"/>
<!-- Global columns (every 4th token attends to all) -->
<rect x="530" y="70" width="6" height="120" fill="#f39c12" fill-opacity="0.3"/>
<rect x="570" y="70" width="6" height="120" fill="#f39c12" fill-opacity="0.3"/>
<rect x="610" y="70" width="6" height="120" fill="#f39c12" fill-opacity="0.3"/>
<rect x="650" y="70" width="6" height="120" fill="#f39c12" fill-opacity="0.3"/>
<!-- Global rows -->
<rect x="500" y="90" width="160" height="5" fill="#f39c12" fill-opacity="0.3"/>
<rect x="500" y="120" width="160" height="5" fill="#f39c12" fill-opacity="0.3"/>
<rect x="500" y="150" width="160" height="5" fill="#f39c12" fill-opacity="0.3"/>
<rect x="500" y="70" width="160" height="120" rx="4" fill="none" stroke="#ccc" stroke-width="1"/>
<text x="580" y="205" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#27ae60">local window + global tokens</text>
<text x="580" y="217" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">(yellow = global attention)</text>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

+96
View File
@@ -0,0 +1,96 @@
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="290" font-family="Arial, Helvetica, sans-serif">
<defs>
<marker id="arrow-ast" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#333"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-size="14" font-weight="bold" fill="#333">Audio Spectrogram Transformer (AST)</text>
<!-- Mel Spectrogram -->
<rect x="20" y="42" width="80" height="100" rx="4" fill="rgba(243,156,18,0.08)" stroke="#f39c12" stroke-width="1.2"/>
<text x="60" y="155" text-anchor="middle" font-size="8" fill="#333">Mel Spectrogram</text>
<!-- Grid lines for spectrogram feel -->
<line x1="20" y1="62" x2="100" y2="62" stroke="#f39c12" stroke-width="0.4" opacity="0.4"/>
<line x1="20" y1="82" x2="100" y2="82" stroke="#f39c12" stroke-width="0.4" opacity="0.4"/>
<line x1="20" y1="102" x2="100" y2="102" stroke="#f39c12" stroke-width="0.4" opacity="0.4"/>
<line x1="20" y1="122" x2="100" y2="122" stroke="#f39c12" stroke-width="0.4" opacity="0.4"/>
<line x1="40" y1="42" x2="40" y2="142" stroke="#f39c12" stroke-width="0.4" opacity="0.4"/>
<line x1="60" y1="42" x2="60" y2="142" stroke="#f39c12" stroke-width="0.4" opacity="0.4"/>
<line x1="80" y1="42" x2="80" y2="142" stroke="#f39c12" stroke-width="0.4" opacity="0.4"/>
<!-- Patch shading to show splitting -->
<rect x="20" y="42" width="20" height="20" fill="rgba(243,156,18,0.15)"/>
<rect x="60" y="62" width="20" height="20" fill="rgba(243,156,18,0.15)"/>
<rect x="40" y="102" width="20" height="20" fill="rgba(243,156,18,0.15)"/>
<rect x="80" y="82" width="20" height="20" fill="rgba(243,156,18,0.15)"/>
<rect x="20" y="122" width="20" height="20" fill="rgba(243,156,18,0.15)"/>
<text x="60" y="167" text-anchor="middle" font-size="7" fill="#666">(patch grid)</text>
<line x1="100" y1="92" x2="125" y2="92" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ast)"/>
<!-- Flatten patches -->
<rect x="128" y="52" width="50" height="80" rx="4" fill="rgba(52,152,219,0.08)" stroke="#3498db" stroke-width="1.2"/>
<text x="153" y="86" text-anchor="middle" font-size="8" fill="#333">Flatten</text>
<text x="153" y="96" text-anchor="middle" font-size="8" fill="#333">Patches</text>
<!-- Small patch sequence -->
<rect x="137" y="60" width="32" height="8" rx="1" fill="rgba(243,156,18,0.2)" stroke="#f39c12" stroke-width="0.5"/>
<rect x="137" y="70" width="32" height="8" rx="1" fill="rgba(243,156,18,0.15)" stroke="#f39c12" stroke-width="0.5"/>
<rect x="137" y="105" width="32" height="8" rx="1" fill="rgba(243,156,18,0.2)" stroke="#f39c12" stroke-width="0.5"/>
<rect x="137" y="115" width="32" height="8" rx="1" fill="rgba(243,156,18,0.15)" stroke="#f39c12" stroke-width="0.5"/>
<line x1="178" y1="92" x2="203" y2="92" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ast)"/>
<!-- Linear Projection + Pos Emb -->
<rect x="206" y="55" width="75" height="74" rx="6" fill="rgba(52,152,219,0.12)" stroke="#3498db" stroke-width="1.5"/>
<text x="243" y="78" text-anchor="middle" font-size="8" fill="#333">Linear</text>
<text x="243" y="89" text-anchor="middle" font-size="8" fill="#333">Projection</text>
<text x="243" y="103" text-anchor="middle" font-size="7" fill="#3498db">+ pos emb</text>
<!-- [CLS] token indicator -->
<rect x="215" y="112" width="30" height="14" rx="3" fill="rgba(39,174,96,0.15)" stroke="#27ae60" stroke-width="1"/>
<text x="230" y="122" text-anchor="middle" font-size="7" font-weight="bold" fill="#27ae60">[CLS]</text>
<line x1="230" y1="112" x2="230" y2="105" stroke="#27ae60" stroke-width="0.8" stroke-dasharray="2,2"/>
<text x="255" y="122" font-size="7" fill="#666">prepended</text>
<line x1="281" y1="92" x2="310" y2="92" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ast)"/>
<!-- Transformer Encoder -->
<rect x="313" y="42" width="130" height="100" rx="6" fill="rgba(155,89,182,0.1)" stroke="#9b59b6" stroke-width="1.8"/>
<text x="378" y="65" text-anchor="middle" font-size="10" font-weight="bold" fill="#333">Transformer</text>
<text x="378" y="78" text-anchor="middle" font-size="10" font-weight="bold" fill="#333">Encoder</text>
<!-- Internal blocks -->
<rect x="330" y="88" width="96" height="16" rx="3" fill="rgba(155,89,182,0.1)" stroke="#9b59b6" stroke-width="0.8"/>
<text x="378" y="100" text-anchor="middle" font-size="7" fill="#666">Multi-Head Attn + FFN</text>
<rect x="330" y="108" width="96" height="16" rx="3" fill="rgba(155,89,182,0.1)" stroke="#9b59b6" stroke-width="0.8"/>
<text x="378" y="120" text-anchor="middle" font-size="7" fill="#666">x L layers</text>
<line x1="443" y1="92" x2="472" y2="92" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ast)"/>
<!-- Classification Head -->
<rect x="475" y="62" width="80" height="60" rx="6" fill="rgba(39,174,96,0.12)" stroke="#27ae60" stroke-width="1.5"/>
<text x="515" y="82" text-anchor="middle" font-size="9" fill="#333">Classification</text>
<text x="515" y="95" text-anchor="middle" font-size="9" fill="#333">Head</text>
<text x="515" y="110" text-anchor="middle" font-size="7" fill="#666">(from [CLS])</text>
<line x1="555" y1="92" x2="580" y2="92" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ast)"/>
<!-- Label output -->
<rect x="583" y="72" width="75" height="40" rx="6" fill="rgba(231,76,60,0.1)" stroke="#e74c3c" stroke-width="1.5"/>
<text x="620" y="90" text-anchor="middle" font-size="9" fill="#333">Predicted</text>
<text x="620" y="103" text-anchor="middle" font-size="9" fill="#333">Label</text>
<!-- Pipeline labels -->
<text x="60" y="185" text-anchor="middle" font-size="7" fill="#f39c12">2D input</text>
<text x="153" y="185" text-anchor="middle" font-size="7" fill="#3498db">sequence</text>
<text x="243" y="185" text-anchor="middle" font-size="7" fill="#3498db">embed</text>
<text x="378" y="185" text-anchor="middle" font-size="7" fill="#9b59b6">encode</text>
<text x="515" y="185" text-anchor="middle" font-size="7" fill="#27ae60">classify</text>
<!-- Note box -->
<rect x="30" y="200" width="640" height="55" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="50" y="220" font-size="10" font-weight="bold" fill="#333">AST adapts ViT (chapter 08) directly to audio spectrograms</text>
<text x="50" y="236" font-size="9" fill="#666">No convolutions needed. The spectrogram is split into 16x16 patches, linearly projected, and processed</text>
<text x="50" y="248" font-size="9" fill="#666">by a standard Transformer encoder. Pre-training on ImageNet transfers surprisingly well to audio.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

+95
View File
@@ -0,0 +1,95 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 280" width="700" height="280">
<defs>
<marker id="av-blue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#3498db"/>
</marker>
<marker id="av-green" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#27ae60"/>
</marker>
<marker id="av-purple" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#9b59b6"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Audio-Visual Correspondence Learning</text>
<!-- ====== TOP PATH: Video frames → Visual Encoder → embedding ====== -->
<!-- Video frames (3 small rectangles) -->
<rect x="32" y="62" width="36" height="28" rx="3" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1"/>
<rect x="52" y="56" width="36" height="28" rx="3" fill="#3498db" fill-opacity="0.20" stroke="#3498db" stroke-width="1"/>
<rect x="72" y="50" width="36" height="28" rx="3" fill="#3498db" fill-opacity="0.30" stroke="#3498db" stroke-width="1.2"/>
<text x="90" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">F₃</text>
<text x="70" y="74" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">F₂</text>
<text x="50" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">F₁</text>
<text x="62" y="105" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Video frames</text>
<!-- Arrow frames to encoder -->
<line x1="112" y1="68" x2="148" y2="68" stroke="#3498db" stroke-width="1.5" marker-end="url(#av-blue)"/>
<!-- Visual Encoder -->
<rect x="155" y="44" width="120" height="50" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="215" y="67" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">Visual Encoder</text>
<text x="215" y="82" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">(CNN / ViT)</text>
<!-- Arrow encoder to embedding -->
<line x1="275" y1="68" x2="328" y2="68" stroke="#3498db" stroke-width="1.5" marker-end="url(#av-blue)"/>
<!-- Visual embedding vector -->
<rect x="335" y="54" width="90" height="28" rx="6" fill="#3498db" fill-opacity="0.18" stroke="#3498db" stroke-width="1.2"/>
<text x="380" y="72" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">v_embed</text>
<!-- ====== BOTTOM PATH: Spectrogram → Audio Encoder → embedding ====== -->
<!-- Spectrogram (hatched rectangle) -->
<rect x="40" y="190" width="60" height="40" rx="3" fill="#27ae60" fill-opacity="0.10" stroke="#27ae60" stroke-width="1.2"/>
<!-- Hatching lines for spectrogram look -->
<line x1="45" y1="195" x2="55" y2="195" stroke="#27ae60" stroke-width="1" opacity="0.5"/>
<line x1="50" y1="200" x2="80" y2="200" stroke="#27ae60" stroke-width="1.5" opacity="0.6"/>
<line x1="45" y1="205" x2="90" y2="205" stroke="#27ae60" stroke-width="2" opacity="0.4"/>
<line x1="48" y1="210" x2="75" y2="210" stroke="#27ae60" stroke-width="1" opacity="0.5"/>
<line x1="52" y1="215" x2="85" y2="215" stroke="#27ae60" stroke-width="1.5" opacity="0.3"/>
<line x1="46" y1="220" x2="70" y2="220" stroke="#27ae60" stroke-width="1" opacity="0.6"/>
<text x="70" y="245" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Spectrogram</text>
<!-- Arrow spectrogram to encoder -->
<line x1="104" y1="210" x2="148" y2="210" stroke="#27ae60" stroke-width="1.5" marker-end="url(#av-green)"/>
<!-- Audio Encoder -->
<rect x="155" y="186" width="120" height="50" rx="8" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="215" y="209" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">Audio Encoder</text>
<text x="215" y="224" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">(Wav2Vec)</text>
<!-- Arrow encoder to embedding -->
<line x1="275" y1="210" x2="328" y2="210" stroke="#27ae60" stroke-width="1.5" marker-end="url(#av-green)"/>
<!-- Audio embedding vector -->
<rect x="335" y="196" width="90" height="28" rx="6" fill="#27ae60" fill-opacity="0.18" stroke="#27ae60" stroke-width="1.2"/>
<text x="380" y="214" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">a_embed</text>
<!-- ====== Contrastive Loss circle ====== -->
<!-- Arrows from embeddings to loss -->
<line x1="425" y1="68" x2="480" y2="120" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#av-purple)"/>
<line x1="425" y1="210" x2="480" y2="158" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#av-purple)"/>
<circle cx="510" cy="140" r="35" fill="#9b59b6" fill-opacity="0.10" stroke="#9b59b6" stroke-width="1.5"/>
<text x="510" y="136" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">Contrastive</text>
<text x="510" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">Loss</text>
<!-- Matched pair annotation -->
<rect x="580" y="70" width="108" height="40" rx="8" fill="#27ae60" fill-opacity="0.08" stroke="#27ae60" stroke-width="1" stroke-dasharray="4,2"/>
<text x="634" y="86" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#27ae60">matched pair</text>
<text x="634" y="101" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">&#x2713;</text>
<text x="597" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">temporally aligned</text>
<!-- Unmatched pair annotation -->
<rect x="580" y="170" width="108" height="40" rx="8" fill="#e74c3c" fill-opacity="0.08" stroke="#e74c3c" stroke-width="1" stroke-dasharray="4,2"/>
<text x="634" y="186" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#e74c3c">unmatched pair</text>
<text x="634" y="201" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">&#x2717;</text>
<text x="597" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">misaligned</text>
<!-- Connecting lines from loss to annotations -->
<line x1="545" y1="130" x2="575" y2="95" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="545" y1="150" x2="575" y2="185" stroke="#e74c3c" stroke-width="1" stroke-dasharray="3,2"/>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

+68
View File
@@ -0,0 +1,68 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="aw-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#666"/>
</marker>
<marker id="aw-arrow-blue" markerWidth="6" markerHeight="4" refX="0" refY="2" orient="auto">
<polygon points="0,0 6,2 0,4" fill="#3498db"/>
</marker>
<marker id="aw-arrow-blue-rev" markerWidth="6" markerHeight="4" refX="6" refY="2" orient="auto">
<polygon points="6,0 0,2 6,4" fill="#3498db"/>
</marker>
<marker id="aw-arrow-red" markerWidth="6" markerHeight="4" refX="0" refY="2" orient="auto">
<polygon points="0,0 6,2 0,4" fill="#e74c3c"/>
</marker>
<marker id="aw-arrow-red-rev" markerWidth="6" markerHeight="4" refX="6" refY="2" orient="auto">
<polygon points="6,0 0,2 6,4" fill="#e74c3c"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Audio Waveform: Anatomy of a Sine Wave</text>
<!-- Axes -->
<line x1="60" y1="150" x2="480" y2="150" stroke="#666" stroke-width="1" marker-end="url(#aw-arrow)"/>
<line x1="60" y1="250" x2="60" y2="45" stroke="#666" stroke-width="1" marker-end="url(#aw-arrow)"/>
<text x="485" y="155" fill="#666" font-size="10">Time (t)</text>
<text x="40" y="50" fill="#666" font-size="10">Amplitude</text>
<!-- Primary sine wave (blue) -->
<path d="M 60,150 C 75,150 80,80 100,80 C 120,80 125,150 140,150 C 155,150 160,220 180,220 C 200,220 205,150 220,150 C 235,150 240,80 260,80 C 280,80 285,150 300,150 C 315,150 320,220 340,220 C 360,220 365,150 380,150 C 395,150 400,80 420,80 C 440,80 445,150 460,150" fill="none" stroke="#3498db" stroke-width="2.2"/>
<!-- Second sine wave (red, phase shifted) -->
<path d="M 60,150 C 68,150 72,105 85,95 C 100,82 108,120 120,150 C 132,180 140,218 155,225 C 170,230 178,195 190,165 C 200,140 210,105 225,95 C 240,82 248,120 260,150 C 272,180 280,218 295,225 C 310,230 318,195 330,165 C 340,140 350,105 365,95 C 380,82 388,120 400,150 C 412,180 420,218 435,225 C 450,230 455,200 460,180" fill="none" stroke="#e74c3c" stroke-width="1.8" stroke-dasharray="6,3" opacity="0.8"/>
<!-- Amplitude label (blue, left side) -->
<line x1="100" y1="80" x2="100" y2="150" stroke="#3498db" stroke-width="1.2" stroke-dasharray="3,2"/>
<line x1="93" y1="80" x2="107" y2="80" stroke="#3498db" stroke-width="1"/>
<line x1="93" y1="150" x2="107" y2="150" stroke="#3498db" stroke-width="1"/>
<line x1="48" y1="80" x2="48" y2="150" stroke="#3498db" stroke-width="1.2" marker-start="url(#aw-arrow-blue-rev)" marker-end="url(#aw-arrow-blue)"/>
<text x="35" y="120" fill="#3498db" font-size="10" font-weight="bold" text-anchor="middle" transform="rotate(-90, 35, 120)">A</text>
<!-- Period T label -->
<line x1="60" y1="235" x2="220" y2="235" stroke="#27ae60" stroke-width="1.5" marker-start="url(#aw-arrow-blue-rev)" marker-end="url(#aw-arrow-blue)"/>
<line x1="60" y1="230" x2="60" y2="240" stroke="#27ae60" stroke-width="1"/>
<line x1="220" y1="230" x2="220" y2="240" stroke="#27ae60" stroke-width="1"/>
<text x="140" y="248" fill="#27ae60" font-size="10" font-weight="bold" text-anchor="middle">T = 1/f</text>
<!-- Phase shift label -->
<line x1="100" y1="72" x2="85" y2="72" stroke="#f39c12" stroke-width="1.2" marker-start="url(#aw-arrow-blue-rev)" marker-end="url(#aw-arrow-blue)"/>
<text x="93" y="65" fill="#f39c12" font-size="9" font-weight="bold" text-anchor="middle">phi</text>
<!-- Legend -->
<line x1="500" y1="70" x2="530" y2="70" stroke="#3498db" stroke-width="2.2"/>
<text x="535" y="74" fill="#3498db" font-size="10">sin(2pi f t)</text>
<line x1="500" y1="90" x2="530" y2="90" stroke="#e74c3c" stroke-width="1.8" stroke-dasharray="6,3"/>
<text x="535" y="94" fill="#e74c3c" font-size="10">sin(2pi f t + phi)</text>
<!-- Labels -->
<rect x="495" y="110" width="185" height="85" rx="6" fill="#f5f5f5" stroke="#ddd" stroke-width="1"/>
<text x="587" y="128" fill="#333" font-size="11" font-weight="bold" text-anchor="middle">Key Parameters</text>
<text x="505" y="145" fill="#3498db" font-size="9">A = amplitude (peak height)</text>
<text x="505" y="160" fill="#27ae60" font-size="9">T = period (seconds/cycle)</text>
<text x="505" y="175" fill="#f39c12" font-size="9">phi = phase offset (radians)</text>
<text x="505" y="190" fill="#666" font-size="9">f = 1/T = frequency (Hz)</text>
<!-- Bottom note -->
<rect x="100" y="272" width="500" height="20" rx="4" fill="#f5f5f5" stroke="#333" stroke-width="0.8"/>
<text x="350" y="286" fill="#333" font-size="10" text-anchor="middle">Frequency f = cycles per second (Hz). A 440 Hz wave = concert A</text>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

+54
View File
@@ -0,0 +1,54 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 200" width="800" height="200">
<defs>
<marker id="ads-arr" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
<path d="M0,0 L10,3.5 L0,7" fill="none" stroke="#666" stroke-width="1.2"/>
</marker>
</defs>
<text x="400" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">The Autonomous Driving Stack</text>
<!-- Sensors -->
<rect x="20" y="65" width="100" height="70" rx="10" fill="#555" fill-opacity="0.1" stroke="#555" stroke-width="1.5"/>
<text x="70" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#555">Sensors</text>
<text x="70" y="107" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#555">cameras, LiDAR</text>
<text x="70" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#555">radar, IMU</text>
<line x1="120" y1="100" x2="148" y2="100" stroke="#666" stroke-width="2" marker-end="url(#ads-arr)"/>
<!-- Perception -->
<rect x="156" y="55" width="120" height="90" rx="10" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="2"/>
<text x="216" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">Perception</text>
<text x="216" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">3D detection</text>
<text x="216" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">lane detection</text>
<text x="216" y="128" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">occupancy</text>
<line x1="276" y1="100" x2="304" y2="100" stroke="#666" stroke-width="2" marker-end="url(#ads-arr)"/>
<!-- Prediction -->
<rect x="312" y="55" width="120" height="90" rx="10" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="2"/>
<text x="372" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#f39c12">Prediction</text>
<text x="372" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">trajectory forecast</text>
<text x="372" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">intent estimation</text>
<text x="372" y="128" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">3-8s horizon</text>
<line x1="432" y1="100" x2="460" y2="100" stroke="#666" stroke-width="2" marker-end="url(#ads-arr)"/>
<!-- Planning -->
<rect x="468" y="55" width="120" height="90" rx="10" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="2"/>
<text x="528" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#27ae60">Planning</text>
<text x="528" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">route planning</text>
<text x="528" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">trajectory opt.</text>
<text x="528" y="128" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">decision making</text>
<line x1="588" y1="100" x2="616" y2="100" stroke="#666" stroke-width="2" marker-end="url(#ads-arr)"/>
<!-- Control -->
<rect x="624" y="55" width="120" height="90" rx="10" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="2"/>
<text x="684" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#9b59b6">Control</text>
<text x="684" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#9b59b6">steering</text>
<text x="684" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#9b59b6">throttle</text>
<text x="684" y="128" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#9b59b6">brake</text>
<!-- Information flow label -->
<text x="400" y="178" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Each stage refines raw data into increasingly abstract decisions</text>
<text x="400" y="195" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#999">errors propagate forward → perception quality is the bottleneck</text>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

+107
View File
@@ -0,0 +1,107 @@
<svg width="720" height="320" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="bow-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">Bag-of-Words: Document → Word Count Vector</text>
<!-- Document text -->
<rect x="30" y="45" width="250" height="70" rx="8" fill="#f5f5f5" stroke="#333" stroke-width="1.5"/>
<text x="45" y="65" fill="#333" font-size="12" font-weight="bold">Document:</text>
<text x="45" y="85" fill="#555" font-size="12">"the cat sat on the mat"</text>
<text x="45" y="103" fill="#999" font-size="10">(word order is discarded)</text>
<!-- Arrow -->
<line x1="280" y1="80" x2="330" y2="80" stroke="#555" stroke-width="1.5" marker-end="url(#bow-arrow)"/>
<text x="305" y="72" fill="#666" font-size="9" text-anchor="middle">count</text>
<!-- Word count table -->
<text x="470" y="45" fill="#333" font-size="11" text-anchor="middle" font-weight="bold">Word Counts</text>
<!-- Header -->
<rect x="340" y="55" width="75" height="22" rx="3" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1"/>
<text x="377" y="70" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">Word</text>
<rect x="420" y="55" width="55" height="22" rx="3" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<text x="447" y="70" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">Count</text>
<!-- Rows -->
<text x="377" y="92" fill="#333" font-size="11" text-anchor="middle">the</text>
<text x="447" y="92" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">2</text>
<line x1="340" y1="97" x2="475" y2="97" stroke="#eee" stroke-width="1"/>
<text x="377" y="112" fill="#333" font-size="11" text-anchor="middle">cat</text>
<text x="447" y="112" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">1</text>
<line x1="340" y1="117" x2="475" y2="117" stroke="#eee" stroke-width="1"/>
<text x="377" y="132" fill="#333" font-size="11" text-anchor="middle">sat</text>
<text x="447" y="132" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">1</text>
<line x1="340" y1="137" x2="475" y2="137" stroke="#eee" stroke-width="1"/>
<text x="377" y="152" fill="#333" font-size="11" text-anchor="middle">on</text>
<text x="447" y="152" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">1</text>
<line x1="340" y1="157" x2="475" y2="157" stroke="#eee" stroke-width="1"/>
<text x="377" y="172" fill="#333" font-size="11" text-anchor="middle">mat</text>
<text x="447" y="172" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">1</text>
<!-- Arrow to vector -->
<line x1="475" y1="120" x2="520" y2="120" stroke="#555" stroke-width="1.5" marker-end="url(#bow-arrow)"/>
<!-- Vector representation -->
<text x="615" y="45" fill="#333" font-size="11" text-anchor="middle" font-weight="bold">BoW Vector ∈ ℝⱽ</text>
<!-- Vector (vertical) with vocabulary labels -->
<text x="540" y="75" fill="#999" font-size="8" text-anchor="end">a</text>
<rect x="545" y="65" width="35" height="16" rx="2" fill="#27ae60" opacity="0.05" stroke="#ccc" stroke-width="0.5"/>
<text x="562" y="77" fill="#ccc" font-size="10" text-anchor="middle">0</text>
<text x="540" y="93" fill="#333" font-size="8" text-anchor="end" font-weight="bold">cat</text>
<rect x="545" y="83" width="35" height="16" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="562" y="95" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="540" y="111" fill="#999" font-size="8" text-anchor="end">dog</text>
<rect x="545" y="101" width="35" height="16" rx="2" fill="#27ae60" opacity="0.05" stroke="#ccc" stroke-width="0.5"/>
<text x="562" y="113" fill="#ccc" font-size="10" text-anchor="middle">0</text>
<text x="540" y="129" fill="#333" font-size="8" text-anchor="end" font-weight="bold">mat</text>
<rect x="545" y="119" width="35" height="16" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="562" y="131" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="540" y="147" fill="#333" font-size="8" text-anchor="end" font-weight="bold">on</text>
<rect x="545" y="137" width="35" height="16" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="562" y="149" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="540" y="165" fill="#333" font-size="8" text-anchor="end" font-weight="bold">sat</text>
<rect x="545" y="155" width="35" height="16" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="562" y="167" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="540" y="183" fill="#333" font-size="8" text-anchor="end" font-weight="bold">the</text>
<rect x="545" y="173" width="35" height="16" rx="2" fill="#27ae60" opacity="0.35" stroke="#27ae60" stroke-width="1.5"/>
<text x="562" y="185" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">2</text>
<text x="562" y="203" fill="#999" font-size="10" text-anchor="middle">⋮</text>
<!-- Bracket -->
<text x="595" y="140" fill="#333" font-size="50" text-anchor="start" font-weight="100">]</text>
<text x="535" y="140" fill="#333" font-size="50" text-anchor="end" font-weight="100">[</text>
<!-- Bottom explanation boxes -->
<rect x="30" y="230" width="200" height="80" rx="8" fill="#3498db" opacity="0.08" stroke="#3498db" stroke-width="1"/>
<text x="130" y="250" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">Advantage</text>
<text x="130" y="266" fill="#555" font-size="10" text-anchor="middle">Simple, fast, effective</text>
<text x="130" y="280" fill="#555" font-size="10" text-anchor="middle">for document classification</text>
<text x="130" y="294" fill="#555" font-size="10" text-anchor="middle">and spam filtering</text>
<rect x="260" y="230" width="200" height="80" rx="8" fill="#e74c3c" opacity="0.08" stroke="#e74c3c" stroke-width="1"/>
<text x="360" y="250" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">Limitation</text>
<text x="360" y="266" fill="#555" font-size="10" text-anchor="middle">Ignores word order:</text>
<text x="360" y="280" fill="#555" font-size="10" text-anchor="middle">"dog bites man" and</text>
<text x="360" y="294" fill="#555" font-size="10" text-anchor="middle">"man bites dog" are identical</text>
<rect x="490" y="230" width="200" height="80" rx="8" fill="#27ae60" opacity="0.08" stroke="#27ae60" stroke-width="1"/>
<text x="590" y="250" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">Dimensionality</text>
<text x="590" y="266" fill="#555" font-size="10" text-anchor="middle">Vector has V dimensions</text>
<text x="590" y="280" fill="#555" font-size="10" text-anchor="middle">(one per vocab word).</text>
<text x="590" y="294" fill="#555" font-size="10" text-anchor="middle">Very sparse: mostly zeros.</text>
</svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

+44
View File
@@ -0,0 +1,44 @@
<svg width="380" height="170" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="bt-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#999"/>
</marker>
<marker id="bt-r" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#e74c3c"/>
</marker>
<marker id="bt-b" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#3498db"/>
</marker>
</defs>
<!-- Left: standard basis -->
<text x="70" y="14" text-anchor="middle" fill="#333" font-size="11" font-weight="bold">Before</text>
<line x1="20" y1="150" x2="150" y2="150" stroke="#ccc" stroke-width="1" marker-end="url(#bt-arr)"/>
<line x1="20" y1="150" x2="20" y2="25" stroke="#ccc" stroke-width="1" marker-end="url(#bt-arr)"/>
<circle cx="20" cy="150" r="3" fill="#333"/>
<!-- i hat -->
<line x1="20" y1="150" x2="88" y2="150" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#bt-r)"/>
<text x="58" y="145" fill="#e74c3c" font-size="11" font-weight="bold">i</text>
<!-- j hat -->
<line x1="20" y1="150" x2="20" y2="82" stroke="#3498db" stroke-width="2.5" marker-end="url(#bt-b)"/>
<text x="12" y="112" fill="#3498db" font-size="11" font-weight="bold">j</text>
<!-- Arrow -->
<text x="185" y="85" text-anchor="middle" fill="#333" font-size="18">→</text>
<text x="185" y="102" text-anchor="middle" fill="#666" font-size="10">A =</text>
<text x="185" y="115" text-anchor="middle" fill="#666" font-size="10">[col1 | col2]</text>
<!-- Right: transformed basis -->
<text x="310" y="14" text-anchor="middle" fill="#333" font-size="11" font-weight="bold">After</text>
<line x1="230" y1="150" x2="370" y2="150" stroke="#ccc" stroke-width="1" marker-end="url(#bt-arr)"/>
<line x1="230" y1="150" x2="230" y2="25" stroke="#ccc" stroke-width="1" marker-end="url(#bt-arr)"/>
<circle cx="230" cy="150" r="3" fill="#333"/>
<!-- transformed i (column 1, e.g. [2,1]) -->
<line x1="230" y1="150" x2="350" y2="100" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#bt-r)"/>
<text x="305" y="115" fill="#e74c3c" font-size="11" font-weight="bold">Ai</text>
<!-- transformed j (column 2, e.g. [1,2]) -->
<line x1="230" y1="150" x2="280" y2="50" stroke="#3498db" stroke-width="2.5" marker-end="url(#bt-b)"/>
<text x="248" y="85" fill="#3498db" font-size="11" font-weight="bold">Aj</text>
<text x="185" y="165" text-anchor="middle" fill="#666" font-size="10">columns of A = where i and j land</text>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+41
View File
@@ -0,0 +1,41 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="25" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Bayes' Theorem Components</text>
<!-- Main formula -->
<rect x="120" y="45" width="460" height="50" rx="8" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="77" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">P(A | B) = P(B | A) · P(A) / P(B)</text>
<!-- Arrows from formula to labels -->
<!-- Posterior -->
<line x1="195" y1="95" x2="120" y2="135" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="40" y="140" width="160" height="65" rx="6" fill="#e74c3c" opacity="0.1" stroke="#e74c3c" stroke-width="1.5"/>
<text x="120" y="160" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">Posterior P(A|B)</text>
<text x="120" y="178" fill="#666" font-size="10" text-anchor="middle">Updated belief about A</text>
<text x="120" y="193" fill="#666" font-size="10" text-anchor="middle">after seeing evidence B</text>
<!-- Likelihood -->
<line x1="310" y1="95" x2="290" y2="135" stroke="#3498db" stroke-width="1.5"/>
<rect x="210" y="140" width="160" height="65" rx="6" fill="#3498db" opacity="0.1" stroke="#3498db" stroke-width="1.5"/>
<text x="290" y="160" fill="#3498db" font-size="12" text-anchor="middle" font-weight="bold">Likelihood P(B|A)</text>
<text x="290" y="178" fill="#666" font-size="10" text-anchor="middle">How probable is the</text>
<text x="290" y="193" fill="#666" font-size="10" text-anchor="middle">evidence if A is true?</text>
<!-- Prior -->
<line x1="420" y1="95" x2="460" y2="135" stroke="#27ae60" stroke-width="1.5"/>
<rect x="380" y="140" width="160" height="65" rx="6" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1.5"/>
<text x="460" y="160" fill="#27ae60" font-size="12" text-anchor="middle" font-weight="bold">Prior P(A)</text>
<text x="460" y="178" fill="#666" font-size="10" text-anchor="middle">Initial belief about A</text>
<text x="460" y="193" fill="#666" font-size="10" text-anchor="middle">before seeing any evidence</text>
<!-- Evidence -->
<line x1="490" y1="95" x2="600" y2="135" stroke="#9b59b6" stroke-width="1.5"/>
<rect x="540" y="140" width="140" height="65" rx="6" fill="#9b59b6" opacity="0.1" stroke="#9b59b6" stroke-width="1.5"/>
<text x="610" y="160" fill="#9b59b6" font-size="12" text-anchor="middle" font-weight="bold">Evidence P(B)</text>
<text x="610" y="178" fill="#666" font-size="10" text-anchor="middle">Total probability of</text>
<text x="610" y="193" fill="#666" font-size="10" text-anchor="middle">observing B (normaliser)</text>
<!-- Bottom intuition -->
<text x="350" y="240" fill="#333" font-size="12" text-anchor="middle">Intuition: start with a prior belief, update it with new evidence, get a posterior belief.</text>
<text x="350" y="260" fill="#666" font-size="11" text-anchor="middle">Strong evidence shifts the posterior far from the prior.</text>
<text x="350" y="278" fill="#666" font-size="11" text-anchor="middle">Weak evidence leaves the posterior close to the prior.</text>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

+106
View File
@@ -0,0 +1,106 @@
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="290" font-family="Arial, Helvetica, sans-serif">
<defs>
<marker id="arrow-bf" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#333"/>
</marker>
<marker id="arrow-blue-bf" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#3498db"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-size="14" font-weight="bold" fill="#333">Beamforming with Microphone Array</text>
<!-- Sound source -->
<circle cx="80" cy="50" r="14" fill="rgba(231,76,60,0.15)" stroke="#e74c3c" stroke-width="1.5"/>
<text x="80" y="53" text-anchor="middle" font-size="8" font-weight="bold" fill="#e74c3c">S</text>
<text x="80" y="78" text-anchor="middle" font-size="8" fill="#e74c3c">Sound</text>
<text x="80" y="88" text-anchor="middle" font-size="8" fill="#e74c3c">Source</text>
<!-- Sound waves (arcs) -->
<path d="M100,50 Q120,30 130,60" fill="none" stroke="#e74c3c" stroke-width="0.7" opacity="0.4"/>
<path d="M108,50 Q132,25 145,65" fill="none" stroke="#e74c3c" stroke-width="0.7" opacity="0.3"/>
<path d="M116,50 Q145,20 160,70" fill="none" stroke="#e74c3c" stroke-width="0.7" opacity="0.2"/>
<!-- Wavefront lines (angled) hitting mics -->
<line x1="120" y1="40" x2="240" y2="105" stroke="#e74c3c" stroke-width="0.8" stroke-dasharray="4,3" opacity="0.5"/>
<line x1="128" y1="48" x2="240" y2="130" stroke="#e74c3c" stroke-width="0.8" stroke-dasharray="4,3" opacity="0.5"/>
<line x1="136" y1="56" x2="240" y2="155" stroke="#e74c3c" stroke-width="0.8" stroke-dasharray="4,3" opacity="0.5"/>
<line x1="144" y1="64" x2="240" y2="180" stroke="#e74c3c" stroke-width="0.8" stroke-dasharray="4,3" opacity="0.5"/>
<!-- Angle theta -->
<line x1="210" y1="100" x2="210" y2="190" stroke="#666" stroke-width="0.6" stroke-dasharray="2,2"/>
<path d="M210,130 Q195,115 185,105" fill="none" stroke="#f39c12" stroke-width="1"/>
<text x="190" y="125" font-size="9" font-weight="bold" fill="#f39c12">theta</text>
<!-- Microphones (vertical array) -->
<rect x="230" y="95" width="24" height="18" rx="4" fill="rgba(52,152,219,0.15)" stroke="#3498db" stroke-width="1.5"/>
<text x="242" y="108" text-anchor="middle" font-size="7" fill="#3498db">M1</text>
<rect x="230" y="120" width="24" height="18" rx="4" fill="rgba(52,152,219,0.15)" stroke="#3498db" stroke-width="1.5"/>
<text x="242" y="133" text-anchor="middle" font-size="7" fill="#3498db">M2</text>
<rect x="230" y="145" width="24" height="18" rx="4" fill="rgba(52,152,219,0.15)" stroke="#3498db" stroke-width="1.5"/>
<text x="242" y="158" text-anchor="middle" font-size="7" fill="#3498db">M3</text>
<rect x="230" y="170" width="24" height="18" rx="4" fill="rgba(52,152,219,0.15)" stroke="#3498db" stroke-width="1.5"/>
<text x="242" y="183" text-anchor="middle" font-size="7" fill="#3498db">M4</text>
<!-- Array spacing label -->
<line x1="222" y1="113" x2="222" y2="120" stroke="#666" stroke-width="0.6"/>
<text x="216" y="120" text-anchor="end" font-size="6" fill="#666">d</text>
<!-- Delay lines -->
<line x1="254" y1="104" x2="310" y2="104" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-bf)"/>
<line x1="254" y1="129" x2="310" y2="129" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-bf)"/>
<line x1="254" y1="154" x2="310" y2="154" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-bf)"/>
<line x1="254" y1="179" x2="310" y2="179" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-bf)"/>
<!-- Delay blocks -->
<rect x="313" y="92" width="65" height="24" rx="4" fill="rgba(243,156,18,0.12)" stroke="#f39c12" stroke-width="1.2"/>
<text x="345" y="108" text-anchor="middle" font-size="7" fill="#333">Delay tau_1</text>
<rect x="313" y="117" width="65" height="24" rx="4" fill="rgba(243,156,18,0.12)" stroke="#f39c12" stroke-width="1.2"/>
<text x="345" y="133" text-anchor="middle" font-size="7" fill="#333">Delay tau_2</text>
<rect x="313" y="142" width="65" height="24" rx="4" fill="rgba(243,156,18,0.12)" stroke="#f39c12" stroke-width="1.2"/>
<text x="345" y="158" text-anchor="middle" font-size="7" fill="#333">Delay tau_3</text>
<rect x="313" y="167" width="65" height="24" rx="4" fill="rgba(243,156,18,0.12)" stroke="#f39c12" stroke-width="1.2"/>
<text x="345" y="183" text-anchor="middle" font-size="7" fill="#333">Delay tau_4</text>
<!-- Delay formula -->
<text x="345" y="202" text-anchor="middle" font-size="7" fill="#666">tau_i = i*d*sin(theta)/c</text>
<!-- Arrows from delays to sum -->
<line x1="378" y1="104" x2="430" y2="135" stroke="#333" stroke-width="1" marker-end="url(#arrow-bf)"/>
<line x1="378" y1="129" x2="430" y2="137" stroke="#333" stroke-width="1" marker-end="url(#arrow-bf)"/>
<line x1="378" y1="154" x2="430" y2="143" stroke="#333" stroke-width="1" marker-end="url(#arrow-bf)"/>
<line x1="378" y1="179" x2="430" y2="148" stroke="#333" stroke-width="1" marker-end="url(#arrow-bf)"/>
<!-- Sum block -->
<circle cx="445" cy="142" r="18" fill="rgba(39,174,96,0.12)" stroke="#27ae60" stroke-width="1.8"/>
<text x="445" y="147" text-anchor="middle" font-size="16" font-weight="bold" fill="#27ae60">+</text>
<text x="445" y="170" text-anchor="middle" font-size="7" fill="#27ae60">Sum</text>
<!-- Arrow to output -->
<line x1="463" y1="142" x2="498" y2="142" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-bf)"/>
<!-- 1/N scaling -->
<rect x="500" y="130" width="35" height="24" rx="4" fill="rgba(39,174,96,0.08)" stroke="#27ae60" stroke-width="1"/>
<text x="517" y="146" text-anchor="middle" font-size="9" fill="#333">1/N</text>
<line x1="535" y1="142" x2="558" y2="142" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-bf)"/>
<!-- Enhanced signal -->
<rect x="561" y="122" width="110" height="40" rx="6" fill="rgba(27,174,96,0.1)" stroke="#27ae60" stroke-width="1.5"/>
<polyline points="571,142 576,132 581,148 586,128 591,150 596,134 601,146 606,136 611,142 616,134 621,148 626,130 631,146 636,138 641,142 646,136 651,144 656,138 661,142" fill="none" stroke="#27ae60" stroke-width="1.2"/>
<text x="616" y="170" text-anchor="middle" font-size="8" font-weight="bold" fill="#27ae60">Enhanced Signal</text>
<!-- Note box -->
<rect x="30" y="215" width="640" height="55" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="50" y="235" font-size="10" font-weight="bold" fill="#333">Delay-and-sum beamforming:</text>
<text x="260" y="235" font-size="10" fill="#666">align signals by compensating for propagation delay, then sum.</text>
<text x="50" y="252" font-size="9" fill="#666">Signals from the target direction add constructively; off-axis noise partially cancels. The delay for</text>
<text x="50" y="264" font-size="9" fill="#666">each mic depends on the angle of arrival and mic spacing. Neural beamformers learn the combining weights.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.9 KiB

+75
View File
@@ -0,0 +1,75 @@
<svg width="700" height="280" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Bernoulli (single trial) vs Binomial (n trials)</text>
<!-- Left: Bernoulli -->
<text x="160" y="50" fill="#e74c3c" font-size="13" font-weight="bold" text-anchor="middle">Bernoulli(p=0.7)</text>
<!-- Axes -->
<line x1="60" y1="220" x2="280" y2="220" stroke="#333" stroke-width="1.5"/>
<line x1="60" y1="220" x2="60" y2="55" stroke="#333" stroke-width="1.5"/>
<text x="170" y="248" fill="#666" font-size="11" text-anchor="middle">Outcome</text>
<text x="35" y="140" fill="#666" font-size="11" text-anchor="middle" transform="rotate(-90,35,140)">P(X=x)</text>
<!-- Bars -->
<rect x="100" y="122" width="45" height="98" fill="#e74c3c" opacity="0.7" rx="2"/>
<text x="122" y="115" fill="#e74c3c" font-size="11" text-anchor="middle">0.3</text>
<text x="122" y="238" fill="#333" font-size="11" text-anchor="middle">0</text>
<rect x="195" y="78" width="45" height="142" fill="#e74c3c" opacity="0.7" rx="2"/>
<text x="217" y="71" fill="#e74c3c" font-size="11" text-anchor="middle">0.7</text>
<text x="217" y="238" fill="#333" font-size="11" text-anchor="middle">1</text>
<text x="160" y="265" fill="#666" font-size="10" text-anchor="middle">One coin flip: fail or success</text>
<!-- Divider -->
<line x1="340" y1="40" x2="340" y2="260" stroke="#ccc" stroke-width="1" stroke-dasharray="4,4"/>
<!-- Right: Binomial -->
<text x="520" y="50" fill="#3498db" font-size="13" font-weight="bold" text-anchor="middle">Binomial(n=8, p=0.7)</text>
<!-- Axes -->
<line x1="370" y1="220" x2="680" y2="220" stroke="#333" stroke-width="1.5"/>
<line x1="370" y1="220" x2="370" y2="55" stroke="#333" stroke-width="1.5"/>
<text x="525" y="248" fill="#666" font-size="11" text-anchor="middle">Number of successes (k)</text>
<text x="350" y="140" fill="#666" font-size="11" text-anchor="middle" transform="rotate(-90,350,140)">P(X=k)</text>
<!-- Binomial(8,0.7) PMF bars: approximate heights -->
<!-- k=0: 0.0001 -->
<rect x="385" y="219" width="24" height="1" fill="#3498db" opacity="0.7" rx="1"/>
<text x="397" y="238" fill="#333" font-size="8" text-anchor="middle">0</text>
<!-- k=1: 0.0012 -->
<rect x="415" y="218" width="24" height="2" fill="#3498db" opacity="0.7" rx="1"/>
<text x="427" y="238" fill="#333" font-size="8" text-anchor="middle">1</text>
<!-- k=2: 0.0100 -->
<rect x="445" y="214" width="24" height="6" fill="#3498db" opacity="0.7" rx="1"/>
<text x="457" y="238" fill="#333" font-size="8" text-anchor="middle">2</text>
<!-- k=3: 0.0467 -->
<rect x="475" y="193" width="24" height="27" fill="#3498db" opacity="0.7" rx="1"/>
<text x="487" y="238" fill="#333" font-size="8" text-anchor="middle">3</text>
<!-- k=4: 0.1361 -->
<rect x="505" y="141" width="24" height="79" fill="#3498db" opacity="0.7" rx="1"/>
<text x="517" y="238" fill="#333" font-size="8" text-anchor="middle">4</text>
<!-- k=5: 0.2541 -->
<rect x="535" y="73" width="24" height="147" fill="#3498db" opacity="0.7" rx="1"/>
<text x="547" y="238" fill="#333" font-size="8" text-anchor="middle">5</text>
<!-- k=6: 0.2965 (mode) -->
<rect x="565" y="68" width="24" height="152" fill="#3498db" opacity="0.9" rx="1"/>
<text x="577" y="60" fill="#3498db" font-size="9" text-anchor="middle">0.30</text>
<text x="577" y="238" fill="#333" font-size="8" text-anchor="middle">6</text>
<!-- k=7: 0.1977 -->
<rect x="595" y="106" width="24" height="114" fill="#3498db" opacity="0.7" rx="1"/>
<text x="607" y="238" fill="#333" font-size="8" text-anchor="middle">7</text>
<!-- k=8: 0.0576 -->
<rect x="625" y="187" width="24" height="33" fill="#3498db" opacity="0.7" rx="1"/>
<text x="637" y="238" fill="#333" font-size="8" text-anchor="middle">8</text>
<text x="520" y="265" fill="#666" font-size="10" text-anchor="middle">8 coin flips: how many heads?</text>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

+81
View File
@@ -0,0 +1,81 @@
<svg width="700" height="250" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="bert-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="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">BERT: Masked Language Modelling</text>
<!-- Original sentence -->
<text x="50" y="55" fill="#666" font-size="10" font-weight="bold">Original:</text>
<g>
<rect x="120" y="40" width="50" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="145" y="58" fill="#333" font-size="11" text-anchor="middle">[CLS]</text>
<rect x="178" y="40" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="198" y="58" fill="#333" font-size="11" text-anchor="middle">the</text>
<rect x="226" y="40" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="246" y="58" fill="#333" font-size="11" text-anchor="middle">cat</text>
<rect x="274" y="40" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="294" y="58" fill="#333" font-size="11" text-anchor="middle">sat</text>
<rect x="322" y="40" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="342" y="58" fill="#333" font-size="11" text-anchor="middle">on</text>
<rect x="370" y="40" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="390" y="58" fill="#333" font-size="11" text-anchor="middle">the</text>
<rect x="418" y="40" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="438" y="58" fill="#333" font-size="11" text-anchor="middle">mat</text>
</g>
<!-- Arrow down -->
<text x="500" y="62" fill="#e74c3c" font-size="10" font-weight="bold">15% masked</text>
<line x1="350" y1="70" x2="350" y2="88" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#bert-arrow)"/>
<!-- Masked input -->
<text x="50" y="110" fill="#666" font-size="10" font-weight="bold">Input:</text>
<g>
<rect x="120" y="95" width="50" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="145" y="113" fill="#333" font-size="11" text-anchor="middle">[CLS]</text>
<rect x="178" y="95" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="198" y="113" fill="#333" font-size="11" text-anchor="middle">the</text>
<!-- MASKED -->
<rect x="226" y="95" width="55" height="26" rx="4" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="2"/>
<text x="253" y="113" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">[MASK]</text>
<rect x="289" y="95" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="309" y="113" fill="#333" font-size="11" text-anchor="middle">sat</text>
<rect x="337" y="95" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="357" y="113" fill="#333" font-size="11" text-anchor="middle">on</text>
<rect x="385" y="95" width="40" height="26" rx="4" fill="#95a5a6" opacity="0.15" stroke="#95a5a6" stroke-width="1"/>
<text x="405" y="113" fill="#333" font-size="11" text-anchor="middle">the</text>
<!-- MASKED -->
<rect x="433" y="95" width="55" height="26" rx="4" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="2"/>
<text x="460" y="113" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">[MASK]</text>
</g>
<!-- BERT Transformer -->
<rect x="140" y="135" width="370" height="40" rx="8" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="2"/>
<text x="325" y="160" fill="#3498db" font-size="12" text-anchor="middle" font-weight="bold">BERT Transformer Encoder (bidirectional attention)</text>
<!-- Arrows up and down -->
<line x1="253" y1="121" x2="253" y2="132" stroke="#555" stroke-width="1" marker-end="url(#bert-arrow)"/>
<line x1="460" y1="121" x2="460" y2="132" stroke="#555" stroke-width="1" marker-end="url(#bert-arrow)"/>
<!-- Prediction outputs -->
<line x1="253" y1="175" x2="253" y2="195" stroke="#27ae60" stroke-width="1.5" marker-end="url(#bert-arrow)"/>
<line x1="460" y1="175" x2="460" y2="195" stroke="#27ae60" stroke-width="1.5" marker-end="url(#bert-arrow)"/>
<rect x="226" y="198" width="55" height="26" rx="4" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
<text x="253" y="216" fill="#27ae60" font-size="11" text-anchor="middle" font-weight="bold">cat</text>
<rect x="433" y="198" width="55" height="26" rx="4" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
<text x="460" y="216" fill="#27ae60" font-size="11" text-anchor="middle" font-weight="bold">mat</text>
<text x="350" y="216" fill="#27ae60" font-size="10" text-anchor="middle">predict masked tokens</text>
<!-- Right side: masking strategy breakdown -->
<rect x="530" y="88" width="155" height="80" rx="6" fill="#f5f5f5" stroke="#ccc" stroke-width="1"/>
<text x="607" y="105" fill="#333" font-size="10" text-anchor="middle" font-weight="bold">Of 15% selected:</text>
<text x="607" y="122" fill="#e74c3c" font-size="10" text-anchor="middle">80% → [MASK]</text>
<text x="607" y="138" fill="#f39c12" font-size="10" text-anchor="middle">10% → random word</text>
<text x="607" y="154" fill="#3498db" font-size="10" text-anchor="middle">10% → unchanged</text>
<text x="350" y="245" fill="#666" font-size="10" text-anchor="middle">Every token attends to every other token (bidirectional), enabling rich contextual representations.</text>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

+62
View File
@@ -0,0 +1,62 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 260" width="800" height="260">
<defs>
<marker id="bev-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="400" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">BEV Fusion: Projecting Sensors into Bird's-Eye-View</text>
<!-- Camera branch -->
<rect x="30" y="60" width="90" height="40" rx="8" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="75" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">Cameras</text>
<line x1="120" y1="80" x2="155" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#bev-arr)"/>
<rect x="163" y="55" width="100" height="50" rx="8" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.5"/>
<text x="213" y="76" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">2D Image</text>
<text x="213" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Encoder</text>
<line x1="263" y1="80" x2="298" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#bev-arr)"/>
<rect x="306" y="55" width="100" height="50" rx="8" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.5"/>
<text x="356" y="73" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Lift to 3D</text>
<text x="356" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">(depth pred.)</text>
<line x1="406" y1="80" x2="448" y2="130" stroke="#3498db" stroke-width="1.5" marker-end="url(#bev-arr)"/>
<!-- LiDAR branch -->
<rect x="30" y="170" width="90" height="40" rx="8" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="75" y="194" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">LiDAR</text>
<line x1="120" y1="190" x2="155" y2="190" stroke="#666" stroke-width="1.5" marker-end="url(#bev-arr)"/>
<rect x="163" y="165" width="100" height="50" rx="8" fill="#27ae60" fill-opacity="0.10" stroke="#27ae60" stroke-width="1.5"/>
<text x="213" y="186" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">3D Point</text>
<text x="213" y="202" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Encoder</text>
<line x1="263" y1="190" x2="298" y2="190" stroke="#666" stroke-width="1.5" marker-end="url(#bev-arr)"/>
<rect x="306" y="165" width="100" height="50" rx="8" fill="#27ae60" fill-opacity="0.10" stroke="#27ae60" stroke-width="1.5"/>
<text x="356" y="186" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Voxelise</text>
<text x="356" y="202" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">(BEV grid)</text>
<line x1="406" y1="190" x2="448" y2="155" stroke="#27ae60" stroke-width="1.5" marker-end="url(#bev-arr)"/>
<!-- BEV Fusion box -->
<rect x="456" y="115" width="110" height="55" rx="10" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="2"/>
<text x="511" y="138" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#f39c12">BEV Fusion</text>
<text x="511" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">concatenate features</text>
<line x1="566" y1="142" x2="608" y2="142" stroke="#666" stroke-width="1.5" marker-end="url(#bev-arr)"/>
<!-- Detection head -->
<rect x="616" y="115" width="100" height="55" rx="10" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="2"/>
<text x="666" y="138" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#9b59b6">Detection</text>
<text x="666" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#9b59b6">Head</text>
<!-- Output -->
<text x="666" y="200" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">3D boxes, classes, velocities</text>
<!-- BEV label -->
<text x="511" y="245" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#999">Both sensor streams projected into the same bird's-eye-view grid</text>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

+91
View File
@@ -0,0 +1,91 @@
<svg width="700" height="280" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="birnn-arrow" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#555"/>
</marker>
<marker id="birnn-arrow-blue" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#3498db"/>
</marker>
<marker id="birnn-arrow-red" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#e74c3c"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Bidirectional RNN</text>
<!-- Input tokens -->
<text x="120" y="250" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">x₁</text>
<text x="260" y="250" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">x₂</text>
<text x="400" y="250" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">x₃</text>
<text x="540" y="250" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">x₄</text>
<!-- Input arrows up -->
<line x1="120" y1="238" x2="120" y2="195" stroke="#555" stroke-width="1" marker-end="url(#birnn-arrow)"/>
<line x1="260" y1="238" x2="260" y2="195" stroke="#555" stroke-width="1" marker-end="url(#birnn-arrow)"/>
<line x1="400" y1="238" x2="400" y2="195" stroke="#555" stroke-width="1" marker-end="url(#birnn-arrow)"/>
<line x1="540" y1="238" x2="540" y2="195" stroke="#555" stroke-width="1" marker-end="url(#birnn-arrow)"/>
<!-- Forward RNN (blue, top-ish) -->
<text x="30" y="180" fill="#3498db" font-size="11" font-weight="bold">Forward:</text>
<rect x="90" y="165" width="60" height="30" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="120" y="185" fill="#3498db" font-size="11" text-anchor="middle">h→₁</text>
<rect x="230" y="165" width="60" height="30" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="260" y="185" fill="#3498db" font-size="11" text-anchor="middle">h→₂</text>
<rect x="370" y="165" width="60" height="30" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="400" y="185" fill="#3498db" font-size="11" text-anchor="middle">h→₃</text>
<rect x="510" y="165" width="60" height="30" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="540" y="185" fill="#3498db" font-size="11" text-anchor="middle">h→₄</text>
<!-- Forward arrows -->
<line x1="150" y1="180" x2="225" y2="180" stroke="#3498db" stroke-width="1.5" marker-end="url(#birnn-arrow-blue)"/>
<line x1="290" y1="180" x2="365" y2="180" stroke="#3498db" stroke-width="1.5" marker-end="url(#birnn-arrow-blue)"/>
<line x1="430" y1="180" x2="505" y2="180" stroke="#3498db" stroke-width="1.5" marker-end="url(#birnn-arrow-blue)"/>
<!-- Backward RNN (red, lower) -->
<text x="30" y="140" fill="#e74c3c" font-size="11" font-weight="bold">Backward:</text>
<rect x="90" y="120" width="60" height="30" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="120" y="140" fill="#e74c3c" font-size="11" text-anchor="middle">h←₁</text>
<rect x="230" y="120" width="60" height="30" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="260" y="140" fill="#e74c3c" font-size="11" text-anchor="middle">h←₂</text>
<rect x="370" y="120" width="60" height="30" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="400" y="140" fill="#e74c3c" font-size="11" text-anchor="middle">h←₃</text>
<rect x="510" y="120" width="60" height="30" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="540" y="140" fill="#e74c3c" font-size="11" text-anchor="middle">h←₄</text>
<!-- Backward arrows (right to left) -->
<line x1="230" y1="135" x2="155" y2="135" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#birnn-arrow-red)"/>
<line x1="370" y1="135" x2="295" y2="135" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#birnn-arrow-red)"/>
<line x1="510" y1="135" x2="435" y2="135" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#birnn-arrow-red)"/>
<!-- Concatenation outputs -->
<text x="30" y="75" fill="#27ae60" font-size="11" font-weight="bold">Output:</text>
<rect x="85" y="55" width="70" height="30" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="120" y="75" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">[h→;h←]₁</text>
<rect x="225" y="55" width="70" height="30" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="260" y="75" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">[h→;h←]₂</text>
<rect x="365" y="55" width="70" height="30" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="400" y="75" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">[h→;h←]₃</text>
<rect x="505" y="55" width="70" height="30" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="540" y="75" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">[h→;h←]₄</text>
<!-- Arrows from both to output -->
<line x1="120" y1="120" x2="120" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="120" y1="165" x2="120" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="260" y1="120" x2="260" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="260" y1="165" x2="260" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="400" y1="120" x2="400" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="400" y1="165" x2="400" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="540" y1="120" x2="540" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="540" y1="165" x2="540" y2="88" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<!-- Legend -->
<text x="350" y="275" fill="#666" font-size="10" text-anchor="middle">Forward and backward hidden states are concatenated at each position, giving access to full context.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

+43
View File
@@ -0,0 +1,43 @@
<svg width="700" height="180" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">BIO Tagging for Named Entity Recognition</text>
<!-- Words -->
<text x="80" y="75" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">Tim</text>
<text x="180" y="75" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">Cook</text>
<text x="290" y="75" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">visited</text>
<text x="410" y="75" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">New</text>
<text x="510" y="75" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">York</text>
<!-- BIO tag boxes -->
<!-- B-PER -->
<rect x="40" y="90" width="80" height="28" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="80" y="109" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">B-PER</text>
<!-- I-PER -->
<rect x="140" y="90" width="80" height="28" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="180" y="109" fill="#e74c3c" font-size="12" text-anchor="middle" font-weight="bold">I-PER</text>
<!-- O -->
<rect x="252" y="90" width="76" height="28" rx="6" fill="#95a5a6" opacity="0.2" stroke="#95a5a6" stroke-width="1.5"/>
<text x="290" y="109" fill="#95a5a6" font-size="12" text-anchor="middle" font-weight="bold">O</text>
<!-- B-LOC -->
<rect x="370" y="90" width="80" height="28" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="410" y="109" fill="#3498db" font-size="12" text-anchor="middle" font-weight="bold">B-LOC</text>
<!-- I-LOC -->
<rect x="470" y="90" width="80" height="28" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="510" y="109" fill="#3498db" font-size="12" text-anchor="middle" font-weight="bold">I-LOC</text>
<!-- Legend -->
<rect x="100" y="140" width="14" height="14" rx="3" fill="#e74c3c" opacity="0.3"/>
<text x="120" y="152" fill="#e74c3c" font-size="11">PER (Person)</text>
<rect x="240" y="140" width="14" height="14" rx="3" fill="#3498db" opacity="0.3"/>
<text x="260" y="152" fill="#3498db" font-size="11">LOC (Location)</text>
<rect x="380" y="140" width="14" height="14" rx="3" fill="#95a5a6" opacity="0.3"/>
<text x="400" y="152" fill="#95a5a6" font-size="11">O (Outside entity)</text>
<text x="350" y="175" fill="#666" font-size="10" text-anchor="middle">B = Begin entity, I = Inside (continuation), O = Outside. The B tag marks where a new entity starts.</text>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+41
View File
@@ -0,0 +1,41 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 250" width="650" height="250">
<defs>
<marker id="ca-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="325" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Cache-Aside Pattern</text>
<!-- App -->
<rect x="250" y="55" width="100" height="50" rx="10" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="2"/>
<text x="300" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">Application</text>
<!-- Cache -->
<rect x="50" y="150" width="110" height="50" rx="10" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="2"/>
<text x="105" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#f39c12">Cache (Redis)</text>
<!-- Database -->
<rect x="440" y="150" width="110" height="50" rx="10" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="2"/>
<text x="495" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">Database</text>
<!-- Step 1: check cache -->
<line x1="260" y1="100" x2="140" y2="150" stroke="#f39c12" stroke-width="1.5" marker-end="url(#ca-arr)"/>
<text x="170" y="118" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">1. Check cache</text>
<!-- Step 2: cache miss → query DB -->
<line x1="340" y1="100" x2="460" y2="150" stroke="#27ae60" stroke-width="1.5" marker-end="url(#ca-arr)"/>
<text x="430" y="118" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">2. Miss → query DB</text>
<!-- Step 3: store in cache -->
<line x1="440" y1="180" x2="168" y2="180" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#ca-arr)" stroke-dasharray="5,3"/>
<text x="300" y="200" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">3. Store result in cache for next time</text>
<!-- Cache hit path -->
<rect x="30" y="70" width="70" height="25" rx="5" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="1"/>
<text x="65" y="87" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">HIT: ~1ms</text>
<rect x="520" y="70" width="80" height="25" rx="5" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1"/>
<text x="560" y="87" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">MISS: ~50ms</text>
<text x="325" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Subsequent requests for the same data hit the cache (1ms) instead of the database (50ms)</text>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

+33
View File
@@ -0,0 +1,33 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 300" width="500" height="300">
<text x="250" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">CAP Theorem: Pick Two (in practice: CP or AP)</text>
<!-- Triangle -->
<polygon points="250,55 80,250 420,250" fill="none" stroke="#999" stroke-width="1.5"/>
<!-- C -->
<circle cx="250" cy="55" r="35" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="250" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#3498db">C</text>
<text x="250" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">Consistency</text>
<!-- A -->
<circle cx="80" cy="250" r="35" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="2"/>
<text x="80" y="247" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#27ae60">A</text>
<text x="80" y="263" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#27ae60">Availability</text>
<!-- P -->
<circle cx="420" cy="250" r="35" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="420" y="247" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#e74c3c">P</text>
<text x="420" y="263" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">Partition Tolerance</text>
<!-- CP label -->
<text x="350" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#9b59b6">CP</text>
<text x="350" y="160" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">PostgreSQL</text>
<text x="350" y="172" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">model registry</text>
<!-- AP label -->
<text x="150" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">AP</text>
<text x="150" y="195" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">Cassandra, DynamoDB</text>
<text x="150" y="207" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">feature store</text>
<text x="250" y="295" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Network partitions are inevitable → real choice is CP (consistent) vs AP (available)</text>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+72
View File
@@ -0,0 +1,72 @@
<svg width="700" height="260" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="clt-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#333"/>
</marker>
</defs>
<!-- Stage 1: Non-normal population -->
<text x="100" y="22" fill="#333" font-size="12" font-weight="bold" text-anchor="middle">Population (any shape)</text>
<line x1="20" y1="180" x2="180" y2="180" stroke="#333" stroke-width="1.5"/>
<line x1="20" y1="180" x2="20" y2="40" stroke="#333" stroke-width="1.5"/>
<!-- Skewed distribution bars -->
<rect x="30" y="60" width="18" height="120" fill="#e74c3c" opacity="0.6" rx="1"/>
<rect x="52" y="90" width="18" height="90" fill="#e74c3c" opacity="0.6" rx="1"/>
<rect x="74" y="120" width="18" height="60" fill="#e74c3c" opacity="0.6" rx="1"/>
<rect x="96" y="135" width="18" height="45" fill="#e74c3c" opacity="0.6" rx="1"/>
<rect x="118" y="150" width="18" height="30" fill="#e74c3c" opacity="0.6" rx="1"/>
<rect x="140" y="160" width="18" height="20" fill="#e74c3c" opacity="0.6" rx="1"/>
<rect x="162" y="168" width="14" height="12" fill="#e74c3c" opacity="0.6" rx="1"/>
<!-- Arrow 1 -->
<line x1="195" y1="110" x2="245" y2="110" stroke="#333" stroke-width="2" marker-end="url(#clt-arr)"/>
<text x="220" y="100" fill="#666" font-size="10" text-anchor="middle">take many</text>
<text x="220" y="130" fill="#666" font-size="10" text-anchor="middle">samples</text>
<!-- Stage 2: Many samples -->
<text x="350" y="22" fill="#333" font-size="12" font-weight="bold" text-anchor="middle">Sample means (n=30 each)</text>
<!-- Mini sample distributions -->
<rect x="268" y="45" width="60" height="35" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1"/>
<text x="298" y="67" fill="#3498db" font-size="10" text-anchor="middle">x̄₁ = 4.2</text>
<rect x="338" y="45" width="60" height="35" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1"/>
<text x="368" y="67" fill="#3498db" font-size="10" text-anchor="middle">x̄₂ = 3.8</text>
<rect x="408" y="45" width="60" height="35" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1"/>
<text x="438" y="67" fill="#3498db" font-size="10" text-anchor="middle">x̄₃ = 4.1</text>
<rect x="268" y="90" width="60" height="35" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1"/>
<text x="298" y="112" fill="#3498db" font-size="10" text-anchor="middle">x̄₄ = 3.9</text>
<rect x="338" y="90" width="60" height="35" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1"/>
<text x="368" y="112" fill="#3498db" font-size="10" text-anchor="middle">x̄₅ = 4.3</text>
<rect x="408" y="90" width="60" height="35" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1"/>
<text x="438" y="112" fill="#3498db" font-size="10" text-anchor="middle">x̄₆ = 4.0</text>
<text x="350" y="150" fill="#3498db" font-size="12" text-anchor="middle">... hundreds more ...</text>
<!-- Arrow 2 -->
<line x1="475" y1="110" x2="525" y2="110" stroke="#333" stroke-width="2" marker-end="url(#clt-arr)"/>
<text x="500" y="100" fill="#666" font-size="10" text-anchor="middle">plot the</text>
<text x="500" y="130" fill="#666" font-size="10" text-anchor="middle">means</text>
<!-- Stage 3: Normal distribution of sample means -->
<text x="610" y="22" fill="#333" font-size="12" font-weight="bold" text-anchor="middle">Distribution of x̄</text>
<line x1="540" y1="180" x2="680" y2="180" stroke="#333" stroke-width="1.5"/>
<line x1="540" y1="180" x2="540" y2="40" stroke="#333" stroke-width="1.5"/>
<!-- Bell curve -->
<path d="M 545,178 C 555,176 570,165 585,140 C 595,120 603,80 610,65 C 617,80 625,120 635,140 C 650,165 665,176 675,178" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="2.5"/>
<!-- Mean line -->
<line x1="610" y1="60" x2="610" y2="180" stroke="#27ae60" stroke-width="1.5" stroke-dasharray="4,3"/>
<text x="610" y="195" fill="#27ae60" font-size="10" text-anchor="middle">μ</text>
<!-- Key insight -->
<rect x="250" y="200" width="420" height="45" rx="6" fill="#27ae60" opacity="0.08" stroke="#27ae60" stroke-width="1"/>
<text x="460" y="218" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">CLT: regardless of population shape, sample means → Normal</text>
<text x="460" y="236" fill="#27ae60" font-size="11" text-anchor="middle">with mean μ and standard deviation σ/√n</text>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

+32
View File
@@ -0,0 +1,32 @@
<svg width="380" height="120" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="cr-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#999"/>
</marker>
</defs>
<!-- x box -->
<rect x="10" y="35" width="60" height="40" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="40" y="60" text-anchor="middle" fill="#3498db" font-size="14" font-weight="bold">x</text>
<!-- arrow x -> g -->
<line x1="75" y1="55" x2="108" y2="55" stroke="#999" stroke-width="1.5" marker-end="url(#cr-arr)"/>
<!-- g(x) box -->
<rect x="115" y="35" width="70" height="40" rx="6" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="150" y="60" text-anchor="middle" fill="#27ae60" font-size="14" font-weight="bold">g(x)</text>
<!-- arrow g -> f -->
<line x1="190" y1="55" x2="223" y2="55" stroke="#999" stroke-width="1.5" marker-end="url(#cr-arr)"/>
<!-- f(g(x)) box -->
<rect x="230" y="35" width="80" height="40" rx="6" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="270" y="60" text-anchor="middle" fill="#e74c3c" font-size="14" font-weight="bold">f(g(x))</text>
<!-- Derivative labels below -->
<text x="150" y="100" text-anchor="middle" fill="#27ae60" font-size="11">g'(x)</text>
<text x="195" y="100" text-anchor="middle" fill="#333" font-size="13">×</text>
<text x="270" y="100" text-anchor="middle" fill="#e74c3c" font-size="11">f'(g(x))</text>
<text x="190" y="115" text-anchor="middle" fill="#666" font-size="10">derivative of outer × derivative of inner</text>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+92
View File
@@ -0,0 +1,92 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 350" width="600" height="350">
<defs>
<marker id="cm-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5 Z" fill="#333"/>
</marker>
<marker id="cm-green" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5 Z" fill="#27ae60"/>
</marker>
<marker id="cm-red" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5 Z" fill="#e74c3c"/>
</marker>
</defs>
<!-- Title -->
<text x="300" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">CLIP Contrastive Learning: N×N Similarity Matrix</text>
<!-- Column headers -->
<text x="246" y="56" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Text₁</text>
<text x="316" y="56" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Text₂</text>
<text x="386" y="56" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Text₃</text>
<text x="456" y="56" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Text₄</text>
<!-- Row headers -->
<text x="170" y="94" text-anchor="end" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Image₁</text>
<text x="170" y="164" text-anchor="end" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Image₂</text>
<text x="170" y="234" text-anchor="end" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Image₃</text>
<text x="170" y="304" text-anchor="end" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Image₄</text>
<!-- Grid: 4x4 cells, each 70x70 -->
<!-- Row 1 -->
<rect x="211" y="64" width="70" height="52" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="246" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">+</text>
<rect x="281" y="64" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="316" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="351" y="64" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="386" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="421" y="64" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="456" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<!-- Row 2 -->
<rect x="211" y="134" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="246" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="281" y="134" width="70" height="52" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="316" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">+</text>
<rect x="351" y="134" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="386" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="421" y="134" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="456" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<!-- Row 3 -->
<rect x="211" y="204" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="246" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="281" y="204" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="316" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="351" y="204" width="70" height="52" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="386" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">+</text>
<rect x="421" y="204" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="456" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<!-- Row 4 -->
<rect x="211" y="274" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="246" y="305" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="281" y="274" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="316" y="305" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="351" y="274" width="70" height="52" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#ccc" stroke-width="1"/>
<text x="386" y="305" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#e74c3c" opacity="0.6">−</text>
<rect x="421" y="274" width="70" height="52" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="456" y="305" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">+</text>
<!-- "maximise" annotation on diagonal -->
<text x="530" y="95" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">maximise</text>
<line x1="495" y1="90" x2="522" y2="90" stroke="#27ae60" stroke-width="1.2" marker-end="url(#cm-green)"/>
<!-- "minimise" annotation on off-diagonal -->
<text x="530" y="170" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">minimise</text>
<line x1="492" y1="165" x2="522" y2="165" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#cm-red)"/>
<!-- Symmetric loss annotation at bottom -->
<text x="350" y="342" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Loss = ½ (CE over rows + CE over columns) — symmetric cross-entropy</text>
</svg>

After

Width:  |  Height:  |  Size: 6.8 KiB

+60
View File
@@ -0,0 +1,60 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 240" width="650" height="240">
<text x="325" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Cloud Service Models: What You Manage vs Provider Manages</text>
<!-- Column headers -->
<text x="200" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">IaaS</text>
<text x="325" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#f39c12">PaaS</text>
<text x="450" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">SaaS</text>
<text x="560" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">FaaS</text>
<!-- Layers (bottom to top): Networking, Storage, Servers, Virtualisation, OS, Runtime, Data, Application -->
<!-- Row height = 22, start at y=65 -->
<!-- Application -->
<rect x="140" y="65" width="120" height="20" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="265" y="65" width="120" height="20" rx="3" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="1"/>
<rect x="390" y="65" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="500" y="65" width="120" height="20" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<text x="65" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">Application</text>
<!-- Data -->
<rect x="140" y="87" width="120" height="20" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="265" y="87" width="120" height="20" rx="3" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="1"/>
<rect x="390" y="87" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="500" y="87" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<text x="65" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">Data</text>
<!-- Runtime -->
<rect x="140" y="109" width="120" height="20" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="265" y="109" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="390" y="109" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="500" y="109" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<text x="65" y="124" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">Runtime</text>
<!-- OS -->
<rect x="140" y="131" width="120" height="20" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="265" y="131" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="390" y="131" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="500" y="131" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<text x="65" y="146" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">OS</text>
<!-- Virtualisation -->
<rect x="140" y="153" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="265" y="153" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="390" y="153" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="500" y="153" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<text x="65" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">Virtualisation</text>
<!-- Hardware -->
<rect x="140" y="175" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="265" y="175" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="390" y="175" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<rect x="500" y="175" width="120" height="20" rx="3" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<text x="65" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">Hardware</text>
<!-- Legend -->
<rect x="200" y="210" width="14" height="14" rx="2" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<text x="218" y="222" font-family="Arial, sans-serif" font-size="9" fill="#666">You manage</text>
<rect x="320" y="210" width="14" height="14" rx="2" fill="#ccc" fill-opacity="0.3" stroke="#ccc" stroke-width="1"/>
<text x="338" y="222" font-family="Arial, sans-serif" font-size="9" fill="#666">Provider manages</text>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

+123
View File
@@ -0,0 +1,123 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">2D Convolution: Filter Slides Over Input</text>
<!-- Input grid 5x5 -->
<text x="120" y="48" fill="#666" font-size="11" text-anchor="middle">Input (5x5)</text>
<!-- Row 1 -->
<rect x="55" y="55" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="83" y="55" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="111" y="55" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="139" y="55" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="167" y="55" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<!-- Row 2 -->
<rect x="55" y="83" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="83" y="83" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="111" y="83" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="139" y="83" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="167" y="83" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<!-- Row 3 -->
<rect x="55" y="111" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="83" y="111" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="111" y="111" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="139" y="111" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="167" y="111" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<!-- Row 4 -->
<rect x="55" y="139" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="83" y="139" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="111" y="139" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="139" y="139" width="28" height="28" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<rect x="167" y="139" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<!-- Row 5 -->
<rect x="55" y="167" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="83" y="167" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="111" y="167" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="139" y="167" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<rect x="167" y="167" width="28" height="28" fill="#eee" stroke="#999" stroke-width="1"/>
<!-- Numbers in input -->
<text x="69" y="74" fill="#666" font-size="10" text-anchor="middle">1</text>
<text x="97" y="74" fill="#666" font-size="10" text-anchor="middle">0</text>
<text x="125" y="74" fill="#666" font-size="10" text-anchor="middle">2</text>
<text x="153" y="74" fill="#666" font-size="10" text-anchor="middle">1</text>
<text x="181" y="74" fill="#666" font-size="10" text-anchor="middle">0</text>
<text x="69" y="102" fill="#666" font-size="10" text-anchor="middle">0</text>
<text x="97" y="102" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="125" y="102" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">3</text>
<text x="153" y="102" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="181" y="102" fill="#666" font-size="10" text-anchor="middle">2</text>
<text x="69" y="130" fill="#666" font-size="10" text-anchor="middle">1</text>
<text x="97" y="130" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">2</text>
<text x="125" y="130" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="153" y="130" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">0</text>
<text x="181" y="130" fill="#666" font-size="10" text-anchor="middle">1</text>
<text x="69" y="158" fill="#666" font-size="10" text-anchor="middle">2</text>
<text x="97" y="158" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">0</text>
<text x="125" y="158" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">1</text>
<text x="153" y="158" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">2</text>
<text x="181" y="158" fill="#666" font-size="10" text-anchor="middle">0</text>
<text x="69" y="186" fill="#666" font-size="10" text-anchor="middle">0</text>
<text x="97" y="186" fill="#666" font-size="10" text-anchor="middle">1</text>
<text x="125" y="186" fill="#666" font-size="10" text-anchor="middle">0</text>
<text x="153" y="186" fill="#666" font-size="10" text-anchor="middle">1</text>
<text x="181" y="186" fill="#666" font-size="10" text-anchor="middle">3</text>
<!-- Highlighted region border -->
<rect x="83" y="83" width="84" height="84" fill="none" stroke="#3498db" stroke-width="2.5" rx="2"/>
<!-- Filter 3x3 -->
<text x="310" y="80" fill="#e74c3c" font-size="11" font-weight="bold" text-anchor="middle">Filter (3x3)</text>
<rect x="275" y="88" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="303" y="88" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="331" y="88" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="275" y="116" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="303" y="116" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="331" y="116" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="275" y="144" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="303" y="144" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="331" y="144" width="28" height="28" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<!-- Filter values -->
<text x="289" y="107" fill="#e74c3c" font-size="10" text-anchor="middle">1</text>
<text x="317" y="107" fill="#e74c3c" font-size="10" text-anchor="middle">0</text>
<text x="345" y="107" fill="#e74c3c" font-size="10" text-anchor="middle">-1</text>
<text x="289" y="135" fill="#e74c3c" font-size="10" text-anchor="middle">1</text>
<text x="317" y="135" fill="#e74c3c" font-size="10" text-anchor="middle">0</text>
<text x="345" y="135" fill="#e74c3c" font-size="10" text-anchor="middle">-1</text>
<text x="289" y="163" fill="#e74c3c" font-size="10" text-anchor="middle">1</text>
<text x="317" y="163" fill="#e74c3c" font-size="10" text-anchor="middle">0</text>
<text x="345" y="163" fill="#e74c3c" font-size="10" text-anchor="middle">-1</text>
<!-- Multiply symbol -->
<text x="240" y="130" fill="#333" font-size="18" text-anchor="middle">*</text>
<!-- Equals arrow -->
<text x="390" y="130" fill="#333" font-size="16" text-anchor="middle">=</text>
<!-- Output grid 3x3 -->
<text x="510" y="80" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Output (3x3)</text>
<rect x="472" y="88" width="32" height="32" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<rect x="504" y="88" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<rect x="536" y="88" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<rect x="472" y="120" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<rect x="504" y="120" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<rect x="536" y="120" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<rect x="472" y="152" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<rect x="504" y="152" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<rect x="536" y="152" width="32" height="32" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<!-- Output value (highlighted cell) -->
<text x="488" y="110" fill="#27ae60" font-size="11" text-anchor="middle" font-weight="bold">2</text>
<!-- Computation detail -->
<text x="350" y="210" fill="#666" font-size="10" text-anchor="middle">1·1 + 3·0 + 1·(-1) + 2·1 + 1·0 + 0·(-1) + 0·1 + 1·0 + 2·(-1) = 2</text>
<!-- Arrow showing slide direction -->
<text x="120" y="215" fill="#3498db" font-size="10" text-anchor="middle">filter slides right and down</text>
<line x1="80" y1="222" x2="160" y2="222" stroke="#3498db" stroke-width="1.2"/>
<polygon points="160,219 167,222 160,225" fill="#3498db"/>
<!-- Bottom note -->
<rect x="110" y="250" width="480" height="40" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="267" fill="#333" font-size="10" text-anchor="middle">Output size = (input - filter + 2·padding) / stride + 1</text>
<text x="350" y="282" fill="#666" font-size="10" text-anchor="middle">Same filter weights applied at every position (weight sharing)</text>
</svg>

After

Width:  |  Height:  |  Size: 9.4 KiB

+86
View File
@@ -0,0 +1,86 @@
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="280" font-family="Arial, Helvetica, sans-serif">
<defs>
<marker id="arrow-cp" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#333"/>
</marker>
<marker id="arrow-blue-cp" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#3498db"/>
</marker>
<marker id="arrow-red-cp" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#e74c3c"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-size="14" font-weight="bold" fill="#333">The Cocktail Party Problem</text>
<!-- Speaker 1 icon -->
<circle cx="55" cy="65" r="12" fill="rgba(52,152,219,0.15)" stroke="#3498db" stroke-width="1.5"/>
<circle cx="55" cy="60" r="5" fill="none" stroke="#3498db" stroke-width="1.2"/>
<path d="M47,72 Q55,80 63,72" fill="none" stroke="#3498db" stroke-width="1.2"/>
<text x="55" y="90" text-anchor="middle" font-size="8" fill="#3498db">Speaker 1</text>
<!-- Speaker 1 waveform -->
<polyline points="78,58 85,50 90,66 95,48 100,68 105,52 110,62 115,55 120,65" fill="none" stroke="#3498db" stroke-width="1.2"/>
<!-- Speaker 2 icon -->
<circle cx="55" cy="130" r="12" fill="rgba(231,76,60,0.15)" stroke="#e74c3c" stroke-width="1.5"/>
<circle cx="55" cy="125" r="5" fill="none" stroke="#e74c3c" stroke-width="1.2"/>
<path d="M47,137 Q55,145 63,137" fill="none" stroke="#e74c3c" stroke-width="1.2"/>
<text x="55" y="155" text-anchor="middle" font-size="8" fill="#e74c3c">Speaker 2</text>
<!-- Speaker 2 waveform -->
<polyline points="78,125 83,132 90,118 97,135 102,120 108,130 113,122 118,128 123,124" fill="none" stroke="#e74c3c" stroke-width="1.2"/>
<!-- Combining arrows to microphone -->
<line x1="125" y1="60" x2="165" y2="90" stroke="#3498db" stroke-width="1" marker-end="url(#arrow-blue-cp)"/>
<line x1="125" y1="130" x2="165" y2="100" stroke="#e74c3c" stroke-width="1" marker-end="url(#arrow-red-cp)"/>
<!-- Plus sign -->
<text x="145" y="98" text-anchor="middle" font-size="14" font-weight="bold" fill="#666">+</text>
<!-- Microphone -->
<rect x="170" y="82" width="30" height="30" rx="6" fill="rgba(102,102,102,0.1)" stroke="#666" stroke-width="1.5"/>
<circle cx="185" cy="92" r="6" fill="none" stroke="#666" stroke-width="1.2"/>
<line x1="185" y1="98" x2="185" y2="106" stroke="#666" stroke-width="1.5"/>
<line x1="179" y1="106" x2="191" y2="106" stroke="#666" stroke-width="1.2"/>
<text x="185" y="125" text-anchor="middle" font-size="7" fill="#666">Mic</text>
<!-- Mixed signal -->
<line x1="200" y1="97" x2="225" y2="97" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-cp)"/>
<rect x="228" y="72" width="90" height="50" rx="6" fill="rgba(155,89,182,0.08)" stroke="#9b59b6" stroke-width="1.2"/>
<text x="273" y="92" text-anchor="middle" font-size="8" fill="#333">Mixed Signal</text>
<!-- Mixed waveform -->
<polyline points="238,100 243,90 248,108 253,85 258,110 263,88 268,105 273,82 278,112 283,90 288,102 293,88 298,95 303,100 308,92" fill="none" stroke="#9b59b6" stroke-width="1"/>
<!-- Arrow to separation model -->
<line x1="318" y1="97" x2="348" y2="97" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-cp)"/>
<!-- Separation Model -->
<rect x="351" y="62" width="110" height="70" rx="6" fill="rgba(243,156,18,0.12)" stroke="#f39c12" stroke-width="1.8"/>
<text x="406" y="85" text-anchor="middle" font-size="10" font-weight="bold" fill="#333">Separation</text>
<text x="406" y="100" text-anchor="middle" font-size="10" font-weight="bold" fill="#333">Model</text>
<text x="406" y="118" text-anchor="middle" font-size="7" fill="#666">(deep network)</text>
<!-- Output arrows -->
<line x1="461" y1="82" x2="495" y2="65" stroke="#3498db" stroke-width="1.2" marker-end="url(#arrow-blue-cp)"/>
<line x1="461" y1="112" x2="495" y2="128" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#arrow-red-cp)"/>
<!-- Separated signal 1 -->
<rect x="498" y="42" width="170" height="40" rx="6" fill="rgba(52,152,219,0.08)" stroke="#3498db" stroke-width="1.2"/>
<polyline points="510,62 517,52 522,68 527,50 532,70 537,54 542,64 547,57 552,67 557,55 562,62 567,58 572,65 577,53 582,66 587,58 592,62 597,55 602,65 607,58 612,62 617,55 622,60 627,64 632,58 637,62 642,56 647,60 652,62 657,58" fill="none" stroke="#3498db" stroke-width="1"/>
<text x="583" y="90" text-anchor="middle" font-size="8" fill="#3498db">Recovered Source 1</text>
<!-- Separated signal 2 -->
<rect x="498" y="110" width="170" height="40" rx="6" fill="rgba(231,76,60,0.08)" stroke="#e74c3c" stroke-width="1.2"/>
<polyline points="510,130 515,138 522,122 529,140 534,125 540,135 545,127 550,133 555,128 560,136 565,124 570,138 575,126 580,132 585,128 590,134 595,122 600,136 605,128 610,130 615,126 620,132 625,122 630,130 635,128 640,134 645,126 650,130 655,128 660,132" fill="none" stroke="#e74c3c" stroke-width="1"/>
<text x="583" y="158" text-anchor="middle" font-size="8" fill="#e74c3c">Recovered Source 2</text>
<!-- Note box -->
<rect x="30" y="185" width="640" height="55" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="50" y="205" font-size="10" font-weight="bold" fill="#333">The cocktail party problem:</text>
<text x="260" y="205" font-size="10" fill="#666">recover individual sources from a mixture.</text>
<text x="50" y="225" font-size="9" fill="#666">Humans do this effortlessly via auditory attention. Deep learning approaches learn to separate sources</text>
<text x="50" y="237" font-size="9" fill="#666">from mixed signals, even when trained on synthetic mixtures. Key challenge: the permutation problem.</text>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

+111
View File
@@ -0,0 +1,111 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 250" width="650" height="250" font-family="Arial, sans-serif">
<!-- Title -->
<text x="325" y="22" text-anchor="middle" font-size="14" font-weight="bold" fill="#333">Codebook Utilisation: Healthy vs Collapsed</text>
<!-- LEFT: Healthy Codebook -->
<text x="160" y="48" text-anchor="middle" font-size="12" font-weight="bold" fill="#27ae60">Healthy Codebook</text>
<!-- Grid of codebook entries - healthy (most coloured) -->
<g transform="translate(55, 56)">
<!-- Row 1 -->
<rect x="0" y="0" width="24" height="18" rx="2" fill="#3498db" fill-opacity="0.5" stroke="#3498db" stroke-width="0.8"/>
<rect x="28" y="0" width="24" height="18" rx="2" fill="#e74c3c" fill-opacity="0.5" stroke="#e74c3c" stroke-width="0.8"/>
<rect x="56" y="0" width="24" height="18" rx="2" fill="#27ae60" fill-opacity="0.5" stroke="#27ae60" stroke-width="0.8"/>
<rect x="84" y="0" width="24" height="18" rx="2" fill="#f39c12" fill-opacity="0.5" stroke="#f39c12" stroke-width="0.8"/>
<rect x="112" y="0" width="24" height="18" rx="2" fill="#9b59b6" fill-opacity="0.5" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="140" y="0" width="24" height="18" rx="2" fill="#1abc9c" fill-opacity="0.5" stroke="#1abc9c" stroke-width="0.8"/>
<rect x="168" y="0" width="24" height="18" rx="2" fill="#3498db" fill-opacity="0.5" stroke="#3498db" stroke-width="0.8"/>
<rect x="196" y="0" width="24" height="18" rx="2" fill="#e74c3c" fill-opacity="0.5" stroke="#e74c3c" stroke-width="0.8"/>
<!-- Row 2 -->
<rect x="0" y="22" width="24" height="18" rx="2" fill="#f39c12" fill-opacity="0.5" stroke="#f39c12" stroke-width="0.8"/>
<rect x="28" y="22" width="24" height="18" rx="2" fill="#1abc9c" fill-opacity="0.5" stroke="#1abc9c" stroke-width="0.8"/>
<rect x="56" y="22" width="24" height="18" rx="2" fill="#9b59b6" fill-opacity="0.5" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="84" y="22" width="24" height="18" rx="2" fill="#3498db" fill-opacity="0.5" stroke="#3498db" stroke-width="0.8"/>
<rect x="112" y="22" width="24" height="18" rx="2" fill="#27ae60" fill-opacity="0.5" stroke="#27ae60" stroke-width="0.8"/>
<rect x="140" y="22" width="24" height="18" rx="2" fill="#e74c3c" fill-opacity="0.5" stroke="#e74c3c" stroke-width="0.8"/>
<rect x="168" y="22" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.5" stroke="#ccc" stroke-width="0.8"/>
<rect x="196" y="22" width="24" height="18" rx="2" fill="#f39c12" fill-opacity="0.5" stroke="#f39c12" stroke-width="0.8"/>
</g>
<text x="160" y="108" text-anchor="middle" font-size="9" fill="#666">15/16 entries active</text>
<!-- Bar chart - healthy -->
<g transform="translate(60, 118)">
<line x1="0" y1="90" x2="210" y2="90" stroke="#ccc" stroke-width="1"/>
<!-- Bars (roughly equal) -->
<rect x="4" y="20" width="10" height="70" rx="1" fill="#3498db" fill-opacity="0.6"/>
<rect x="18" y="25" width="10" height="65" rx="1" fill="#e74c3c" fill-opacity="0.6"/>
<rect x="32" y="18" width="10" height="72" rx="1" fill="#27ae60" fill-opacity="0.6"/>
<rect x="46" y="30" width="10" height="60" rx="1" fill="#f39c12" fill-opacity="0.6"/>
<rect x="60" y="22" width="10" height="68" rx="1" fill="#9b59b6" fill-opacity="0.6"/>
<rect x="74" y="28" width="10" height="62" rx="1" fill="#1abc9c" fill-opacity="0.6"/>
<rect x="88" y="15" width="10" height="75" rx="1" fill="#3498db" fill-opacity="0.6"/>
<rect x="102" y="32" width="10" height="58" rx="1" fill="#e74c3c" fill-opacity="0.6"/>
<rect x="116" y="24" width="10" height="66" rx="1" fill="#f39c12" fill-opacity="0.6"/>
<rect x="130" y="20" width="10" height="70" rx="1" fill="#1abc9c" fill-opacity="0.6"/>
<rect x="144" y="26" width="10" height="64" rx="1" fill="#9b59b6" fill-opacity="0.6"/>
<rect x="158" y="19" width="10" height="71" rx="1" fill="#3498db" fill-opacity="0.6"/>
<rect x="172" y="30" width="10" height="60" rx="1" fill="#27ae60" fill-opacity="0.6"/>
<rect x="186" y="22" width="10" height="68" rx="1" fill="#e74c3c" fill-opacity="0.6"/>
<rect x="200" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.6"/>
<!-- Axis label -->
<text x="105" y="106" text-anchor="middle" font-size="8" fill="#999">codebook entry index</text>
<text x="-8" y="55" text-anchor="middle" font-size="8" fill="#999" transform="rotate(-90 -8 55)">usage</text>
</g>
<!-- Divider -->
<line x1="325" y1="40" x2="325" y2="240" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<!-- RIGHT: Collapsed Codebook -->
<text x="490" y="48" text-anchor="middle" font-size="12" font-weight="bold" fill="#e74c3c">Collapsed Codebook</text>
<!-- Grid of codebook entries - collapsed (mostly grey) -->
<g transform="translate(385, 56)">
<!-- Row 1 -->
<rect x="0" y="0" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="28" y="0" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="56" y="0" width="24" height="18" rx="2" fill="#e74c3c" fill-opacity="0.6" stroke="#e74c3c" stroke-width="1.2"/>
<rect x="84" y="0" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="112" y="0" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="140" y="0" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="168" y="0" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="196" y="0" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<!-- Row 2 -->
<rect x="0" y="22" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="28" y="22" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="56" y="22" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="84" y="22" width="24" height="18" rx="2" fill="#3498db" fill-opacity="0.6" stroke="#3498db" stroke-width="1.2"/>
<rect x="112" y="22" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="140" y="22" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
<rect x="168" y="22" width="24" height="18" rx="2" fill="#27ae60" fill-opacity="0.6" stroke="#27ae60" stroke-width="1.2"/>
<rect x="196" y="22" width="24" height="18" rx="2" fill="#ccc" fill-opacity="0.4" stroke="#ccc" stroke-width="0.8"/>
</g>
<text x="490" y="108" text-anchor="middle" font-size="9" fill="#666">3/16 entries active</text>
<!-- Bar chart - collapsed -->
<g transform="translate(390, 118)">
<line x1="0" y1="90" x2="210" y2="90" stroke="#ccc" stroke-width="1"/>
<!-- Bars (mostly near zero, a few tall) -->
<rect x="4" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="18" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="32" y="5" width="10" height="85" rx="1" fill="#e74c3c" fill-opacity="0.6"/>
<rect x="46" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="60" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="74" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="88" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="102" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="116" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="130" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="144" y="20" width="10" height="70" rx="1" fill="#3498db" fill-opacity="0.6"/>
<rect x="158" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="172" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<rect x="186" y="30" width="10" height="60" rx="1" fill="#27ae60" fill-opacity="0.6"/>
<rect x="200" y="85" width="10" height="5" rx="1" fill="#ccc" fill-opacity="0.5"/>
<!-- Axis label -->
<text x="105" y="106" text-anchor="middle" font-size="8" fill="#999">codebook entry index</text>
<text x="-8" y="55" text-anchor="middle" font-size="8" fill="#999" transform="rotate(-90 -8 55)">usage</text>
</g>
<!-- Bottom annotations -->
<text x="160" y="242" text-anchor="middle" font-size="9" fill="#27ae60">High reconstruction quality</text>
<text x="490" y="242" text-anchor="middle" font-size="9" fill="#e74c3c">Poor reconstruction, wasted capacity</text>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

+39
View File
@@ -0,0 +1,39 @@
<svg width="320" height="150" xmlns="http://www.w3.org/2000/svg">
<!-- 3x3 matrix with row 1 and col 2 crossed out to show minor M_12 -->
<!-- matrix bracket left -->
<path d="M 20,10 L 10,10 L 10,130 L 20,130" fill="none" stroke="#333" stroke-width="2"/>
<!-- matrix bracket right -->
<path d="M 160,10 L 170,10 L 170,130 L 160,130" fill="none" stroke="#333" stroke-width="2"/>
<!-- cross-out row 1 -->
<line x1="25" y1="35" x2="155" y2="35" stroke="#e74c3c" stroke-width="2" stroke-opacity="0.6"/>
<!-- cross-out col 2 -->
<line x1="84" y1="15" x2="84" y2="125" stroke="#e74c3c" stroke-width="2" stroke-opacity="0.6"/>
<!-- entries -->
<text x="44" y="38" text-anchor="middle" fill="#ccc" font-size="16">1</text>
<text x="84" y="38" text-anchor="middle" fill="#ccc" font-size="16">5</text>
<text x="124" y="38" text-anchor="middle" fill="#ccc" font-size="16">3</text>
<text x="44" y="72" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">2</text>
<text x="84" y="72" text-anchor="middle" fill="#ccc" font-size="16">7</text>
<text x="124" y="72" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">4</text>
<text x="44" y="108" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">6</text>
<text x="84" y="108" text-anchor="middle" fill="#ccc" font-size="16">8</text>
<text x="124" y="108" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">9</text>
<!-- arrow -->
<text x="195" y="75" fill="#333" font-size="22">=</text>
<!-- resulting 2x2 minor -->
<path d="M 220,30 L 210,30 L 210,120 L 220,120" fill="none" stroke="#333" stroke-width="2"/>
<path d="M 300,30 L 310,30 L 310,120 L 300,120" fill="none" stroke="#333" stroke-width="2"/>
<!-- highlight -->
<rect x="215" y="35" width="90" height="80" rx="4" fill="#3498db" fill-opacity="0.08"/>
<text x="245" y="68" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">2</text>
<text x="285" y="68" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">4</text>
<text x="245" y="105" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">6</text>
<text x="285" y="105" text-anchor="middle" fill="#333" font-size="16" font-weight="bold">9</text>
<text x="160" y="147" text-anchor="middle" fill="#666" font-size="11">Minor M&#x2081;&#x2082;: delete row 1 and column 2</text>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+46
View File
@@ -0,0 +1,46 @@
<svg width="420" height="160" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="cs-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#999"/>
</marker>
<marker id="cs-r" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#e74c3c"/>
</marker>
<marker id="cs-b" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#3498db"/>
</marker>
</defs>
<!-- Left: 2 columns in 3D that span a plane -->
<text x="100" y="14" text-anchor="middle" fill="#333" font-size="12" font-weight="bold">Column space (2 columns in 3D)</text>
<!-- axes -->
<line x1="30" y1="140" x2="180" y2="140" stroke="#ccc" stroke-width="1" marker-end="url(#cs-arr)"/>
<line x1="30" y1="140" x2="30" y2="22" stroke="#ccc" stroke-width="1" marker-end="url(#cs-arr)"/>
<line x1="30" y1="140" x2="0" y2="155" stroke="#ccc" stroke-width="1"/>
<circle cx="30" cy="140" r="3" fill="#333"/>
<!-- col 1 -->
<line x1="30" y1="140" x2="140" y2="70" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#cs-r)"/>
<text x="100" y="90" fill="#e74c3c" font-size="11">col 1</text>
<!-- col 2 -->
<line x1="30" y1="140" x2="80" y2="35" stroke="#3498db" stroke-width="2.5" marker-end="url(#cs-b)"/>
<text x="42" y="72" fill="#3498db" font-size="11">col 2</text>
<!-- shaded plane -->
<polygon points="30,140 140,70 190,0 80,35" fill="#9b59b6" fill-opacity="0.1" stroke="#9b59b6" stroke-width="1" stroke-dasharray="4"/>
<text x="100" y="155" fill="#666" font-size="10">reachable outputs = a plane</text>
<!-- Divider -->
<line x1="210" y1="10" x2="210" y2="155" stroke="#ddd" stroke-width="1" stroke-dasharray="4"/>
<!-- Right: 2 parallel columns span only a line -->
<text x="320" y="14" text-anchor="middle" fill="#333" font-size="12" font-weight="bold">Dependent columns</text>
<line x1="240" y1="140" x2="400" y2="140" stroke="#ccc" stroke-width="1" marker-end="url(#cs-arr)"/>
<line x1="240" y1="140" x2="240" y2="22" stroke="#ccc" stroke-width="1" marker-end="url(#cs-arr)"/>
<circle cx="240" cy="140" r="3" fill="#333"/>
<!-- col 1 -->
<line x1="240" y1="140" x2="360" y2="70" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#cs-r)"/>
<text x="310" y="90" fill="#e74c3c" font-size="11">col 1</text>
<!-- col 2 (same direction, shorter) -->
<line x1="240" y1="140" x2="300" y2="105" stroke="#3498db" stroke-width="2.5" marker-end="url(#cs-b)"/>
<text x="280" y="115" fill="#3498db" font-size="11">col 2</text>
<text x="320" y="155" fill="#666" font-size="10">reachable outputs = only a line</text>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

+66
View File
@@ -0,0 +1,66 @@
<svg width="700" height="460" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Common Distribution Shapes</text>
<!-- Top-left: Uniform -->
<text x="175" y="50" fill="#3498db" font-size="12" font-weight="bold" text-anchor="middle">Uniform(0, 1)</text>
<line x1="50" y1="195" x2="300" y2="195" stroke="#333" stroke-width="1.2"/>
<line x1="50" y1="195" x2="50" y2="60" stroke="#333" stroke-width="1.2"/>
<rect x="80" y="80" width="190" height="115" fill="#3498db" opacity="0.25" stroke="#3498db" stroke-width="1.5"/>
<text x="175" y="143" fill="#3498db" font-size="11" text-anchor="middle">height = 1</text>
<text x="80" y="210" fill="#666" font-size="9" text-anchor="middle">0</text>
<text x="270" y="210" fill="#666" font-size="9" text-anchor="middle">1</text>
<!-- Top-right: Exponential -->
<text x="525" y="50" fill="#e74c3c" font-size="12" font-weight="bold" text-anchor="middle">Exponential(λ=1.5)</text>
<line x1="380" y1="195" x2="660" y2="195" stroke="#333" stroke-width="1.2"/>
<line x1="380" y1="195" x2="380" y2="60" stroke="#333" stroke-width="1.2"/>
<path d="M 400,70 C 420,100 440,130 460,155 C 480,170 510,182 540,188 C 570,192 610,194 650,194" fill="none" stroke="#e74c3c" stroke-width="2"/>
<path d="M 400,70 C 420,100 440,130 460,155 C 480,170 510,182 540,188 C 570,192 610,194 650,194 L 650,195 L 400,195 Z" fill="#e74c3c" opacity="0.15"/>
<text x="420" y="90" fill="#e74c3c" font-size="10">steep decay</text>
<text x="400" y="210" fill="#666" font-size="9" text-anchor="middle">0</text>
<!-- Bottom-left: Beta -->
<text x="175" y="255" fill="#9b59b6" font-size="12" font-weight="bold" text-anchor="middle">Beta(α=2, β=5)</text>
<line x1="50" y1="410" x2="300" y2="410" stroke="#333" stroke-width="1.2"/>
<line x1="50" y1="410" x2="50" y2="270" stroke="#333" stroke-width="1.2"/>
<path d="M 70,408 C 80,400 100,370 120,320 C 135,290 145,280 155,275 C 170,280 190,310 210,350 C 230,375 250,395 270,405 C 280,408 285,409 290,409" fill="none" stroke="#9b59b6" stroke-width="2"/>
<path d="M 70,408 C 80,400 100,370 120,320 C 135,290 145,280 155,275 C 170,280 190,310 210,350 C 230,375 250,395 270,405 C 280,408 285,409 290,409 L 290,410 L 70,410 Z" fill="#9b59b6" opacity="0.15"/>
<text x="155" y="268" fill="#9b59b6" font-size="10">skewed right</text>
<text x="70" y="425" fill="#666" font-size="9" text-anchor="middle">0</text>
<text x="290" y="425" fill="#666" font-size="9" text-anchor="middle">1</text>
<!-- Bottom-right: Poisson -->
<text x="525" y="255" fill="#27ae60" font-size="12" font-weight="bold" text-anchor="middle">Poisson(λ=4)</text>
<line x1="380" y1="410" x2="660" y2="410" stroke="#333" stroke-width="1.2"/>
<line x1="380" y1="410" x2="380" y2="270" stroke="#333" stroke-width="1.2"/>
<!-- Poisson(4) PMF bars -->
<rect x="398" y="395" width="20" height="15" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="408" y="425" fill="#333" font-size="8" text-anchor="middle">0</text>
<rect x="425" y="368" width="20" height="42" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="435" y="425" fill="#333" font-size="8" text-anchor="middle">1</text>
<rect x="452" y="335" width="20" height="75" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="462" y="425" fill="#333" font-size="8" text-anchor="middle">2</text>
<rect x="479" y="310" width="20" height="100" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="489" y="425" fill="#333" font-size="8" text-anchor="middle">3</text>
<rect x="506" y="298" width="20" height="112" fill="#27ae60" opacity="0.9" rx="1"/>
<text x="516" y="425" fill="#333" font-size="8" text-anchor="middle">4</text>
<rect x="533" y="316" width="20" height="94" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="543" y="425" fill="#333" font-size="8" text-anchor="middle">5</text>
<rect x="560" y="347" width="20" height="63" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="570" y="425" fill="#333" font-size="8" text-anchor="middle">6</text>
<rect x="587" y="374" width="20" height="36" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="597" y="425" fill="#333" font-size="8" text-anchor="middle">7</text>
<rect x="614" y="392" width="20" height="18" fill="#27ae60" opacity="0.7" rx="1"/>
<text x="624" y="425" fill="#333" font-size="8" text-anchor="middle">8</text>
<text x="525" y="445" fill="#666" font-size="10" text-anchor="middle">discrete counts of events</text>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

+29
View File
@@ -0,0 +1,29 @@
<svg width="300" height="220" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow-cu" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#e74c3c"/>
</marker>
<marker id="arrow-cv" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3498db"/>
</marker>
<marker id="arrow-cs" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#2ecc71"/>
</marker>
</defs>
<!-- u from origin -->
<line x1="30" y1="180" x2="198" y2="180" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#arrow-cu)"/>
<text x="110" y="200" fill="#e74c3c" font-size="14" font-weight="bold" text-anchor="middle">u</text>
<!-- v from origin -->
<line x1="30" y1="180" x2="110" y2="60" stroke="#3498db" stroke-width="2.5" marker-end="url(#arrow-cv)"/>
<text x="55" y="115" fill="#3498db" font-size="14" font-weight="bold">v</text>
<!-- v from tip of u (dashed) -->
<line x1="206" y1="180" x2="270" y2="60" stroke="#3498db" stroke-width="1.5" stroke-dasharray="5,3" marker-end="url(#arrow-cv)"/>
<!-- u from tip of v (dashed) -->
<line x1="118" y1="60" x2="270" y2="60" stroke="#e74c3c" stroke-width="1.5" stroke-dasharray="5,3" marker-end="url(#arrow-cu)"/>
<!-- resultant diagonal -->
<line x1="30" y1="180" x2="270" y2="60" stroke="#2ecc71" stroke-width="2" stroke-dasharray="6,3" marker-end="url(#arrow-cs)"/>
<text x="165" y="105" fill="#2ecc71" font-size="14" font-weight="bold">u + v</text>
<!-- origin -->
<circle cx="30" cy="180" r="3" fill="#333"/>
<text x="18" y="198" fill="#333" font-size="12">O</text>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

+66
View File
@@ -0,0 +1,66 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 180" width="800" height="180">
<defs>
<marker id="cp-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="400" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Compilation Pipeline: Source Code → Machine Code</text>
<!-- Source -->
<rect x="15" y="55" width="80" height="50" rx="8" fill="#555" fill-opacity="0.1" stroke="#555" stroke-width="1.5"/>
<text x="55" y="77" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#555">Source</text>
<text x="55" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#555">x = 3 + y</text>
<line x1="95" y1="80" x2="118" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#cp-arr)"/>
<!-- Lexer -->
<rect x="126" y="55" width="75" height="50" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="163" y="77" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Lexer</text>
<text x="163" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">tokens</text>
<line x1="201" y1="80" x2="224" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#cp-arr)"/>
<!-- Parser -->
<rect x="232" y="55" width="75" height="50" rx="8" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="269" y="77" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">Parser</text>
<text x="269" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">AST</text>
<line x1="307" y1="80" x2="330" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#cp-arr)"/>
<!-- Semantic -->
<rect x="338" y="55" width="85" height="50" rx="8" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="380" y="74" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Semantic</text>
<text x="380" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Analysis</text>
<text x="380" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#27ae60">type check</text>
<line x1="423" y1="80" x2="446" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#cp-arr)"/>
<!-- Optimiser -->
<rect x="454" y="55" width="85" height="50" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="496" y="77" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Optimiser</text>
<text x="496" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">IR (LLVM)</text>
<line x1="539" y1="80" x2="562" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#cp-arr)"/>
<!-- Code gen -->
<rect x="570" y="55" width="80" height="50" rx="8" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="610" y="74" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#9b59b6">Code</text>
<text x="610" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#9b59b6">Gen</text>
<line x1="650" y1="80" x2="673" y2="80" stroke="#666" stroke-width="1.5" marker-end="url(#cp-arr)"/>
<!-- Machine code -->
<rect x="681" y="55" width="95" height="50" rx="8" fill="#555" fill-opacity="0.15" stroke="#555" stroke-width="1.5"/>
<text x="728" y="74" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#555">Machine</text>
<text x="728" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#555">Code</text>
<text x="728" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#555">x86 / ARM</text>
<!-- Bottom labels -->
<text x="163" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">text → tokens</text>
<text x="269" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">tokens → tree</text>
<text x="380" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#27ae60">types + names</text>
<text x="496" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">fold, inline, elim</text>
<text x="610" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">IR → target ISA</text>
<text x="400" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Each stage transforms the program into a lower-level representation</text>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

+62
View File
@@ -0,0 +1,62 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 220" width="700" height="220">
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Concurrency vs Parallelism</text>
<line x1="350" y1="35" x2="350" y2="210" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<!-- Concurrency (left) - one core, interleaved -->
<text x="175" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">Concurrency (1 core)</text>
<text x="175" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">interleaved execution</text>
<text x="40" y="100" text-anchor="start" font-family="Arial, sans-serif" font-size="10" fill="#666">Core:</text>
<!-- Time blocks interleaved -->
<rect x="80" y="85" width="40" height="24" rx="3" fill="#e74c3c" fill-opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<text x="100" y="101" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">A</text>
<rect x="122" y="85" width="30" height="24" rx="3" fill="#3498db" fill-opacity="0.4" stroke="#3498db" stroke-width="1"/>
<text x="137" y="101" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">B</text>
<rect x="154" y="85" width="35" height="24" rx="3" fill="#e74c3c" fill-opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<text x="171" y="101" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">A</text>
<rect x="191" y="85" width="25" height="24" rx="3" fill="#27ae60" fill-opacity="0.4" stroke="#27ae60" stroke-width="1"/>
<text x="203" y="101" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">C</text>
<rect x="218" y="85" width="30" height="24" rx="3" fill="#3498db" fill-opacity="0.4" stroke="#3498db" stroke-width="1"/>
<text x="233" y="101" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">B</text>
<rect x="250" y="85" width="40" height="24" rx="3" fill="#27ae60" fill-opacity="0.4" stroke="#27ae60" stroke-width="1"/>
<text x="270" y="101" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">C</text>
<!-- Time arrow -->
<line x1="80" y1="125" x2="300" y2="125" stroke="#999" stroke-width="1"/>
<text x="310" y="129" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#999">time →</text>
<text x="175" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">tasks take turns on one core</text>
<text x="175" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">not truly simultaneous</text>
<!-- Parallelism (right) - multiple cores, simultaneous -->
<text x="525" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#27ae60">Parallelism (4 cores)</text>
<text x="525" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">simultaneous execution</text>
<text x="380" y="93" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">Core 1:</text>
<text x="380" y="113" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">Core 2:</text>
<text x="380" y="133" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">Core 3:</text>
<text x="380" y="153" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">Core 4:</text>
<!-- Simultaneous blocks -->
<rect x="440" y="80" width="200" height="18" rx="3" fill="#e74c3c" fill-opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<text x="540" y="93" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">Task A</text>
<rect x="440" y="100" width="200" height="18" rx="3" fill="#3498db" fill-opacity="0.4" stroke="#3498db" stroke-width="1"/>
<text x="540" y="113" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">Task B</text>
<rect x="440" y="120" width="200" height="18" rx="3" fill="#27ae60" fill-opacity="0.4" stroke="#27ae60" stroke-width="1"/>
<text x="540" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">Task C</text>
<rect x="440" y="140" width="200" height="18" rx="3" fill="#f39c12" fill-opacity="0.4" stroke="#f39c12" stroke-width="1"/>
<text x="540" y="153" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#f39c12">Task D</text>
<text x="525" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">all tasks run at the same time</text>
<text x="525" y="195" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">requires multiple cores</text>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

+47
View File
@@ -0,0 +1,47 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="25" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Conditional Probability: P(A | B)</text>
<!-- Left: full sample space -->
<text x="175" y="50" fill="#666" font-size="12" text-anchor="middle">Full sample space S</text>
<rect x="30" y="60" width="290" height="200" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1.2"/>
<circle cx="140" cy="160" r="70" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1.5"/>
<text x="105" y="145" fill="#e74c3c" font-size="12">A</text>
<circle cx="210" cy="160" r="70" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<text x="245" y="145" fill="#3498db" font-size="12">B</text>
<clipPath id="clipA2">
<circle cx="140" cy="160" r="70"/>
</clipPath>
<circle cx="210" cy="160" r="70" fill="#9b59b6" opacity="0.3" clip-path="url(#clipA2)"/>
<text x="175" y="165" fill="#9b59b6" font-size="10" text-anchor="middle">A∩B</text>
<!-- Arrow -->
<text x="365" y="140" fill="#333" font-size="12" text-anchor="middle">Given B</text>
<text x="365" y="158" fill="#333" font-size="12" text-anchor="middle">occurred</text>
<line x1="335" y1="165" x2="395" y2="165" stroke="#333" stroke-width="1.5" marker-end="url(#arrow2)"/>
<defs>
<marker id="arrow2" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#333"/>
</marker>
</defs>
<!-- Right: shrunk sample space -->
<text x="540" y="50" fill="#666" font-size="12" text-anchor="middle">New sample space = B</text>
<!-- B becomes the whole space -->
<circle cx="540" cy="160" r="90" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="590" y="105" fill="#3498db" font-size="12">B</text>
<!-- A∩B highlighted inside -->
<ellipse cx="510" cy="160" rx="45" ry="55" fill="#9b59b6" opacity="0.35" stroke="#9b59b6" stroke-width="1.5"/>
<text x="510" y="155" fill="#9b59b6" font-size="11" text-anchor="middle" font-weight="bold">A ∩ B</text>
<!-- Not A part of B -->
<text x="570" y="180" fill="#3498db" font-size="10" text-anchor="middle">B \ A</text>
<!-- Bottom formula -->
<text x="350" y="288" fill="#333" font-size="13" text-anchor="middle">P(A | B) = P(A ∩ B) / P(B)</text>
<text x="350" y="270" fill="#666" font-size="11" text-anchor="middle">The fraction of B that also belongs to A</text>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

+37
View File
@@ -0,0 +1,37 @@
<svg width="550" height="200" xmlns="http://www.w3.org/2000/svg">
<!-- Number line -->
<line x1="40" y1="100" x2="510" y2="100" stroke="#ccc" stroke-width="1"/>
<!-- Confidence interval bar -->
<line x1="140" y1="100" x2="410" y2="100" stroke="#3498db" stroke-width="4"/>
<!-- Left bracket -->
<line x1="140" y1="80" x2="140" y2="120" stroke="#3498db" stroke-width="3"/>
<text x="140" y="145" fill="#3498db" font-size="11" text-anchor="middle">lower bound</text>
<text x="140" y="160" fill="#3498db" font-size="11" text-anchor="middle">(x̄ - ME)</text>
<!-- Right bracket -->
<line x1="410" y1="80" x2="410" y2="120" stroke="#3498db" stroke-width="3"/>
<text x="410" y="145" fill="#3498db" font-size="11" text-anchor="middle">upper bound</text>
<text x="410" y="160" fill="#3498db" font-size="11" text-anchor="middle">(x̄ + ME)</text>
<!-- Point estimate -->
<circle cx="275" cy="100" r="6" fill="#e74c3c"/>
<text x="275" y="85" fill="#e74c3c" font-size="12" font-weight="bold" text-anchor="middle">x̄ (point estimate)</text>
<!-- Margin of error arrows -->
<line x1="275" y1="60" x2="145" y2="60" stroke="#27ae60" stroke-width="1.5"/>
<polygon points="145,57 155,60 145,63" fill="#27ae60"/>
<line x1="275" y1="60" x2="405" y2="60" stroke="#27ae60" stroke-width="1.5"/>
<polygon points="405,57 395,60 405,63" fill="#27ae60"/>
<text x="200" y="52" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">ME</text>
<text x="350" y="52" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">ME</text>
<!-- True parameter somewhere in interval -->
<line x1="305" y1="90" x2="305" y2="110" stroke="#9b59b6" stroke-width="2" stroke-dasharray="3,2"/>
<text x="305" y="180" fill="#9b59b6" font-size="11" text-anchor="middle">μ (true parameter,</text>
<text x="305" y="195" fill="#9b59b6" font-size="11" text-anchor="middle">hopefully in here!)</text>
<!-- Title -->
<text x="275" y="25" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Confidence Interval = Point Estimate ± Margin of Error</text>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

+88
View File
@@ -0,0 +1,88 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 300" width="700" height="300">
<defs>
<marker id="arrow3" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#333"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Conformer Block (Macaron-Style Sandwich)</text>
<!-- Central column x=260..440, blocks stacked bottom to top -->
<!-- Input label at bottom -->
<text x="350" y="290" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Input</text>
<line x1="350" y1="283" x2="350" y2="272" stroke="#333" stroke-width="1.3" marker-end="url(#arrow3)"/>
<!-- Block 1: Feed-Forward (1/2 step) - orange - bottom -->
<rect x="260" y="240" width="180" height="30" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="350" y="258" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">Feed-Forward (1/2 step)</text>
<!-- Arrow up -->
<line x1="350" y1="238" x2="350" y2="222" stroke="#333" stroke-width="1.3" marker-end="url(#arrow3)"/>
<!-- Block 2: Multi-Head Self-Attention - blue -->
<rect x="260" y="190" width="180" height="30" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="350" y="209" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Multi-Head Self-Attention</text>
<!-- Arrow up -->
<line x1="350" y1="188" x2="350" y2="172" stroke="#333" stroke-width="1.3" marker-end="url(#arrow3)"/>
<!-- Block 3: Convolution Module - green -->
<rect x="260" y="140" width="180" height="30" rx="6" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="350" y="159" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Convolution Module</text>
<!-- Arrow up -->
<line x1="350" y1="138" x2="350" y2="122" stroke="#333" stroke-width="1.3" marker-end="url(#arrow3)"/>
<!-- Block 4: Feed-Forward (1/2 step) - orange -->
<rect x="260" y="90" width="180" height="30" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="350" y="109" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">Feed-Forward (1/2 step)</text>
<!-- Arrow up -->
<line x1="350" y1="88" x2="350" y2="72" stroke="#333" stroke-width="1.3" marker-end="url(#arrow3)"/>
<!-- Block 5: LayerNorm - grey -->
<rect x="260" y="40" width="180" height="30" rx="6" fill="#999" fill-opacity="0.12" stroke="#999" stroke-width="1.5"/>
<text x="350" y="59" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">LayerNorm</text>
<!-- Output label at top -->
<line x1="350" y1="38" x2="350" y2="30" stroke="#333" stroke-width="1.3" marker-end="url(#arrow3)"/>
<!-- Residual connections on the right side -->
<!-- Residual for FF 1/2 (bottom) -->
<path d="M 442,270 L 465,270 L 465,242 L 442,242" fill="none" stroke="#f39c12" stroke-width="1.2" stroke-dasharray="4,2"/>
<text x="475" y="258" text-anchor="start" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">+</text>
<circle cx="475" cy="255" r="6" fill="none" stroke="#f39c12" stroke-width="1"/>
<!-- Residual for MHSA -->
<path d="M 442,220 L 488,220 L 488,192 L 442,192" fill="none" stroke="#3498db" stroke-width="1.2" stroke-dasharray="4,2"/>
<text x="498" y="209" text-anchor="start" font-family="Arial, sans-serif" font-size="7" fill="#3498db">+</text>
<circle cx="498" cy="206" r="6" fill="none" stroke="#3498db" stroke-width="1"/>
<!-- Residual for Conv -->
<path d="M 442,170 L 511,170 L 511,142 L 442,142" fill="none" stroke="#27ae60" stroke-width="1.2" stroke-dasharray="4,2"/>
<text x="521" y="159" text-anchor="start" font-family="Arial, sans-serif" font-size="7" fill="#27ae60">+</text>
<circle cx="521" cy="156" r="6" fill="none" stroke="#27ae60" stroke-width="1"/>
<!-- Residual for FF 1/2 (top) -->
<path d="M 442,120 L 534,120 L 534,92 L 442,92" fill="none" stroke="#f39c12" stroke-width="1.2" stroke-dasharray="4,2"/>
<text x="544" y="109" text-anchor="start" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">+</text>
<circle cx="544" cy="106" r="6" fill="none" stroke="#f39c12" stroke-width="1"/>
<!-- Residual label -->
<text x="550" y="160" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#666">Residual</text>
<text x="550" y="170" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#666">connections</text>
<!-- Left side annotations -->
<text x="245" y="160" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#27ae60">local context</text>
<line x1="248" y1="155" x2="258" y2="155" stroke="#27ae60" stroke-width="0.8"/>
<text x="245" y="210" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#3498db">global context</text>
<line x1="248" y1="205" x2="258" y2="205" stroke="#3498db" stroke-width="0.8"/>
<!-- Note box at bottom left -->
<rect x="20" y="245" width="215" height="42" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="127" y="261" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#333">Conformer combines local (conv)</text>
<text x="127" y="272" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#333">and global (attention) context</text>
<text x="127" y="283" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#333">for speech recognition.</text>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

+73
View File
@@ -0,0 +1,73 @@
<svg width="680" height="320" xmlns="http://www.w3.org/2000/svg">
<text x="340" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Constituency (Parse) Tree: "the cat sat on the mat"</text>
<!-- S -->
<circle cx="340" cy="55" r="18" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="340" y="60" fill="#e74c3c" font-size="13" text-anchor="middle" font-weight="bold">S</text>
<!-- S → NP, VP -->
<line x1="326" y1="70" x2="170" y2="105" stroke="#555" stroke-width="1.5"/>
<line x1="354" y1="70" x2="460" y2="105" stroke="#555" stroke-width="1.5"/>
<!-- NP (left) -->
<circle cx="170" cy="115" r="18" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="170" y="120" fill="#3498db" font-size="12" text-anchor="middle" font-weight="bold">NP</text>
<!-- NP → Det, N -->
<line x1="158" y1="130" x2="110" y2="165" stroke="#555" stroke-width="1.5"/>
<line x1="182" y1="130" x2="230" y2="165" stroke="#555" stroke-width="1.5"/>
<!-- Det: "the" -->
<circle cx="110" cy="175" r="16" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="1.5"/>
<text x="110" y="180" fill="#f39c12" font-size="11" text-anchor="middle">Det</text>
<line x1="110" y1="191" x2="110" y2="220" stroke="#555" stroke-width="1"/>
<text x="110" y="238" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">the</text>
<!-- N: "cat" -->
<circle cx="230" cy="175" r="16" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="1.5"/>
<text x="230" y="180" fill="#f39c12" font-size="11" text-anchor="middle">N</text>
<line x1="230" y1="191" x2="230" y2="220" stroke="#555" stroke-width="1"/>
<text x="230" y="238" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">cat</text>
<!-- VP -->
<circle cx="460" cy="115" r="18" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
<text x="460" y="120" fill="#27ae60" font-size="12" text-anchor="middle" font-weight="bold">VP</text>
<!-- VP → V, PP -->
<line x1="448" y1="130" x2="380" y2="165" stroke="#555" stroke-width="1.5"/>
<line x1="472" y1="130" x2="540" y2="165" stroke="#555" stroke-width="1.5"/>
<!-- V: "sat" -->
<circle cx="380" cy="175" r="16" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="1.5"/>
<text x="380" y="180" fill="#f39c12" font-size="11" text-anchor="middle">V</text>
<line x1="380" y1="191" x2="380" y2="220" stroke="#555" stroke-width="1"/>
<text x="380" y="238" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">sat</text>
<!-- PP -->
<circle cx="540" cy="175" r="18" fill="#9b59b6" opacity="0.15" stroke="#9b59b6" stroke-width="2"/>
<text x="540" y="180" fill="#9b59b6" font-size="12" text-anchor="middle" font-weight="bold">PP</text>
<!-- PP → P, NP -->
<line x1="528" y1="190" x2="480" y2="225" stroke="#555" stroke-width="1.5"/>
<line x1="552" y1="190" x2="600" y2="225" stroke="#555" stroke-width="1.5"/>
<!-- P: "on" -->
<circle cx="480" cy="235" r="14" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="1.5"/>
<text x="480" y="240" fill="#f39c12" font-size="10" text-anchor="middle">P</text>
<line x1="480" y1="249" x2="480" y2="270" stroke="#555" stroke-width="1"/>
<text x="480" y="288" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">on</text>
<!-- NP (right) -->
<circle cx="600" cy="235" r="16" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="600" y="240" fill="#3498db" font-size="11" text-anchor="middle" font-weight="bold">NP</text>
<!-- NP → Det, N (right) -->
<line x1="590" y1="249" x2="560" y2="270" stroke="#555" stroke-width="1"/>
<line x1="610" y1="249" x2="640" y2="270" stroke="#555" stroke-width="1"/>
<text x="560" y="288" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">the</text>
<text x="640" y="288" fill="#333" font-size="13" text-anchor="middle" font-weight="bold">mat</text>
<!-- Legend -->
<text x="340" y="313" fill="#666" font-size="10" text-anchor="middle">Each internal node is a phrase type; each leaf is a word. Phrases nest inside phrases.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

+75
View File
@@ -0,0 +1,75 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 280" width="700" height="280">
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Virtual Machines vs Containers</text>
<line x1="350" y1="35" x2="350" y2="270" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<!-- VM side -->
<text x="175" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">Virtual Machines</text>
<!-- Hardware -->
<rect x="30" y="230" width="290" height="30" rx="4" fill="#555" fill-opacity="0.2" stroke="#555" stroke-width="1.5"/>
<text x="175" y="250" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#555">Hardware</text>
<!-- Host OS -->
<rect x="30" y="195" width="290" height="30" rx="4" fill="#666" fill-opacity="0.15" stroke="#666" stroke-width="1.5"/>
<text x="175" y="215" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">Host OS / Hypervisor</text>
<!-- VM 1 -->
<rect x="40" y="65" width="125" height="125" rx="6" fill="#3498db" fill-opacity="0.06" stroke="#3498db" stroke-width="1.5"/>
<rect x="50" y="73" width="105" height="22" rx="3" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1"/>
<text x="102" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">App A</text>
<rect x="50" y="100" width="105" height="22" rx="3" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<text x="102" y="116" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">Bins/Libs</text>
<rect x="50" y="127" width="105" height="28" rx="3" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="1"/>
<text x="102" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#9b59b6">Guest OS</text>
<rect x="50" y="160" width="105" height="22" rx="3" fill="#666" fill-opacity="0.1" stroke="#666" stroke-width="1"/>
<text x="102" y="176" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">Virtual HW</text>
<!-- VM 2 -->
<rect x="185" y="65" width="125" height="125" rx="6" fill="#3498db" fill-opacity="0.06" stroke="#3498db" stroke-width="1.5"/>
<rect x="195" y="73" width="105" height="22" rx="3" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="1"/>
<text x="247" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">App B</text>
<rect x="195" y="100" width="105" height="22" rx="3" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<text x="247" y="116" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">Bins/Libs</text>
<rect x="195" y="127" width="105" height="28" rx="3" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="1"/>
<text x="247" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#9b59b6">Guest OS</text>
<rect x="195" y="160" width="105" height="22" rx="3" fill="#666" fill-opacity="0.1" stroke="#666" stroke-width="1"/>
<text x="247" y="176" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">Virtual HW</text>
<!-- Container side -->
<text x="525" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#27ae60">Containers</text>
<!-- Hardware -->
<rect x="380" y="230" width="290" height="30" rx="4" fill="#555" fill-opacity="0.2" stroke="#555" stroke-width="1.5"/>
<text x="525" y="250" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#555">Hardware</text>
<!-- Host OS (shared) -->
<rect x="380" y="165" width="290" height="60" rx="4" fill="#27ae60" fill-opacity="0.1" stroke="#27ae60" stroke-width="1.5"/>
<text x="525" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Host OS (shared kernel)</text>
<text x="525" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#27ae60">namespaces + cgroups</text>
<!-- Container 1 -->
<rect x="390" y="65" width="85" height="95" rx="6" fill="#3498db" fill-opacity="0.06" stroke="#3498db" stroke-width="1.5"/>
<rect x="397" y="73" width="71" height="22" rx="3" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1"/>
<text x="432" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">App A</text>
<rect x="397" y="100" width="71" height="22" rx="3" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<text x="432" y="116" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">Bins/Libs</text>
<text x="432" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#999">no guest OS!</text>
<!-- Container 2 -->
<rect x="490" y="65" width="85" height="95" rx="6" fill="#3498db" fill-opacity="0.06" stroke="#3498db" stroke-width="1.5"/>
<rect x="497" y="73" width="71" height="22" rx="3" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="1"/>
<text x="532" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">App B</text>
<rect x="497" y="100" width="71" height="22" rx="3" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<text x="532" y="116" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">Bins/Libs</text>
<!-- Container 3 -->
<rect x="590" y="65" width="70" height="95" rx="6" fill="#3498db" fill-opacity="0.06" stroke="#3498db" stroke-width="1.5"/>
<rect x="597" y="73" width="56" height="22" rx="3" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1"/>
<text x="625" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">App C</text>
<rect x="597" y="100" width="56" height="22" rx="3" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<text x="625" y="116" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">Libs</text>
<text x="175" y="270" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">heavy: each VM runs full OS</text>
<text x="525" y="270" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">light: shared kernel, ms startup</text>
</svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

+103
View File
@@ -0,0 +1,103 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 300" width="650" height="300" font-family="Arial, sans-serif">
<!-- Title -->
<text x="325" y="22" text-anchor="middle" font-size="14" font-weight="bold" fill="#333">Choosing Between Continuous and Discrete Tokens</text>
<defs>
<marker id="dArr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
<marker id="dArrGreen" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#27ae60"/>
</marker>
<marker id="dArrBlue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#3498db"/>
</marker>
<marker id="dArrOrange" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#f39c12"/>
</marker>
</defs>
<!-- Start node -->
<rect x="220" y="42" width="210" height="40" rx="20" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="325" y="66" text-anchor="middle" font-size="11" font-weight="bold" fill="#9b59b6">How will you generate?</text>
<!-- Left branch arrow -->
<path d="M260,82 L130,120" fill="none" stroke="#27ae60" stroke-width="1.5" marker-end="url(#dArrGreen)"/>
<text x="172" y="96" font-size="9" fill="#27ae60" font-weight="bold">Autoregressive</text>
<text x="170" y="108" font-size="8" fill="#666">(next-token)</text>
<!-- Right branch arrow -->
<path d="M390,82 L520,120" fill="none" stroke="#3498db" stroke-width="1.5" marker-end="url(#dArrBlue)"/>
<text x="462" y="96" font-size="9" fill="#3498db" font-weight="bold">Diffusion</text>
<text x="468" y="108" font-size="8" fill="#666">(iterative denoising)</text>
<!-- Middle branch arrow -->
<path d="M325,82 L325,120" fill="none" stroke="#f39c12" stroke-width="1.5" marker-end="url(#dArrOrange)"/>
<text x="358" y="106" font-size="9" fill="#f39c12" font-weight="bold">Hybrid</text>
<!-- Left: Discrete Tokens box -->
<rect x="30" y="128" width="200" height="80" rx="8" fill="#27ae60" fill-opacity="0.1" stroke="#27ae60" stroke-width="1.5"/>
<text x="130" y="152" text-anchor="middle" font-size="12" font-weight="bold" fill="#27ae60">Use Discrete Tokens</text>
<!-- Token grid illustration -->
<g transform="translate(60, 160)">
<rect x="0" y="0" width="22" height="18" rx="2" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<text x="11" y="12" text-anchor="middle" font-size="7" fill="#27ae60">42</text>
<rect x="25" y="0" width="22" height="18" rx="2" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<text x="36" y="12" text-anchor="middle" font-size="7" fill="#27ae60">7</text>
<rect x="50" y="0" width="22" height="18" rx="2" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<text x="61" y="12" text-anchor="middle" font-size="7" fill="#27ae60">156</text>
<rect x="75" y="0" width="22" height="18" rx="2" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<text x="86" y="12" text-anchor="middle" font-size="7" fill="#27ae60">89</text>
<rect x="100" y="0" width="22" height="18" rx="2" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<text x="111" y="12" text-anchor="middle" font-size="7" fill="#27ae60">3</text>
</g>
<text x="130" y="196" text-anchor="middle" font-size="9" fill="#666">VQ-VAE / VQ-GAN</text>
<!-- Left examples -->
<rect x="40" y="216" width="180" height="44" rx="6" fill="#27ae60" fill-opacity="0.05" stroke="#27ae60" stroke-width="0.8" stroke-dasharray="3,2"/>
<text x="130" y="232" text-anchor="middle" font-size="8" fill="#27ae60">DALL-E, Parti, LlamaGen,</text>
<text x="130" y="244" text-anchor="middle" font-size="8" fill="#27ae60">VideoGPT, MAGVIT</text>
<!-- Middle: Soft Quantisation -->
<rect x="245" y="128" width="160" height="80" rx="8" fill="#f39c12" fill-opacity="0.1" stroke="#f39c12" stroke-width="1.5"/>
<text x="325" y="150" text-anchor="middle" font-size="12" font-weight="bold" fill="#f39c12">Soft Quantisation</text>
<!-- Soft token illustration -->
<g transform="translate(272, 158)">
<rect x="0" y="0" width="26" height="18" rx="2" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="0.8"/>
<text x="13" y="12" text-anchor="middle" font-size="6" fill="#f39c12">0.7|0.3</text>
<rect x="30" y="0" width="26" height="18" rx="2" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="0.8"/>
<text x="43" y="12" text-anchor="middle" font-size="6" fill="#f39c12">0.9|0.1</text>
<rect x="60" y="0" width="26" height="18" rx="2" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="0.8"/>
<text x="73" y="12" text-anchor="middle" font-size="6" fill="#f39c12">0.5|0.5</text>
</g>
<text x="325" y="196" text-anchor="middle" font-size="9" fill="#666">Gumbel-Softmax / dVAE</text>
<!-- Middle examples -->
<rect x="255" y="216" width="140" height="44" rx="6" fill="#f39c12" fill-opacity="0.05" stroke="#f39c12" stroke-width="0.8" stroke-dasharray="3,2"/>
<text x="325" y="232" text-anchor="middle" font-size="8" fill="#f39c12">DALL-E (training),</text>
<text x="325" y="244" text-anchor="middle" font-size="8" fill="#f39c12">Maskbit</text>
<!-- Right: Continuous Tokens box -->
<rect x="420" y="128" width="200" height="80" rx="8" fill="#3498db" fill-opacity="0.1" stroke="#3498db" stroke-width="1.5"/>
<text x="520" y="150" text-anchor="middle" font-size="12" font-weight="bold" fill="#3498db">Use Continuous Tokens</text>
<!-- Continuous latent illustration -->
<g transform="translate(454, 158)">
<rect x="0" y="0" width="26" height="18" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<text x="13" y="12" text-anchor="middle" font-size="6" fill="#3498db">0.73</text>
<rect x="30" y="0" width="26" height="18" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<text x="43" y="12" text-anchor="middle" font-size="6" fill="#3498db">-0.21</text>
<rect x="60" y="0" width="26" height="18" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<text x="73" y="12" text-anchor="middle" font-size="6" fill="#3498db">1.45</text>
<rect x="90" y="0" width="26" height="18" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<text x="103" y="12" text-anchor="middle" font-size="6" fill="#3498db">-0.58</text>
</g>
<text x="520" y="196" text-anchor="middle" font-size="9" fill="#666">VAE latents (KL-regularised)</text>
<!-- Right examples -->
<rect x="430" y="216" width="180" height="44" rx="6" fill="#3498db" fill-opacity="0.05" stroke="#3498db" stroke-width="0.8" stroke-dasharray="3,2"/>
<text x="520" y="232" text-anchor="middle" font-size="8" fill="#3498db">Stable Diffusion, DALL-E 3,</text>
<text x="520" y="244" text-anchor="middle" font-size="8" fill="#3498db">Sora, Imagen Video</text>
<!-- Bottom note -->
<text x="325" y="284" text-anchor="middle" font-size="9" fill="#999">The generation method determines whether discrete or continuous tokenisation is most appropriate</text>
</svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

+87
View File
@@ -0,0 +1,87 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 250" width="650" height="250">
<!-- Title -->
<text x="325" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Effect of Temperature on Contrastive Softmax</text>
<!-- Divider -->
<line x1="325" y1="34" x2="325" y2="242" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<!-- ====== LEFT: Low Temperature ====== -->
<text x="162" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">Low Temperature (τ → 0)</text>
<text x="162" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Sharp / peaked distribution</text>
<!-- Left axes -->
<line x1="55" y1="200" x2="280" y2="200" stroke="#999" stroke-width="1"/>
<line x1="55" y1="200" x2="55" y2="75" stroke="#999" stroke-width="1"/>
<text x="167" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">Candidates</text>
<text x="42" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999" transform="rotate(-90,42,140)">Softmax prob.</text>
<!-- Left bar chart — peaked at correct match -->
<!-- Bar 1 (low) -->
<rect x="72" y="190" width="28" height="10" rx="2" fill="#3498db" fill-opacity="0.4"/>
<!-- Bar 2 (low) -->
<rect x="112" y="188" width="28" height="12" rx="2" fill="#3498db" fill-opacity="0.4"/>
<!-- Bar 3 — correct match (very tall) -->
<rect x="152" y="82" width="28" height="118" rx="2" fill="#27ae60" fill-opacity="0.8"/>
<text x="166" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">correct</text>
<!-- Bar 4 (low) -->
<rect x="192" y="192" width="28" height="8" rx="2" fill="#3498db" fill-opacity="0.4"/>
<!-- Bar 5 (low) -->
<rect x="232" y="191" width="28" height="9" rx="2" fill="#3498db" fill-opacity="0.4"/>
<!-- Tick labels -->
<text x="86" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">1</text>
<text x="126" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">2</text>
<text x="166" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">3</text>
<text x="206" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">4</text>
<text x="246" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">5</text>
<!-- Y-axis ticks left -->
<line x1="52" y1="200" x2="55" y2="200" stroke="#999" stroke-width="1"/>
<text x="48" y="203" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#999">0</text>
<line x1="52" y1="140" x2="55" y2="140" stroke="#999" stroke-width="1"/>
<text x="48" y="143" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#999">0.5</text>
<line x1="52" y1="80" x2="55" y2="80" stroke="#999" stroke-width="1"/>
<text x="48" y="83" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#999">1.0</text>
<!-- ====== RIGHT: High Temperature ====== -->
<text x="488" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">High Temperature (τ → ∞)</text>
<text x="488" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Uniform / flat distribution</text>
<!-- Right axes -->
<line x1="380" y1="200" x2="605" y2="200" stroke="#999" stroke-width="1"/>
<line x1="380" y1="200" x2="380" y2="75" stroke="#999" stroke-width="1"/>
<text x="492" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">Candidates</text>
<text x="367" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999" transform="rotate(-90,367,140)">Softmax prob.</text>
<!-- Right bar chart — nearly uniform -->
<rect x="397" y="175" width="28" height="25" rx="2" fill="#3498db" fill-opacity="0.5"/>
<rect x="437" y="173" width="28" height="27" rx="2" fill="#3498db" fill-opacity="0.5"/>
<!-- correct match — only slightly taller -->
<rect x="477" y="170" width="28" height="30" rx="2" fill="#f39c12" fill-opacity="0.6"/>
<text x="491" y="166" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">correct</text>
<rect x="517" y="174" width="28" height="26" rx="2" fill="#3498db" fill-opacity="0.5"/>
<rect x="557" y="176" width="28" height="24" rx="2" fill="#3498db" fill-opacity="0.5"/>
<!-- Tick labels -->
<text x="411" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">1</text>
<text x="451" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">2</text>
<text x="491" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">3</text>
<text x="531" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">4</text>
<text x="571" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#999">5</text>
<!-- Y-axis ticks right -->
<line x1="377" y1="200" x2="380" y2="200" stroke="#999" stroke-width="1"/>
<text x="373" y="203" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#999">0</text>
<line x1="377" y1="140" x2="380" y2="140" stroke="#999" stroke-width="1"/>
<text x="373" y="143" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#999">0.5</text>
<line x1="377" y1="80" x2="380" y2="80" stroke="#999" stroke-width="1"/>
<text x="373" y="83" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#999">1.0</text>
<!-- Uniform line reference -->
<line x1="390" y1="176" x2="595" y2="176" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<text x="600" y="174" text-anchor="start" font-family="Arial, sans-serif" font-size="7" fill="#ccc">1/N</text>
<!-- Bottom note -->
<text x="325" y="244" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">softmax(sᵢ / τ) — lower τ sharpens the distribution, higher τ flattens it</text>
</svg>

After

Width:  |  Height:  |  Size: 6.1 KiB

+109
View File
@@ -0,0 +1,109 @@
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="290" font-family="Arial, Helvetica, sans-serif">
<defs>
<marker id="arrow-ct" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0,0 8,3 0,6" fill="#333"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-size="14" font-weight="bold" fill="#333">Conv-TasNet Architecture</text>
<!-- Section labels -->
<text x="85" y="42" text-anchor="middle" font-size="9" font-weight="bold" fill="#3498db">Encoder</text>
<text x="330" y="42" text-anchor="middle" font-size="9" font-weight="bold" fill="#9b59b6">Separator (TCN)</text>
<text x="590" y="42" text-anchor="middle" font-size="9" font-weight="bold" fill="#27ae60">Decoder</text>
<!-- Mixture waveform -->
<rect x="20" y="55" width="80" height="40" rx="4" fill="rgba(102,102,102,0.06)" stroke="#666" stroke-width="1"/>
<polyline points="28,75 33,65 38,82 43,60 48,85 53,62 58,78 63,68 68,80 73,63 78,76 83,70 88,75 93,68" fill="none" stroke="#666" stroke-width="1"/>
<text x="60" y="105" text-anchor="middle" font-size="8" fill="#333">Mixture x(t)</text>
<line x1="100" y1="75" x2="118" y2="75" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ct)"/>
<!-- Encoder -->
<rect x="121" y="52" width="75" height="46" rx="6" fill="rgba(52,152,219,0.12)" stroke="#3498db" stroke-width="1.5"/>
<text x="158" y="70" text-anchor="middle" font-size="9" fill="#333">Encoder</text>
<text x="158" y="83" text-anchor="middle" font-size="7" fill="#666">1D Conv</text>
<text x="158" y="93" text-anchor="middle" font-size="7" fill="#666">+ ReLU</text>
<line x1="196" y1="75" x2="218" y2="75" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ct)"/>
<!-- Encoded mixture representation -->
<rect x="221" y="58" width="55" height="34" rx="4" fill="rgba(52,152,219,0.06)" stroke="#3498db" stroke-width="0.8"/>
<text x="248" y="72" text-anchor="middle" font-size="7" fill="#333">Encoded</text>
<text x="248" y="82" text-anchor="middle" font-size="7" fill="#333">Mixture W</text>
<line x1="276" y1="75" x2="295" y2="75" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ct)"/>
<!-- TCN Separator -->
<rect x="298" y="50" width="130" height="120" rx="6" fill="rgba(155,89,182,0.08)" stroke="#9b59b6" stroke-width="1.8"/>
<!-- TCN blocks with skip connections -->
<rect x="313" y="60" width="100" height="22" rx="4" fill="rgba(155,89,182,0.12)" stroke="#9b59b6" stroke-width="1"/>
<text x="363" y="75" text-anchor="middle" font-size="7" fill="#333">1x1 Conv + PReLU + Norm</text>
<rect x="313" y="88" width="100" height="22" rx="4" fill="rgba(155,89,182,0.12)" stroke="#9b59b6" stroke-width="1"/>
<text x="363" y="103" text-anchor="middle" font-size="7" fill="#333">D-Conv (dilation 2^k)</text>
<rect x="313" y="116" width="100" height="22" rx="4" fill="rgba(155,89,182,0.12)" stroke="#9b59b6" stroke-width="1"/>
<text x="363" y="131" text-anchor="middle" font-size="7" fill="#333">1x1 Conv (skip + res)</text>
<!-- Skip connection line -->
<line x1="413" y1="127" x2="430" y2="127" stroke="#f39c12" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="430" y1="127" x2="430" y2="60" stroke="#f39c12" stroke-width="1" stroke-dasharray="3,2"/>
<text x="440" y="95" font-size="6" fill="#f39c12">skip</text>
<!-- Residual path -->
<line x1="305" y1="71" x2="305" y2="127" stroke="#27ae60" stroke-width="0.8" stroke-dasharray="2,2"/>
<text x="300" y="100" font-size="6" fill="#27ae60" text-anchor="end">res</text>
<text x="363" y="150" text-anchor="middle" font-size="7" fill="#9b59b6">x R repeats</text>
<!-- Mask outputs -->
<rect x="313" y="155" width="100" height="18" rx="4" fill="rgba(243,156,18,0.15)" stroke="#f39c12" stroke-width="1"/>
<text x="363" y="168" text-anchor="middle" font-size="7" fill="#333">Sigmoid masks (M1, M2)</text>
<!-- Apply masks -->
<line x1="428" y1="75" x2="448" y2="75" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ct)"/>
<!-- Mask application -->
<rect x="451" y="55" width="60" height="40" rx="6" fill="rgba(243,156,18,0.1)" stroke="#f39c12" stroke-width="1.2"/>
<text x="481" y="72" text-anchor="middle" font-size="8" fill="#333">Apply</text>
<text x="481" y="83" text-anchor="middle" font-size="8" fill="#333">Masks</text>
<text x="481" y="105" text-anchor="middle" font-size="7" fill="#666">W * M_i</text>
<!-- Mask connection from TCN bottom to Apply -->
<line x1="413" y1="164" x2="470" y2="164" stroke="#f39c12" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="470" y1="164" x2="470" y2="95" stroke="#f39c12" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="511" y1="75" x2="530" y2="75" stroke="#333" stroke-width="1.2" marker-end="url(#arrow-ct)"/>
<!-- Decoder -->
<rect x="533" y="52" width="75" height="46" rx="6" fill="rgba(39,174,96,0.12)" stroke="#27ae60" stroke-width="1.5"/>
<text x="570" y="70" text-anchor="middle" font-size="9" fill="#333">Decoder</text>
<text x="570" y="83" text-anchor="middle" font-size="7" fill="#666">Transposed</text>
<text x="570" y="93" text-anchor="middle" font-size="7" fill="#666">1D Conv</text>
<line x1="608" y1="68" x2="635" y2="55" stroke="#3498db" stroke-width="1.2" marker-end="url(#arrow-ct)"/>
<line x1="608" y1="82" x2="635" y2="95" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#arrow-ct)"/>
<!-- Output separated waveforms -->
<rect x="638" y="38" width="50" height="28" rx="4" fill="rgba(52,152,219,0.08)" stroke="#3498db" stroke-width="1"/>
<polyline points="644,52 648,45 652,58 656,42 660,56 664,48 668,54 672,46 676,52 680,48" fill="none" stroke="#3498db" stroke-width="0.8"/>
<text x="663" y="75" text-anchor="middle" font-size="7" fill="#3498db">s1(t)</text>
<rect x="638" y="85" width="50" height="28" rx="4" fill="rgba(231,76,60,0.08)" stroke="#e74c3c" stroke-width="1"/>
<polyline points="644,99 648,106 652,92 656,108 660,94 664,102 668,96 672,100 676,95 680,102" fill="none" stroke="#e74c3c" stroke-width="0.8"/>
<text x="663" y="122" text-anchor="middle" font-size="7" fill="#e74c3c">s2(t)</text>
<!-- Encoder-to-Mask connection (skip from encoded to mask apply) -->
<path d="M248,92 L248,190 L481,190 L481,105" fill="none" stroke="#3498db" stroke-width="0.8" stroke-dasharray="4,3"/>
<text x="360" y="200" text-anchor="middle" font-size="7" fill="#3498db">encoded mixture W passed to mask application</text>
<!-- Note box -->
<rect x="30" y="215" width="640" height="55" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="50" y="235" font-size="10" font-weight="bold" fill="#333">Time-domain approach:</text>
<text x="197" y="235" font-size="10" fill="#666">works directly on waveforms, no STFT needed.</text>
<text x="50" y="252" font-size="9" fill="#666">The encoder learns a task-optimal representation. The TCN separator produces masks in the learned basis,</text>
<text x="50" y="264" font-size="9" fill="#666">and the decoder reconstructs the separated waveforms. Achieves strong SI-SDR on speech separation benchmarks.</text>
</svg>

After

Width:  |  Height:  |  Size: 7.0 KiB

+76
View File
@@ -0,0 +1,76 @@
<svg width="440" height="190" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="cn-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#ccc"/>
</marker>
</defs>
<!-- === Convex (bowl) === -->
<text x="70" y="14" text-anchor="middle" fill="#333" font-size="10" font-weight="bold">Convex (f'' &gt; 0)</text>
<line x1="10" y1="145" x2="135" y2="145" stroke="#ccc" stroke-width="0.8" marker-end="url(#cn-arr)"/>
<line x1="10" y1="145" x2="10" y2="22" stroke="#ccc" stroke-width="0.8" marker-end="url(#cn-arr)"/>
<!-- Bowl curve -->
<path d="M 15,40 Q 45,125 70,140 Q 95,125 125,40" fill="none" stroke="#27ae60" stroke-width="2.5"/>
<!-- Line segment above curve -->
<line x1="30" y1="95" x2="112" y2="95" stroke="#27ae60" stroke-width="1" stroke-dasharray="3"/>
<circle cx="30" cy="95" r="2.5" fill="#27ae60" fill-opacity="0.5"/>
<circle cx="112" cy="95" r="2.5" fill="#27ae60" fill-opacity="0.5"/>
<text x="71" y="88" text-anchor="middle" fill="#27ae60" font-size="8">line above curve</text>
<!-- Min point -->
<circle cx="70" cy="141" r="4" fill="#27ae60"/>
<text x="70" y="160" text-anchor="middle" fill="#27ae60" font-size="9" font-weight="bold">minimum</text>
<text x="70" y="172" text-anchor="middle" fill="#27ae60" font-size="8">curves upward</text>
<!-- Divider 1 -->
<line x1="148" y1="10" x2="148" y2="175" stroke="#ddd" stroke-width="1" stroke-dasharray="4"/>
<!-- === Concave (hill) === -->
<text x="220" y="14" text-anchor="middle" fill="#333" font-size="10" font-weight="bold">Concave (f'' &lt; 0)</text>
<line x1="160" y1="145" x2="285" y2="145" stroke="#ccc" stroke-width="0.8" marker-end="url(#cn-arr)"/>
<line x1="160" y1="145" x2="160" y2="22" stroke="#ccc" stroke-width="0.8" marker-end="url(#cn-arr)"/>
<!-- Hill curve -->
<path d="M 165,135 Q 195,45 220,30 Q 245,45 275,135" fill="none" stroke="#e74c3c" stroke-width="2.5"/>
<!-- Line segment below curve -->
<line x1="182" y1="85" x2="260" y2="85" stroke="#e74c3c" stroke-width="1" stroke-dasharray="3"/>
<circle cx="182" cy="85" r="2.5" fill="#e74c3c" fill-opacity="0.5"/>
<circle cx="260" cy="85" r="2.5" fill="#e74c3c" fill-opacity="0.5"/>
<text x="221" y="100" text-anchor="middle" fill="#e74c3c" font-size="8">line below curve</text>
<!-- Max point -->
<circle cx="220" cy="30" r="4" fill="#e74c3c"/>
<text x="220" y="160" text-anchor="middle" fill="#e74c3c" font-size="9" font-weight="bold">maximum</text>
<text x="220" y="172" text-anchor="middle" fill="#e74c3c" font-size="8">curves downward</text>
<!-- Divider 2 -->
<line x1="298" y1="10" x2="298" y2="175" stroke="#ddd" stroke-width="1" stroke-dasharray="4"/>
<!-- === Inflection point === -->
<text x="370" y="14" text-anchor="middle" fill="#333" font-size="10" font-weight="bold">Inflection (f'' = 0)</text>
<line x1="310" y1="145" x2="435" y2="145" stroke="#ccc" stroke-width="0.8" marker-end="url(#cn-arr)"/>
<line x1="310" y1="145" x2="310" y2="22" stroke="#ccc" stroke-width="0.8" marker-end="url(#cn-arr)"/>
<!-- S-curve transitioning concave to convex -->
<path d="M 315,30 Q 340,40 355,65 Q 370,90 370,90 Q 370,90 385,115 Q 400,135 430,140" fill="none" stroke="#9b59b6" stroke-width="2.5"/>
<!-- Inflection point -->
<circle cx="370" cy="90" r="4" fill="#9b59b6"/>
<!-- Tangent at inflection -->
<line x1="340" y1="110" x2="400" y2="70" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4"/>
<!-- Labels for concave/convex regions -->
<text x="340" y="45" fill="#e74c3c" font-size="8">concave</text>
<text x="400" y="138" fill="#27ae60" font-size="8">convex</text>
<text x="370" y="160" text-anchor="middle" fill="#9b59b6" font-size="9" font-weight="bold">switches here</text>
<text x="370" y="172" text-anchor="middle" fill="#9b59b6" font-size="8">curvature changes sign</text>
<text x="220" y="187" text-anchor="middle" fill="#666" font-size="10">convex: bowl (unique min) | concave: hill (unique max) | inflection: curvature flips</text>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

+63
View File
@@ -0,0 +1,63 @@
<svg width="700" height="230" xmlns="http://www.w3.org/2000/svg">
<!-- Positive Correlation -->
<text x="110" y="20" fill="#27ae60" font-size="13" font-weight="bold" text-anchor="middle">Positive (r ≈ +0.9)</text>
<rect x="20" y="30" width="180" height="180" fill="none" stroke="#ccc" stroke-width="1" rx="3"/>
<!-- axes -->
<line x1="30" y1="200" x2="190" y2="200" stroke="#999" stroke-width="1"/>
<line x1="30" y1="200" x2="30" y2="40" stroke="#999" stroke-width="1"/>
<!-- points trending up -->
<circle cx="45" cy="185" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="55" cy="175" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="70" cy="162" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="80" cy="148" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="95" cy="135" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="105" cy="120" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="115" cy="112" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="130" cy="95" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="145" cy="80" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="155" cy="68" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="170" cy="55" r="3.5" fill="#27ae60" opacity="0.7"/>
<circle cx="180" cy="48" r="3.5" fill="#27ae60" opacity="0.7"/>
<!-- trend line -->
<line x1="40" y1="190" x2="185" y2="45" stroke="#27ae60" stroke-width="1.5" stroke-dasharray="4,2"/>
<!-- No Correlation -->
<text x="350" y="20" fill="#9b59b6" font-size="13" font-weight="bold" text-anchor="middle">No correlation (r ≈ 0)</text>
<rect x="260" y="30" width="180" height="180" fill="none" stroke="#ccc" stroke-width="1" rx="3"/>
<line x1="270" y1="200" x2="430" y2="200" stroke="#999" stroke-width="1"/>
<line x1="270" y1="200" x2="270" y2="40" stroke="#999" stroke-width="1"/>
<!-- scattered points -->
<circle cx="290" cy="80" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="305" cy="170" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="320" cy="55" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="330" cy="145" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="345" cy="100" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="355" cy="180" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="370" cy="60" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="380" cy="130" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="395" cy="90" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="405" cy="160" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="415" cy="70" r="3.5" fill="#9b59b6" opacity="0.7"/>
<circle cx="425" cy="120" r="3.5" fill="#9b59b6" opacity="0.7"/>
<!-- Negative Correlation -->
<text x="590" y="20" fill="#e74c3c" font-size="13" font-weight="bold" text-anchor="middle">Negative (r ≈ -0.9)</text>
<rect x="500" y="30" width="180" height="180" fill="none" stroke="#ccc" stroke-width="1" rx="3"/>
<line x1="510" y1="200" x2="670" y2="200" stroke="#999" stroke-width="1"/>
<line x1="510" y1="200" x2="510" y2="40" stroke="#999" stroke-width="1"/>
<!-- points trending down -->
<circle cx="525" cy="50" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="535" cy="60" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="550" cy="75" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="565" cy="90" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="575" cy="105" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="590" cy="118" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="605" cy="130" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="615" cy="145" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="630" cy="158" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="645" cy="172" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="655" cy="180" r="3.5" fill="#e74c3c" opacity="0.7"/>
<circle cx="665" cy="190" r="3.5" fill="#e74c3c" opacity="0.7"/>
<!-- trend line -->
<line x1="520" y1="45" x2="670" y2="195" stroke="#e74c3c" stroke-width="1.5" stroke-dasharray="4,2"/>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

+71
View File
@@ -0,0 +1,71 @@
<svg width="700" height="320" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="25" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Multiplication Rule: 3 shirts × 4 pants = 12 outfits</text>
<!-- Shirt column -->
<text x="100" y="55" fill="#666" font-size="12" text-anchor="middle">Shirts</text>
<rect x="60" y="65" width="80" height="30" rx="4" fill="#e74c3c" opacity="0.8"/>
<text x="100" y="85" fill="white" font-size="11" text-anchor="middle">S₁ (red)</text>
<rect x="60" y="110" width="80" height="30" rx="4" fill="#3498db" opacity="0.8"/>
<text x="100" y="130" fill="white" font-size="11" text-anchor="middle">S₂ (blue)</text>
<rect x="60" y="155" width="80" height="30" rx="4" fill="#27ae60" opacity="0.8"/>
<text x="100" y="175" fill="white" font-size="11" text-anchor="middle">S₃ (green)</text>
<!-- Pants column -->
<text x="300" y="55" fill="#666" font-size="12" text-anchor="middle">Pants</text>
<rect x="260" y="65" width="80" height="30" rx="4" fill="#8e44ad" opacity="0.7"/>
<text x="300" y="85" fill="white" font-size="11" text-anchor="middle">P₁</text>
<rect x="260" y="105" width="80" height="30" rx="4" fill="#8e44ad" opacity="0.7"/>
<text x="300" y="125" fill="white" font-size="11" text-anchor="middle">P₂</text>
<rect x="260" y="145" width="80" height="30" rx="4" fill="#8e44ad" opacity="0.7"/>
<text x="300" y="165" fill="white" font-size="11" text-anchor="middle">P₃</text>
<rect x="260" y="185" width="80" height="30" rx="4" fill="#8e44ad" opacity="0.7"/>
<text x="300" y="205" fill="white" font-size="11" text-anchor="middle">P₄</text>
<!-- Branches from S1 -->
<line x1="140" y1="80" x2="260" y2="80" stroke="#e74c3c" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="80" x2="260" y2="120" stroke="#e74c3c" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="80" x2="260" y2="160" stroke="#e74c3c" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="80" x2="260" y2="200" stroke="#e74c3c" stroke-width="1.2" opacity="0.5"/>
<!-- Branches from S2 -->
<line x1="140" y1="125" x2="260" y2="80" stroke="#3498db" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="125" x2="260" y2="120" stroke="#3498db" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="125" x2="260" y2="160" stroke="#3498db" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="125" x2="260" y2="200" stroke="#3498db" stroke-width="1.2" opacity="0.5"/>
<!-- Branches from S3 -->
<line x1="140" y1="170" x2="260" y2="80" stroke="#27ae60" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="170" x2="260" y2="120" stroke="#27ae60" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="170" x2="260" y2="160" stroke="#27ae60" stroke-width="1.2" opacity="0.5"/>
<line x1="140" y1="170" x2="260" y2="200" stroke="#27ae60" stroke-width="1.2" opacity="0.5"/>
<!-- Outcomes grid -->
<text x="530" y="55" fill="#666" font-size="12" text-anchor="middle">All 12 outcomes</text>
<text x="460" y="80" fill="#e74c3c" font-size="10">(S₁,P₁)</text>
<text x="530" y="80" fill="#e74c3c" font-size="10">(S₁,P₂)</text>
<text x="600" y="80" fill="#e74c3c" font-size="10">(S₁,P₃)</text>
<text x="460" y="100" fill="#e74c3c" font-size="10">(S₁,P₄)</text>
<text x="460" y="130" fill="#3498db" font-size="10">(S₂,P₁)</text>
<text x="530" y="130" fill="#3498db" font-size="10">(S₂,P₂)</text>
<text x="600" y="130" fill="#3498db" font-size="10">(S₂,P₃)</text>
<text x="460" y="150" fill="#3498db" font-size="10">(S₂,P₄)</text>
<text x="460" y="180" fill="#27ae60" font-size="10">(S₃,P₁)</text>
<text x="530" y="180" fill="#27ae60" font-size="10">(S₃,P₂)</text>
<text x="600" y="180" fill="#27ae60" font-size="10">(S₃,P₃)</text>
<text x="460" y="200" fill="#27ae60" font-size="10">(S₃,P₄)</text>
<!-- Arrow -->
<line x1="350" y1="140" x2="430" y2="140" stroke="#333" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<defs>
<marker id="arrowhead" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#333"/>
</marker>
</defs>
<!-- Bottom note -->
<text x="350" y="260" fill="#333" font-size="12" text-anchor="middle">Each shirt pairs with every pant: 3 × 4 = 12 total combinations</text>
<text x="350" y="280" fill="#666" font-size="11" text-anchor="middle">This is the multiplication rule: if choice A has m options and choice B has n options,</text>
<text x="350" y="298" fill="#666" font-size="11" text-anchor="middle">the total number of combined outcomes is m × n.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

+62
View File
@@ -0,0 +1,62 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 240" width="750" height="240">
<text x="375" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">CPU Pipeline: Overlapping Instruction Execution</text>
<!-- Time axis -->
<text x="130" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">Cycle 1</text>
<text x="240" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">Cycle 2</text>
<text x="350" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">Cycle 3</text>
<text x="460" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">Cycle 4</text>
<text x="570" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">Cycle 5</text>
<text x="680" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#666">Cycle 6</text>
<!-- Instruction labels -->
<text x="30" y="80" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Instr 1</text>
<text x="30" y="115" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Instr 2</text>
<text x="30" y="150" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Instr 3</text>
<text x="30" y="185" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Instr 4</text>
<!-- Pipeline stages: F=Fetch D=Decode E=Execute M=Memory W=Writeback -->
<!-- Instruction 1 -->
<rect x="85" y="62" width="90" height="26" rx="4" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="1"/>
<text x="130" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Fetch</text>
<rect x="195" y="62" width="90" height="26" rx="4" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="240" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Decode</text>
<rect x="305" y="62" width="90" height="26" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1"/>
<text x="350" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Execute</text>
<rect x="415" y="62" width="90" height="26" rx="4" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<text x="460" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Memory</text>
<rect x="525" y="62" width="90" height="26" rx="4" fill="#9b59b6" fill-opacity="0.25" stroke="#9b59b6" stroke-width="1"/>
<text x="570" y="80" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">Write</text>
<!-- Instruction 2 (shifted by 1 cycle) -->
<rect x="195" y="97" width="90" height="26" rx="4" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="1"/>
<text x="240" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Fetch</text>
<rect x="305" y="97" width="90" height="26" rx="4" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="350" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Decode</text>
<rect x="415" y="97" width="90" height="26" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1"/>
<text x="460" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Execute</text>
<rect x="525" y="97" width="90" height="26" rx="4" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<text x="570" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Memory</text>
<rect x="635" y="97" width="90" height="26" rx="4" fill="#9b59b6" fill-opacity="0.25" stroke="#9b59b6" stroke-width="1"/>
<text x="680" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">Write</text>
<!-- Instruction 3 -->
<rect x="305" y="132" width="90" height="26" rx="4" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="1"/>
<text x="350" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Fetch</text>
<rect x="415" y="132" width="90" height="26" rx="4" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="460" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Decode</text>
<rect x="525" y="132" width="90" height="26" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1"/>
<text x="570" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Execute</text>
<rect x="635" y="132" width="90" height="26" rx="4" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<text x="680" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Memory</text>
<!-- Instruction 4 -->
<rect x="415" y="167" width="90" height="26" rx="4" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="1"/>
<text x="460" y="185" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Fetch</text>
<rect x="525" y="167" width="90" height="26" rx="4" fill="#f39c12" fill-opacity="0.25" stroke="#f39c12" stroke-width="1"/>
<text x="570" y="185" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Decode</text>
<rect x="635" y="167" width="90" height="26" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1"/>
<text x="680" y="185" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Execute</text>
<text x="375" y="225" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Each cycle, a new instruction enters the pipeline — throughput approaches 1 instruction/cycle</text>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

+51
View File
@@ -0,0 +1,51 @@
<svg width="420" height="180" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="cp-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#ccc"/>
</marker>
</defs>
<text x="210" y="14" text-anchor="middle" fill="#333" font-size="12" font-weight="bold">Three kinds of critical point (f'(x) = 0)</text>
<!-- === Local Maximum === -->
<line x1="15" y1="140" x2="125" y2="140" stroke="#ccc" stroke-width="0.8" marker-end="url(#cp-arr)"/>
<line x1="15" y1="140" x2="15" y2="28" stroke="#ccc" stroke-width="0.8" marker-end="url(#cp-arr)"/>
<!-- hill curve -->
<path d="M 20,120 Q 45,55 70,40 Q 95,55 120,120" fill="none" stroke="#e74c3c" stroke-width="2.5"/>
<!-- flat tangent -->
<line x1="45" y1="40" x2="95" y2="40" stroke="#e74c3c" stroke-width="1.5" stroke-dasharray="4"/>
<circle cx="70" cy="40" r="4" fill="#e74c3c"/>
<text x="70" y="155" text-anchor="middle" fill="#e74c3c" font-size="10" font-weight="bold">local max</text>
<text x="70" y="168" text-anchor="middle" fill="#e74c3c" font-size="9">f'' &lt; 0 (curves down)</text>
<!-- === Local Minimum === -->
<line x1="155" y1="140" x2="265" y2="140" stroke="#ccc" stroke-width="0.8" marker-end="url(#cp-arr)"/>
<line x1="155" y1="140" x2="155" y2="28" stroke="#ccc" stroke-width="0.8" marker-end="url(#cp-arr)"/>
<!-- bowl curve -->
<path d="M 160,50 Q 185,125 210,130 Q 235,125 260,50" fill="none" stroke="#3498db" stroke-width="2.5"/>
<!-- flat tangent -->
<line x1="185" y1="130" x2="235" y2="130" stroke="#3498db" stroke-width="1.5" stroke-dasharray="4"/>
<circle cx="210" cy="130" r="4" fill="#3498db"/>
<text x="210" y="155" text-anchor="middle" fill="#3498db" font-size="10" font-weight="bold">local min</text>
<text x="210" y="168" text-anchor="middle" fill="#3498db" font-size="9">f'' &gt; 0 (curves up)</text>
<!-- === Inflection Point === -->
<line x1="295" y1="140" x2="405" y2="140" stroke="#ccc" stroke-width="0.8" marker-end="url(#cp-arr)"/>
<line x1="295" y1="140" x2="295" y2="28" stroke="#ccc" stroke-width="0.8" marker-end="url(#cp-arr)"/>
<!-- S-curve (x³ shape) -->
<path d="M 300,45 Q 325,55 350,85 Q 375,115 400,125" fill="none" stroke="#27ae60" stroke-width="2.5"/>
<!-- flat tangent at inflection -->
<line x1="325" y1="85" x2="375" y2="85" stroke="#27ae60" stroke-width="1.5" stroke-dasharray="4"/>
<circle cx="350" cy="85" r="4" fill="#27ae60"/>
<text x="350" y="155" text-anchor="middle" fill="#27ae60" font-size="10" font-weight="bold">inflection</text>
<text x="350" y="168" text-anchor="middle" fill="#27ae60" font-size="9">f'' = 0 (flat but no turn)</text>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+68
View File
@@ -0,0 +1,68 @@
<svg width="720" height="220" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="ocr-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">CRNN Text Recognition Pipeline</text>
<!-- Input image -->
<rect x="20" y="50" width="100" height="50" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1.5"/>
<text x="70" y="70" fill="#333" font-size="14" text-anchor="middle" font-style="italic" font-weight="bold">Hello</text>
<text x="70" y="86" fill="#999" font-size="8" text-anchor="middle">(text image)</text>
<text x="70" y="118" fill="#666" font-size="9" text-anchor="middle" font-weight="bold">Input</text>
<line x1="120" y1="75" x2="150" y2="75" stroke="#555" stroke-width="1.5" marker-end="url(#ocr-arrow)"/>
<!-- CNN feature extractor -->
<rect x="155" y="40" width="100" height="70" rx="8" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="2"/>
<text x="205" y="68" fill="#3498db" font-size="11" text-anchor="middle" font-weight="bold">CNN</text>
<text x="205" y="83" fill="#3498db" font-size="9" text-anchor="middle">Extract visual</text>
<text x="205" y="95" fill="#3498db" font-size="9" text-anchor="middle">features</text>
<text x="205" y="128" fill="#3498db" font-size="9" text-anchor="middle">Spatial features</text>
<line x1="255" y1="75" x2="285" y2="75" stroke="#555" stroke-width="1.5" marker-end="url(#ocr-arrow)"/>
<!-- Feature columns -->
<g>
<rect x="290" y="45" width="8" height="60" rx="2" fill="#f39c12" opacity="0.3" stroke="#f39c12" stroke-width="1"/>
<rect x="302" y="45" width="8" height="60" rx="2" fill="#f39c12" opacity="0.3" stroke="#f39c12" stroke-width="1"/>
<rect x="314" y="45" width="8" height="60" rx="2" fill="#f39c12" opacity="0.3" stroke="#f39c12" stroke-width="1"/>
<rect x="326" y="45" width="8" height="60" rx="2" fill="#f39c12" opacity="0.3" stroke="#f39c12" stroke-width="1"/>
<rect x="338" y="45" width="8" height="60" rx="2" fill="#f39c12" opacity="0.3" stroke="#f39c12" stroke-width="1"/>
<rect x="350" y="45" width="8" height="60" rx="2" fill="#f39c12" opacity="0.3" stroke="#f39c12" stroke-width="1"/>
<rect x="362" y="45" width="8" height="60" rx="2" fill="#f39c12" opacity="0.3" stroke="#f39c12" stroke-width="1"/>
</g>
<text x="330" y="128" fill="#f39c12" font-size="9" text-anchor="middle">Column slices</text>
<line x1="375" y1="75" x2="405" y2="75" stroke="#555" stroke-width="1.5" marker-end="url(#ocr-arrow)"/>
<!-- BiLSTM -->
<rect x="410" y="40" width="100" height="70" rx="8" fill="#e74c3c" opacity="0.12" stroke="#e74c3c" stroke-width="2"/>
<text x="460" y="65" fill="#e74c3c" font-size="11" text-anchor="middle" font-weight="bold">BiLSTM</text>
<text x="460" y="80" fill="#e74c3c" font-size="9" text-anchor="middle">Sequence</text>
<text x="460" y="92" fill="#e74c3c" font-size="9" text-anchor="middle">modelling</text>
<text x="460" y="128" fill="#e74c3c" font-size="9" text-anchor="middle">Context-aware</text>
<line x1="510" y1="75" x2="540" y2="75" stroke="#555" stroke-width="1.5" marker-end="url(#ocr-arrow)"/>
<!-- CTC Decoder -->
<rect x="545" y="40" width="80" height="70" rx="8" fill="#9b59b6" opacity="0.12" stroke="#9b59b6" stroke-width="2"/>
<text x="585" y="65" fill="#9b59b6" font-size="11" text-anchor="middle" font-weight="bold">CTC</text>
<text x="585" y="80" fill="#9b59b6" font-size="9" text-anchor="middle">Decode</text>
<text x="585" y="92" fill="#9b59b6" font-size="9" text-anchor="middle">alignment</text>
<text x="585" y="128" fill="#9b59b6" font-size="9" text-anchor="middle">No segmentation</text>
<line x1="625" y1="75" x2="650" y2="75" stroke="#555" stroke-width="1.5" marker-end="url(#ocr-arrow)"/>
<!-- Output text -->
<rect x="655" y="50" width="55" height="50" rx="6" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
<text x="682" y="80" fill="#27ae60" font-size="14" text-anchor="middle" font-weight="bold">Hello</text>
<text x="682" y="118" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">Output</text>
<!-- CTC detail -->
<rect x="140" y="148" width="440" height="55" rx="8" fill="#f5f5f5" stroke="#ddd" stroke-width="1"/>
<text x="360" y="167" fill="#9b59b6" font-size="10" text-anchor="middle" font-weight="bold">CTC: Connectionist Temporal Classification</text>
<text x="360" y="183" fill="#555" font-size="10" text-anchor="middle">Handles many-to-one alignment: "HH-ee-ll-ll-oo" → "Hello"</text>
<text x="360" y="197" fill="#555" font-size="9" text-anchor="middle">No need for pre-segmented training data. Blank token (–) separates repeated characters.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

@@ -0,0 +1,92 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 350" width="700" height="350">
<defs>
<marker id="arrow-red" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#e74c3c"/>
</marker>
<marker id="arrow-blue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3498db"/>
</marker>
<marker id="arrow-green" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#27ae60"/>
</marker>
<marker id="arrow-orange" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#f39c12"/>
</marker>
<marker id="arrow-purple" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#9b59b6"/>
</marker>
<marker id="arrow-teal" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#1abc9c"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="24" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Cross-Modal Generation Pathways</text>
<!-- Center hub -->
<rect x="275" y="145" width="150" height="50" rx="8" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="350" y="175" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#333">Generation Model</text>
<!-- Text (top, red) -->
<rect x="295" y="42" width="110" height="40" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="350" y="58" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">Text</text>
<text x="350" y="72" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">"a sunset over ocean"</text>
<!-- Image (right, blue) -->
<rect x="520" y="150" width="110" height="40" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="575" y="166" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">Image</text>
<text x="575" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">pixels / latents</text>
<!-- Audio (bottom, green) -->
<rect x="295" y="260" width="110" height="40" rx="8" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="350" y="276" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">Audio</text>
<text x="350" y="290" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">waveform / spectrogram</text>
<!-- Video (left, orange) -->
<rect x="70" y="150" width="110" height="40" rx="8" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="125" y="166" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#f39c12">Video</text>
<text x="125" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">frame sequence</text>
<!-- Arrows: Text <-> Hub (top) -->
<line x1="335" y1="82" x2="325" y2="145" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#arrow-red)"/>
<line x1="375" y1="145" x2="365" y2="82" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#arrow-red)"/>
<!-- Arrows: Image <-> Hub (right) -->
<line x1="425" y1="160" x2="520" y2="163" stroke="#3498db" stroke-width="1.2" marker-end="url(#arrow-blue)"/>
<line x1="520" y1="177" x2="425" y2="180" stroke="#3498db" stroke-width="1.2" marker-end="url(#arrow-blue)"/>
<!-- Arrows: Audio <-> Hub (bottom) -->
<line x1="335" y1="195" x2="325" y2="260" stroke="#27ae60" stroke-width="1.2" marker-end="url(#arrow-green)"/>
<line x1="375" y1="260" x2="365" y2="195" stroke="#27ae60" stroke-width="1.2" marker-end="url(#arrow-green)"/>
<!-- Arrows: Video <-> Hub (left) -->
<line x1="275" y1="163" x2="180" y2="160" stroke="#f39c12" stroke-width="1.2" marker-end="url(#arrow-orange)"/>
<line x1="180" y1="180" x2="275" y2="177" stroke="#f39c12" stroke-width="1.2" marker-end="url(#arrow-orange)"/>
<!-- Diagonal arrows: Text -> Image -->
<path d="M400,62 Q490,70 525,150" fill="none" stroke="#9b59b6" stroke-width="1" stroke-dasharray="4,3" marker-end="url(#arrow-purple)"/>
<text x="478" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">text-to-image</text>
<!-- Diagonal arrows: Text -> Audio -->
<path d="M300,72 Q220,160 300,265" fill="none" stroke="#1abc9c" stroke-width="1" stroke-dasharray="4,3" marker-end="url(#arrow-teal)"/>
<text x="230" y="170" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#1abc9c">text-to-audio</text>
<!-- Diagonal arrows: Text -> Video -->
<path d="M300,58 Q200,50 140,150" fill="none" stroke="#f39c12" stroke-width="1" stroke-dasharray="4,3" marker-end="url(#arrow-orange)"/>
<text x="195" y="82" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">text-to-video</text>
<!-- Diagonal arrows: Image -> Text -->
<path d="M575,150 Q560,90 405,55" fill="none" stroke="#e74c3c" stroke-width="1" stroke-dasharray="4,3" marker-end="url(#arrow-red)"/>
<text x="520" y="82" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">image-to-text</text>
<!-- Diagonal arrows: Image -> Video -->
<path d="M520,180 Q400,250 180,185" fill="none" stroke="#f39c12" stroke-width="1" stroke-dasharray="4,3" marker-end="url(#arrow-orange)"/>
<text x="380" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">image-to-video</text>
<!-- Diagonal arrows: Audio -> Text -->
<path d="M400,270 Q490,240 560,190" fill="none" stroke="#e74c3c" stroke-width="1" stroke-dasharray="4,3" marker-end="url(#arrow-red)"/>
<text x="510" y="250" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">audio-to-text</text>
<!-- Legend -->
<text x="350" y="330" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">Solid lines = primary pathways | Dashed lines = direct cross-modal translation</text>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

+121
View File
@@ -0,0 +1,121 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 300" width="700" height="300">
<defs>
<marker id="arrow2" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#333"/>
</marker>
<marker id="arrow2blue" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#3498db"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">CTC Alignment with Blank Tokens</text>
<!-- Row label: Input Frames -->
<text x="50" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Input</text>
<text x="50" y="74" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Frames</text>
<!-- Input frame boxes (t1-t8) -->
<rect x="110" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="137" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t1</text>
<rect x="175" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="202" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t2</text>
<rect x="240" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="267" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t3</text>
<rect x="305" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="332" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t4</text>
<rect x="370" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="397" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t5</text>
<rect x="435" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="462" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t6</text>
<rect x="500" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="527" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t7</text>
<rect x="565" y="48" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.10" stroke="#3498db" stroke-width="1.2"/>
<text x="592" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">t8</text>
<!-- Arrows from input to CTC output -->
<line x1="137" y1="82" x2="137" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<line x1="202" y1="82" x2="202" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<line x1="267" y1="82" x2="267" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<line x1="332" y1="82" x2="332" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<line x1="397" y1="82" x2="397" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<line x1="462" y1="82" x2="462" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<line x1="527" y1="82" x2="527" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<line x1="592" y1="82" x2="592" y2="108" stroke="#999" stroke-width="1" marker-end="url(#arrow2)"/>
<!-- Row label: CTC Output -->
<text x="50" y="125" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">CTC</text>
<text x="50" y="137" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Output</text>
<!-- CTC output symbols: blank = grey, real = blue -->
<!-- t1: blank -->
<rect x="110" y="112" width="55" height="32" rx="4" fill="#999" fill-opacity="0.15" stroke="#999" stroke-width="1.2"/>
<text x="137" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#999">&mdash;</text>
<!-- t2: h -->
<rect x="175" y="112" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="202" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">h</text>
<!-- t3: h (duplicate) -->
<rect x="240" y="112" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="267" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">h</text>
<!-- t4: blank -->
<rect x="305" y="112" width="55" height="32" rx="4" fill="#999" fill-opacity="0.15" stroke="#999" stroke-width="1.2"/>
<text x="332" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#999">&mdash;</text>
<!-- t5: i -->
<rect x="370" y="112" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="397" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">i</text>
<!-- t6: blank -->
<rect x="435" y="112" width="55" height="32" rx="4" fill="#999" fill-opacity="0.15" stroke="#999" stroke-width="1.2"/>
<text x="462" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#999">&mdash;</text>
<!-- t7: blank -->
<rect x="500" y="112" width="55" height="32" rx="4" fill="#999" fill-opacity="0.15" stroke="#999" stroke-width="1.2"/>
<text x="527" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#999">&mdash;</text>
<!-- t8: ! -->
<rect x="565" y="112" width="55" height="32" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="592" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">!</text>
<!-- "collapse" label -->
<text x="350" y="166" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c" font-weight="bold">collapse duplicates &amp; remove blanks</text>
<!-- Arrows converging down to collapsed output -->
<line x1="202" y1="146" x2="310" y2="190" stroke="#e74c3c" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="267" y1="146" x2="310" y2="190" stroke="#e74c3c" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="397" y1="146" x2="355" y2="190" stroke="#e74c3c" stroke-width="1" stroke-dasharray="3,2"/>
<line x1="592" y1="146" x2="395" y2="190" stroke="#e74c3c" stroke-width="1" stroke-dasharray="3,2"/>
<!-- Row label: Final Output -->
<text x="50" y="207" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Final</text>
<text x="50" y="219" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Output</text>
<!-- Collapsed output: "hi!" -->
<rect x="285" y="188" width="130" height="36" rx="8" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="2"/>
<text x="350" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="16" font-weight="bold" fill="#27ae60">h i !</text>
<!-- Many-to-one annotation -->
<text x="530" y="185" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">Many CTC paths</text>
<text x="530" y="196" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">map to same output</text>
<rect x="470" y="175" width="120" height="28" rx="4" fill="none" stroke="#9b59b6" stroke-width="1" stroke-dasharray="3,2"/>
<!-- Legend -->
<rect x="110" y="232" width="14" height="10" rx="2" fill="#999" fill-opacity="0.2" stroke="#999" stroke-width="1"/>
<text x="130" y="241" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#666">= blank token</text>
<rect x="200" y="232" width="14" height="10" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="1"/>
<text x="220" y="241" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#666">= real character</text>
<!-- Note box -->
<rect x="40" y="255" width="620" height="32" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="275" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#333">CTC allows the model to output 'blank' between characters -- no forced alignment needed.</text>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

+98
View File
@@ -0,0 +1,98 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 280" width="800" height="280">
<defs>
<marker id="arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#333"/>
</marker>
<marker id="arr-purple" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#9b59b6"/>
</marker>
<marker id="arr-blue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3498db"/>
</marker>
</defs>
<!-- Title -->
<text x="400" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">DALL-E: Autoregressive Image Generation</text>
<!-- Text tokens (red squares) -->
<text x="45" y="58" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Text Tokens</text>
<rect x="15" y="66" width="28" height="28" rx="4" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="29" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">a</text>
<rect x="47" y="66" width="28" height="28" rx="4" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="61" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">cat</text>
<rect x="79" y="66" width="28" height="28" rx="4" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="93" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">on</text>
<rect x="111" y="66" width="28" height="28" rx="4" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="125" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">mat</text>
<!-- Image tokens (blue squares) -->
<text x="205" y="58" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Image Tokens</text>
<rect x="155" y="66" width="28" height="28" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="169" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">42</text>
<rect x="187" y="66" width="28" height="28" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="201" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">17</text>
<rect x="219" y="66" width="28" height="28" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="233" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">91</text>
<rect x="251" y="66" width="28" height="28" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="265" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">...</text>
<rect x="283" y="66" width="28" height="28" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="297" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">?</text>
<!-- Concatenation bracket -->
<text x="165" y="110" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">concatenated sequence</text>
<line x1="15" y1="100" x2="310" y2="100" stroke="#ccc" stroke-width="1" stroke-dasharray="3,2"/>
<!-- Arrow down to transformer -->
<line x1="165" y1="118" x2="165" y2="138" stroke="#333" stroke-width="1.2" marker-end="url(#arr)"/>
<!-- Transformer Decoder -->
<rect x="70" y="140" width="190" height="55" rx="8" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="165" y="163" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#9b59b6">Transformer Decoder</text>
<text x="165" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">12B parameters, causal attention</text>
<!-- Autoregressive arrow (curved, looping) -->
<path d="M260,167 C290,167 290,130 310,100 C320,85 310,75 297,80" fill="none" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#arr-purple)"/>
<text x="318" y="130" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">predict next</text>
<text x="318" y="140" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">image token</text>
<!-- Arrow from transformer to predicted tokens -->
<line x1="165" y1="195" x2="165" y2="215" stroke="#333" stroke-width="1.2" marker-end="url(#arr)"/>
<!-- Predicted image tokens row -->
<text x="165" y="233" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Predicted image token sequence (1024 tokens)</text>
<!-- Predicted tokens -->
<rect x="70" y="240" width="22" height="22" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<rect x="96" y="240" width="22" height="22" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<rect x="122" y="240" width="22" height="22" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<rect x="148" y="240" width="22" height="22" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<rect x="174" y="240" width="22" height="22" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<rect x="200" y="240" width="22" height="22" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<rect x="226" y="240" width="22" height="22" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<text x="260" y="255" text-anchor="start" font-family="Arial, sans-serif" font-size="10" fill="#3498db">...</text>
<!-- Arrow to dVAE Decoder -->
<line x1="280" y1="251" x2="410" y2="251" stroke="#333" stroke-width="1.2" marker-end="url(#arr)"/>
<!-- dVAE Decoder -->
<rect x="420" y="125" width="140" height="50" rx="8" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="490" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">dVAE Decoder</text>
<text x="490" y="163" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">8192-vocab codebook</text>
<!-- Arrow connecting predicted tokens to dVAE -->
<line x1="310" y1="251" x2="420" y2="160" stroke="#333" stroke-width="1.2" marker-end="url(#arr)"/>
<!-- Arrow from dVAE to image -->
<line x1="560" y1="150" x2="610" y2="150" stroke="#333" stroke-width="1.2" marker-end="url(#arr)"/>
<!-- Output image placeholder -->
<rect x="620" y="100" width="100" height="100" rx="8" fill="#3498db" fill-opacity="0.08" stroke="#3498db" stroke-width="1.5"/>
<!-- Simple cat silhouette hint -->
<text x="670" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#3498db">Generated</text>
<text x="670" y="158" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#3498db">Image</text>
<text x="670" y="175" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">256 x 256</text>
<!-- Stage labels at bottom -->
<text x="165" y="275" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">Stage 1: Autoregressive token prediction</text>
<text x="560" y="275" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">Stage 2: Token-to-pixel decoding</text>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

+88
View File
@@ -0,0 +1,88 @@
<svg width="700" height="320" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Data Parallelism vs Model Parallelism</text>
<!-- Divider -->
<line x1="350" y1="32" x2="350" y2="310" stroke="#ccc" stroke-width="1" stroke-dasharray="4,4"/>
<!-- === DATA PARALLELISM (left) === -->
<text x="175" y="50" fill="#3498db" font-size="13" font-weight="bold" text-anchor="middle">Data Parallelism</text>
<!-- Full model copies -->
<rect x="55" y="70" width="70" height="60" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="90" y="95" fill="#3498db" font-size="9" text-anchor="middle">Full</text>
<text x="90" y="108" fill="#3498db" font-size="9" text-anchor="middle">Model</text>
<rect x="140" y="70" width="70" height="60" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="175" y="95" fill="#3498db" font-size="9" text-anchor="middle">Full</text>
<text x="175" y="108" fill="#3498db" font-size="9" text-anchor="middle">Model</text>
<rect x="225" y="70" width="70" height="60" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="260" y="95" fill="#3498db" font-size="9" text-anchor="middle">Full</text>
<text x="260" y="108" fill="#3498db" font-size="9" text-anchor="middle">Model</text>
<!-- GPU labels -->
<text x="90" y="66" fill="#666" font-size="8" text-anchor="middle">GPU 0</text>
<text x="175" y="66" fill="#666" font-size="8" text-anchor="middle">GPU 1</text>
<text x="260" y="66" fill="#666" font-size="8" text-anchor="middle">GPU 2</text>
<!-- Data splits -->
<rect x="55" y="145" width="70" height="28" rx="4" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="90" y="164" fill="#27ae60" font-size="9" text-anchor="middle">Data 1/3</text>
<rect x="140" y="145" width="70" height="28" rx="4" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="175" y="164" fill="#27ae60" font-size="9" text-anchor="middle">Data 2/3</text>
<rect x="225" y="145" width="70" height="28" rx="4" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="260" y="164" fill="#27ae60" font-size="9" text-anchor="middle">Data 3/3</text>
<!-- Gradient sync -->
<line x1="90" y1="185" x2="90" y2="205" stroke="#e74c3c" stroke-width="1"/>
<line x1="175" y1="185" x2="175" y2="205" stroke="#e74c3c" stroke-width="1"/>
<line x1="260" y1="185" x2="260" y2="205" stroke="#e74c3c" stroke-width="1"/>
<line x1="80" y1="205" x2="270" y2="205" stroke="#e74c3c" stroke-width="1.5"/>
<text x="175" y="222" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">All-Reduce gradients</text>
<text x="175" y="248" fill="#666" font-size="9" text-anchor="middle">Same model on each GPU</text>
<text x="175" y="262" fill="#666" font-size="9" text-anchor="middle">Different data on each GPU</text>
<text x="175" y="276" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">Scales batch size</text>
<!-- === MODEL PARALLELISM (right) === -->
<text x="525" y="50" fill="#e74c3c" font-size="13" font-weight="bold" text-anchor="middle">Model Parallelism</text>
<!-- Model shards -->
<rect x="395" y="70" width="70" height="60" rx="4" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<text x="430" y="92" fill="#e74c3c" font-size="9" text-anchor="middle">Layers</text>
<text x="430" y="105" fill="#e74c3c" font-size="9" text-anchor="middle">1-4</text>
<rect x="480" y="70" width="70" height="60" rx="4" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1.5"/>
<text x="515" y="92" fill="#e74c3c" font-size="9" text-anchor="middle">Layers</text>
<text x="515" y="105" fill="#e74c3c" font-size="9" text-anchor="middle">5-8</text>
<rect x="565" y="70" width="70" height="60" rx="4" fill="#e74c3c" opacity="0.25" stroke="#e74c3c" stroke-width="1.5"/>
<text x="600" y="92" fill="#e74c3c" font-size="9" text-anchor="middle">Layers</text>
<text x="600" y="105" fill="#e74c3c" font-size="9" text-anchor="middle">9-12</text>
<!-- GPU labels -->
<text x="430" y="66" fill="#666" font-size="8" text-anchor="middle">GPU 0</text>
<text x="515" y="66" fill="#666" font-size="8" text-anchor="middle">GPU 1</text>
<text x="600" y="66" fill="#666" font-size="8" text-anchor="middle">GPU 2</text>
<!-- Same data -->
<rect x="440" y="145" width="160" height="28" rx="4" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1"/>
<text x="520" y="164" fill="#27ae60" font-size="9" text-anchor="middle">Full Data (same batch)</text>
<!-- Activation passing -->
<line x1="465" y1="130" x2="490" y2="130" stroke="#9b59b6" stroke-width="1.5"/>
<polygon points="490,127 497,130 490,133" fill="#9b59b6"/>
<line x1="550" y1="130" x2="575" y2="130" stroke="#9b59b6" stroke-width="1.5"/>
<polygon points="575,127 582,130 575,133" fill="#9b59b6"/>
<text x="525" y="145" fill="#9b59b6" font-size="8" text-anchor="middle">pass activations</text>
<text x="525" y="200" fill="#666" font-size="9" text-anchor="middle">Model split across GPUs</text>
<text x="525" y="214" fill="#666" font-size="9" text-anchor="middle">Same data on all GPUs</text>
<text x="525" y="228" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">Scales model size</text>
<!-- Comparison -->
<rect x="130" y="290" width="440" height="22" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="305" fill="#333" font-size="10" text-anchor="middle">Most large models use both: hybrid parallelism (data + tensor + pipeline)</text>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

+51
View File
@@ -0,0 +1,51 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 280" width="500" height="280">
<defs>
<marker id="dl-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#e74c3c"/>
</marker>
<marker id="dl-arr2" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#3498db"/>
</marker>
</defs>
<text x="250" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Deadlock: Circular Wait</text>
<!-- Thread A -->
<circle cx="130" cy="100" r="30" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="130" y="97" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">Thread</text>
<text x="130" y="112" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">A</text>
<!-- Thread B -->
<circle cx="370" cy="100" r="30" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="370" y="97" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e74c3c">Thread</text>
<text x="370" y="112" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e74c3c">B</text>
<!-- Lock 1 -->
<rect x="105" y="175" width="50" height="35" rx="6" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="2"/>
<text x="130" y="197" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">Lock 1</text>
<!-- Lock 2 -->
<rect x="345" y="175" width="50" height="35" rx="6" fill="#9b59b6" fill-opacity="0.2" stroke="#9b59b6" stroke-width="2"/>
<text x="370" y="197" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#9b59b6">Lock 2</text>
<!-- A holds Lock 1 -->
<line x1="130" y1="130" x2="130" y2="168" stroke="#3498db" stroke-width="2" marker-end="url(#dl-arr2)"/>
<text x="107" y="155" text-anchor="end" font-family="Arial, sans-serif" font-size="8" fill="#3498db">holds</text>
<!-- B holds Lock 2 -->
<line x1="370" y1="130" x2="370" y2="168" stroke="#e74c3c" stroke-width="2" marker-end="url(#dl-arr)"/>
<text x="393" y="155" text-anchor="start" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">holds</text>
<!-- A wants Lock 2 -->
<path d="M 160,100 C 220,70 310,70 340,100" fill="none" stroke="#3498db" stroke-width="2" stroke-dasharray="6,3" marker-end="url(#dl-arr2)"/>
<text x="250" y="65" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">A wants Lock 2</text>
<!-- B wants Lock 1 -->
<path d="M 340,110 C 280,140 200,140 160,110" fill="none" stroke="#e74c3c" stroke-width="2" stroke-dasharray="6,3" marker-end="url(#dl-arr)"/>
<text x="250" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">B wants Lock 1</text>
<!-- Deadlock label -->
<rect x="195" y="228" width="110" height="30" rx="8" fill="#e74c3c" fill-opacity="0.1" stroke="#e74c3c" stroke-width="1.5"/>
<text x="250" y="248" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">DEADLOCK</text>
<text x="250" y="275" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Neither thread can proceed — each waits for the other's lock</text>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

+61
View File
@@ -0,0 +1,61 @@
<svg width="700" height="320" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="dt-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="none" stroke="#555" stroke-width="1"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Decision Tree: Splitting on Features</text>
<!-- Root node -->
<rect x="265" y="38" width="170" height="36" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="350" y="62" fill="#333" font-size="12" font-weight="bold" text-anchor="middle">age &lt; 30?</text>
<!-- Left branch -->
<line x1="310" y1="74" x2="190" y2="120" stroke="#555" stroke-width="1.2" marker-end="url(#dt-arrow)"/>
<text x="238" y="95" fill="#27ae60" font-size="10" text-anchor="middle">yes</text>
<!-- Right branch -->
<line x1="390" y1="74" x2="510" y2="120" stroke="#555" stroke-width="1.2" marker-end="url(#dt-arrow)"/>
<text x="462" y="95" fill="#e74c3c" font-size="10" text-anchor="middle">no</text>
<!-- Left child node -->
<rect x="105" y="122" width="170" height="36" rx="6" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="190" y="146" fill="#333" font-size="12" font-weight="bold" text-anchor="middle">income &gt; 50k?</text>
<!-- Right child node -->
<rect x="425" y="122" width="170" height="36" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<text x="510" y="146" fill="#333" font-size="12" font-weight="bold" text-anchor="middle">student?</text>
<!-- Left-Left leaf -->
<line x1="150" y1="158" x2="95" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#dt-arrow)"/>
<text x="110" y="183" fill="#27ae60" font-size="10" text-anchor="middle">yes</text>
<rect x="40" y="202" width="110" height="32" rx="14" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1.5"/>
<text x="95" y="223" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Buy (85%)</text>
<!-- Left-Right leaf -->
<line x1="230" y1="158" x2="285" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#dt-arrow)"/>
<text x="270" y="183" fill="#e74c3c" font-size="10" text-anchor="middle">no</text>
<rect x="230" y="202" width="110" height="32" rx="14" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1.5"/>
<text x="285" y="223" fill="#e74c3c" font-size="11" font-weight="bold" text-anchor="middle">No Buy (70%)</text>
<!-- Right-Left leaf -->
<line x1="470" y1="158" x2="415" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#dt-arrow)"/>
<text x="430" y="183" fill="#27ae60" font-size="10" text-anchor="middle">yes</text>
<rect x="360" y="202" width="110" height="32" rx="14" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1.5"/>
<text x="415" y="223" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Buy (75%)</text>
<!-- Right-Right leaf -->
<line x1="550" y1="158" x2="605" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#dt-arrow)"/>
<text x="590" y="183" fill="#e74c3c" font-size="10" text-anchor="middle">no</text>
<rect x="550" y="202" width="110" height="32" rx="14" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1.5"/>
<text x="605" y="223" fill="#e74c3c" font-size="11" font-weight="bold" text-anchor="middle">No Buy (90%)</text>
<!-- Legend -->
<text x="130" y="270" fill="#666" font-size="10" text-anchor="middle">Internal nodes: feature tests</text>
<text x="350" y="270" fill="#666" font-size="10" text-anchor="middle">Branches: yes/no answers</text>
<text x="565" y="270" fill="#666" font-size="10" text-anchor="middle">Leaves: class predictions</text>
<!-- Gini note -->
<rect x="170" y="285" width="360" height="24" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="302" fill="#333" font-size="11" text-anchor="middle">Each split chosen to maximise information gain (reduce impurity)</text>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

+105
View File
@@ -0,0 +1,105 @@
<svg width="700" height="280" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="dl-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="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">DeepLab: Atrous Spatial Pyramid Pooling (ASPP)</text>
<!-- Left: Atrous convolution illustration -->
<text x="130" y="48" fill="#333" font-size="11" font-weight="bold" text-anchor="middle">Atrous (Dilated) Convolution</text>
<!-- Rate 1 (standard 3x3) -->
<text x="60" y="70" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">rate=1</text>
<g transform="translate(25, 75)">
<rect x="0" y="0" width="70" height="70" fill="#eee" stroke="#ccc" stroke-width="0.5"/>
<!-- 5x5 grid, centre 3x3 filled -->
<rect x="14" y="14" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
<rect x="28" y="14" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
<rect x="42" y="14" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
<rect x="14" y="28" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
<rect x="28" y="28" width="14" height="14" fill="#3498db" opacity="0.6" stroke="#3498db" stroke-width="1"/>
<rect x="42" y="28" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
<rect x="14" y="42" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
<rect x="28" y="42" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
<rect x="42" y="42" width="14" height="14" fill="#3498db" opacity="0.4" stroke="#3498db" stroke-width="1"/>
</g>
<text x="60" y="158" fill="#3498db" font-size="8" text-anchor="middle">RF: 3×3</text>
<!-- Rate 2 -->
<text x="170" y="70" fill="#e74c3c" font-size="9" text-anchor="middle" font-weight="bold">rate=2</text>
<g transform="translate(135, 75)">
<rect x="0" y="0" width="70" height="70" fill="#eee" stroke="#ccc" stroke-width="0.5"/>
<!-- Dilated: skip one -->
<rect x="0" y="0" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<rect x="28" y="0" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<rect x="56" y="0" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<rect x="0" y="28" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<rect x="28" y="28" width="14" height="14" fill="#e74c3c" opacity="0.6" stroke="#e74c3c" stroke-width="1"/>
<rect x="56" y="28" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<rect x="0" y="56" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<rect x="28" y="56" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
<rect x="56" y="56" width="14" height="14" fill="#e74c3c" opacity="0.4" stroke="#e74c3c" stroke-width="1"/>
</g>
<text x="170" y="158" fill="#e74c3c" font-size="8" text-anchor="middle">RF: 5×5, 9 params</text>
<!-- ASPP module (right side) -->
<text x="475" y="48" fill="#333" font-size="11" font-weight="bold" text-anchor="middle">ASPP Module</text>
<!-- Input feature map -->
<rect x="290" y="68" width="60" height="60" rx="3" fill="#ecf0f1" stroke="#999" stroke-width="1.5"/>
<text x="320" y="102" fill="#333" font-size="8" text-anchor="middle">Features</text>
<!-- Parallel branches -->
<!-- Branch 1: 1x1 conv -->
<line x1="350" y1="78" x2="395" y2="68" stroke="#555" stroke-width="1" marker-end="url(#dl-arrow)"/>
<rect x="400" y="55" width="70" height="25" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="435" y="72" fill="#3498db" font-size="8" text-anchor="middle" font-weight="bold">1×1 (r=1)</text>
<!-- Branch 2: 3x3 rate 6 -->
<line x1="350" y1="88" x2="395" y2="88" stroke="#555" stroke-width="1" marker-end="url(#dl-arrow)"/>
<rect x="400" y="82" width="70" height="25" rx="4" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.5"/>
<text x="435" y="99" fill="#e74c3c" font-size="8" text-anchor="middle" font-weight="bold">3×3 (r=6)</text>
<!-- Branch 3: 3x3 rate 12 -->
<line x1="350" y1="98" x2="395" y2="108" stroke="#555" stroke-width="1" marker-end="url(#dl-arrow)"/>
<rect x="400" y="109" width="70" height="25" rx="4" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="435" y="126" fill="#27ae60" font-size="8" text-anchor="middle" font-weight="bold">3×3 (r=12)</text>
<!-- Branch 4: 3x3 rate 18 -->
<line x1="350" y1="108" x2="395" y2="128" stroke="#555" stroke-width="1" marker-end="url(#dl-arrow)"/>
<rect x="400" y="136" width="70" height="25" rx="4" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="1.5"/>
<text x="435" y="153" fill="#f39c12" font-size="8" text-anchor="middle" font-weight="bold">3×3 (r=18)</text>
<!-- Branch 5: Global Average Pool -->
<line x1="350" y1="118" x2="395" y2="148" stroke="#555" stroke-width="1" marker-end="url(#dl-arrow)"/>
<rect x="400" y="163" width="70" height="25" rx="4" fill="#9b59b6" opacity="0.15" stroke="#9b59b6" stroke-width="1.5"/>
<text x="435" y="180" fill="#9b59b6" font-size="8" text-anchor="middle" font-weight="bold">GAP + 1×1</text>
<!-- All branches merge -->
<line x1="470" y1="68" x2="510" y2="120" stroke="#555" stroke-width="1"/>
<line x1="470" y1="95" x2="510" y2="120" stroke="#555" stroke-width="1"/>
<line x1="470" y1="122" x2="510" y2="120" stroke="#555" stroke-width="1"/>
<line x1="470" y1="149" x2="510" y2="120" stroke="#555" stroke-width="1"/>
<line x1="470" y1="176" x2="510" y2="120" stroke="#555" stroke-width="1"/>
<!-- Concat -->
<rect x="515" y="105" width="55" height="30" rx="4" fill="#333" opacity="0.08" stroke="#333" stroke-width="1.5"/>
<text x="543" y="124" fill="#333" font-size="8" text-anchor="middle" font-weight="bold">Concat</text>
<!-- 1x1 conv fusion -->
<line x1="570" y1="120" x2="595" y2="120" stroke="#555" stroke-width="1.2" marker-end="url(#dl-arrow)"/>
<rect x="600" y="105" width="55" height="30" rx="4" fill="#333" opacity="0.08" stroke="#333" stroke-width="1.5"/>
<text x="628" y="124" fill="#333" font-size="8" text-anchor="middle" font-weight="bold">1×1 conv</text>
<!-- Output -->
<line x1="655" y1="120" x2="680" y2="120" stroke="#555" stroke-width="1.2" marker-end="url(#dl-arrow)"/>
<text x="690" y="124" fill="#333" font-size="8" text-anchor="start">Out</text>
<!-- Bottom notes -->
<rect x="50" y="200" width="600" height="70" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="220" fill="#333" font-size="10" text-anchor="middle" font-weight="bold">How Atrous Convolution Works</text>
<text x="350" y="236" fill="#666" font-size="9" text-anchor="middle">Standard 3×3 filter with gaps of (rate−1) between elements. Rate r gives receptive field (2r+1)×(2r+1).</text>
<text x="350" y="252" fill="#666" font-size="9" text-anchor="middle">ASPP applies multiple rates in parallel to capture context at multiple scales — like Inception but with dilation.</text>
<text x="350" y="264" fill="#666" font-size="9" text-anchor="middle">Global average pooling branch captures image-level context (what's the overall scene?).</text>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

+65
View File
@@ -0,0 +1,65 @@
<svg width="700" height="250" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="dn-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="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">DenseNet: Dense Block with Feature Reuse</text>
<!-- Layer boxes -->
<rect x="40" y="60" width="80" height="40" rx="6" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="80" y="77" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">x₀</text>
<text x="80" y="91" fill="#3498db" font-size="8" text-anchor="middle">Input</text>
<rect x="180" y="60" width="80" height="40" rx="6" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="2"/>
<text x="220" y="77" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">H₁</text>
<text x="220" y="91" fill="#27ae60" font-size="8" text-anchor="middle">BN→ReLU→Conv</text>
<rect x="320" y="60" width="80" height="40" rx="6" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="360" y="77" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">H₂</text>
<text x="360" y="91" fill="#e74c3c" font-size="8" text-anchor="middle">BN→ReLU→Conv</text>
<rect x="460" y="60" width="80" height="40" rx="6" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="2"/>
<text x="500" y="77" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">H₃</text>
<text x="500" y="91" fill="#f39c12" font-size="8" text-anchor="middle">BN→ReLU→Conv</text>
<rect x="600" y="60" width="80" height="40" rx="6" fill="#9b59b6" opacity="0.15" stroke="#9b59b6" stroke-width="2"/>
<text x="640" y="77" fill="#9b59b6" font-size="10" text-anchor="middle" font-weight="bold">Output</text>
<text x="640" y="91" fill="#9b59b6" font-size="8" text-anchor="middle">[x₀,x₁,x₂,x₃]</text>
<!-- Direct forward arrows -->
<line x1="120" y1="80" x2="175" y2="80" stroke="#555" stroke-width="1.2" marker-end="url(#dn-arrow)"/>
<line x1="260" y1="80" x2="315" y2="80" stroke="#555" stroke-width="1.2" marker-end="url(#dn-arrow)"/>
<line x1="400" y1="80" x2="455" y2="80" stroke="#555" stroke-width="1.2" marker-end="url(#dn-arrow)"/>
<line x1="540" y1="80" x2="595" y2="80" stroke="#555" stroke-width="1.2" marker-end="url(#dn-arrow)"/>
<!-- Dense connections (skip connections) -->
<!-- x0 → H2 (skip over H1) -->
<path d="M 80 100 Q 80 125, 220 125 Q 360 125, 360 100" fill="none" stroke="#3498db" stroke-width="1.2" stroke-dasharray="4,2"/>
<polygon points="360,100 356,108 364,108" fill="#3498db"/>
<!-- x0 → H3 (skip over H1, H2) -->
<path d="M 80 100 Q 80 145, 290 145 Q 500 145, 500 100" fill="none" stroke="#3498db" stroke-width="1" stroke-dasharray="4,2"/>
<polygon points="500,100 496,108 504,108" fill="#3498db"/>
<!-- x0 → Output -->
<path d="M 80 100 Q 80 165, 360 165 Q 640 165, 640 100" fill="none" stroke="#3498db" stroke-width="1" stroke-dasharray="4,2"/>
<polygon points="640,100 636,108 644,108" fill="#3498db"/>
<!-- x1 → H3 -->
<path d="M 220 100 Q 220 130, 360 130 Q 500 130, 500 100" fill="none" stroke="#27ae60" stroke-width="1.2" stroke-dasharray="4,2"/>
<polygon points="500,100 496,108 504,108" fill="#27ae60"/>
<!-- x1 → Output -->
<path d="M 220 100 Q 220 155, 430 155 Q 640 155, 640 100" fill="none" stroke="#27ae60" stroke-width="1" stroke-dasharray="4,2"/>
<polygon points="640,100 636,108 644,108" fill="#27ae60"/>
<!-- x2 → Output -->
<path d="M 360 100 Q 360 135, 500 135 Q 640 135, 640 100" fill="none" stroke="#e74c3c" stroke-width="1.2" stroke-dasharray="4,2"/>
<polygon points="640,100 636,108 644,108" fill="#e74c3c"/>
<!-- Bottom note -->
<rect x="60" y="190" width="580" height="50" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="210" fill="#333" font-size="10" text-anchor="middle">Layer l receives all preceding feature maps: x_l = H_l([x₀, x₁, ..., x_{l-1}])</text>
<text x="350" y="228" fill="#666" font-size="9" text-anchor="middle">Each layer adds k new channels (growth rate k). Concatenation grows channels linearly, encouraging feature reuse.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

+43
View File
@@ -0,0 +1,43 @@
<svg width="700" height="240" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="dep-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#555"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Dependency Tree: "the cat sat on the mat"</text>
<!-- Words on baseline -->
<text x="100" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">the</text>
<text x="200" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">cat</text>
<text x="330" y="160" fill="#e74c3c" font-size="16" text-anchor="middle" font-weight="bold">sat</text>
<text x="430" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">on</text>
<text x="530" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">the</text>
<text x="620" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">mat</text>
<!-- ROOT marker -->
<text x="330" y="42" fill="#e74c3c" font-size="11" text-anchor="middle" font-weight="bold">ROOT</text>
<line x1="330" y1="46" x2="330" y2="140" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#dep-arrow)"/>
<!-- sat → cat (nsubj) - arc above -->
<path d="M 320,140 Q 260,75 210,140" fill="none" stroke="#3498db" stroke-width="1.8" marker-end="url(#dep-arrow)"/>
<text x="260" y="90" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">nsubj</text>
<!-- sat → on (prep) - arc above -->
<path d="M 340,140 Q 385,90 420,140" fill="none" stroke="#27ae60" stroke-width="1.8" marker-end="url(#dep-arrow)"/>
<text x="385" y="105" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">prep</text>
<!-- cat → the (det) - arc below -->
<path d="M 190,170 Q 150,205 110,170" fill="none" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#dep-arrow)"/>
<text x="150" y="210" fill="#9b59b6" font-size="10" text-anchor="middle">det</text>
<!-- on → mat (pobj) - arc above -->
<path d="M 440,140 Q 530,80 610,140" fill="none" stroke="#f39c12" stroke-width="1.8" marker-end="url(#dep-arrow)"/>
<text x="530" y="92" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">pobj</text>
<!-- mat → the (det) - arc below -->
<path d="M 610,170 Q 575,205 540,170" fill="none" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#dep-arrow)"/>
<text x="575" y="210" fill="#9b59b6" font-size="10" text-anchor="middle">det</text>
<!-- Legend -->
<text x="350" y="235" fill="#666" font-size="10" text-anchor="middle">Arrows point from head to dependent. "sat" is the root; every other word depends on exactly one head.</text>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

+84
View File
@@ -0,0 +1,84 @@
<svg width="700" height="280" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="ds-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="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Depthwise Separable Convolution (MobileNet)</text>
<!-- Standard conv (top) -->
<text x="350" y="48" fill="#e74c3c" font-size="11" font-weight="bold" text-anchor="middle">Standard Convolution</text>
<!-- Input volume -->
<rect x="40" y="60" width="60" height="60" rx="2" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<rect x="46" y="54" width="60" height="60" rx="2" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1"/>
<rect x="52" y="48" width="60" height="60" rx="2" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1"/>
<text x="75" y="135" fill="#333" font-size="9" text-anchor="middle">H×W×C_in</text>
<!-- Single 3D kernel -->
<line x1="120" y1="83" x2="165" y2="83" stroke="#555" stroke-width="1.2" marker-end="url(#ds-arrow)"/>
<rect x="170" y="65" width="35" height="35" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="174" y="61" width="35" height="35" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="178" y="57" width="35" height="35" rx="2" fill="#e74c3c" opacity="0.3" stroke="#e74c3c" stroke-width="1"/>
<text x="195" y="115" fill="#e74c3c" font-size="8" text-anchor="middle">k×k×C_in</text>
<text x="195" y="127" fill="#e74c3c" font-size="8" text-anchor="middle">× C_out filters</text>
<!-- Output -->
<line x1="218" y1="83" x2="258" y2="83" stroke="#555" stroke-width="1.2" marker-end="url(#ds-arrow)"/>
<rect x="265" y="60" width="60" height="60" rx="2" fill="#9b59b6" opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<rect x="271" y="54" width="60" height="60" rx="2" fill="#9b59b6" opacity="0.12" stroke="#9b59b6" stroke-width="1"/>
<rect x="277" y="48" width="60" height="60" rx="2" fill="#9b59b6" opacity="0.15" stroke="#9b59b6" stroke-width="1"/>
<text x="303" y="135" fill="#333" font-size="9" text-anchor="middle">H×W×C_out</text>
<!-- Cost label -->
<text x="530" y="70" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">Cost: k²·C_in·C_out</text>
<text x="530" y="88" fill="#666" font-size="9" text-anchor="middle">per spatial position</text>
<text x="530" y="108" fill="#666" font-size="9" text-anchor="middle">e.g. 3²·64·128 = 73,728</text>
<!-- Depthwise separable (bottom) -->
<text x="350" y="165" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Depthwise Separable Convolution</text>
<!-- Input -->
<rect x="20" y="180" width="50" height="50" rx="2" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<rect x="26" y="174" width="50" height="50" rx="2" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1"/>
<rect x="32" y="168" width="50" height="50" rx="2" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1"/>
<text x="40" y="245" fill="#333" font-size="8" text-anchor="middle">H×W×C_in</text>
<!-- Step 1: Depthwise -->
<line x1="88" y1="200" x2="118" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#ds-arrow)"/>
<rect x="125" y="175" width="100" height="50" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="175" y="196" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">Depthwise</text>
<text x="175" y="210" fill="#27ae60" font-size="8" text-anchor="middle">k×k × 1 per channel</text>
<text x="175" y="245" fill="#27ae60" font-size="8" text-anchor="middle">Cost: k²·C_in</text>
<!-- Intermediate -->
<line x1="225" y1="200" x2="265" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#ds-arrow)"/>
<rect x="270" y="180" width="50" height="50" rx="2" fill="#f39c12" opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<rect x="276" y="174" width="50" height="50" rx="2" fill="#f39c12" opacity="0.12" stroke="#f39c12" stroke-width="1"/>
<rect x="282" y="168" width="50" height="50" rx="2" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<text x="295" y="245" fill="#333" font-size="8" text-anchor="middle">H×W×C_in</text>
<!-- Step 2: Pointwise -->
<line x1="338" y1="200" x2="368" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#ds-arrow)"/>
<rect x="375" y="175" width="100" height="50" rx="6" fill="#f39c12" opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="425" y="196" fill="#f39c12" font-size="9" text-anchor="middle" font-weight="bold">Pointwise</text>
<text x="425" y="210" fill="#f39c12" font-size="8" text-anchor="middle">1×1 × C_in × C_out</text>
<text x="425" y="245" fill="#f39c12" font-size="8" text-anchor="middle">Cost: C_in·C_out</text>
<!-- Output -->
<line x1="475" y1="200" x2="510" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#ds-arrow)"/>
<rect x="515" y="180" width="50" height="50" rx="2" fill="#9b59b6" opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<rect x="521" y="174" width="50" height="50" rx="2" fill="#9b59b6" opacity="0.12" stroke="#9b59b6" stroke-width="1"/>
<rect x="527" y="168" width="50" height="50" rx="2" fill="#9b59b6" opacity="0.15" stroke="#9b59b6" stroke-width="1"/>
<text x="540" y="245" fill="#333" font-size="8" text-anchor="middle">H×W×C_out</text>
<!-- Total cost -->
<rect x="590" y="178" width="100" height="50" rx="4" fill="#f5f5f5" stroke="#27ae60" stroke-width="1.5"/>
<text x="640" y="198" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">Total cost:</text>
<text x="640" y="212" fill="#27ae60" font-size="8" text-anchor="middle">k²·C_in + C_in·C_out</text>
<text x="640" y="224" fill="#666" font-size="8" text-anchor="middle">≈ 9× cheaper (k=3)</text>
<!-- Bottom note -->
<rect x="100" y="258" width="500" height="18" rx="4" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="271" fill="#666" font-size="9" text-anchor="middle">Depthwise handles spatial filtering; pointwise handles channel mixing. Same output, far fewer parameters.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.2 KiB

+54
View File
@@ -0,0 +1,54 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Object Detection: Bounding Boxes with Class Labels</text>
<!-- Scene background -->
<rect x="50" y="40" width="600" height="220" rx="6" fill="#ecf0f1" stroke="#bdc3c7" stroke-width="1.5"/>
<!-- Road -->
<rect x="50" y="200" width="600" height="60" fill="#7f8c8d" opacity="0.3"/>
<line x1="350" y1="210" x2="350" y2="260" stroke="#f1c40f" stroke-width="2" stroke-dasharray="8,6"/>
<!-- Sky -->
<rect x="50" y="40" width="600" height="80" fill="#3498db" opacity="0.08"/>
<!-- Building -->
<rect x="480" y="60" width="120" height="140" fill="#95a5a6" opacity="0.3"/>
<rect x="500" y="80" width="25" height="25" fill="#3498db" opacity="0.2"/>
<rect x="540" y="80" width="25" height="25" fill="#3498db" opacity="0.2"/>
<rect x="500" y="120" width="25" height="25" fill="#3498db" opacity="0.2"/>
<rect x="540" y="120" width="25" height="25" fill="#3498db" opacity="0.2"/>
<!-- Car 1 - detected -->
<rect x="100" y="155" width="120" height="60" rx="8" fill="#2c3e50" opacity="0.3"/>
<circle cx="130" cy="215" r="12" fill="#333" opacity="0.3"/>
<circle cx="190" cy="215" r="12" fill="#333" opacity="0.3"/>
<!-- Detection box -->
<rect x="88" y="145" width="145" height="85" fill="none" stroke="#3498db" stroke-width="2.5" rx="2"/>
<rect x="88" y="133" width="65" height="15" rx="3" fill="#3498db"/>
<text x="120" y="144" fill="white" font-size="9" text-anchor="middle" font-weight="bold">car 0.97</text>
<!-- Car 2 - detected -->
<rect x="290" y="165" width="100" height="50" rx="6" fill="#c0392b" opacity="0.3"/>
<circle cx="315" cy="215" r="10" fill="#333" opacity="0.3"/>
<circle cx="365" cy="215" r="10" fill="#333" opacity="0.3"/>
<!-- Detection box -->
<rect x="278" y="158" width="125" height="65" fill="none" stroke="#e74c3c" stroke-width="2.5" rx="2"/>
<rect x="278" y="146" width="65" height="15" rx="3" fill="#e74c3c"/>
<text x="310" y="157" fill="white" font-size="9" text-anchor="middle" font-weight="bold">car 0.94</text>
<!-- Person - detected -->
<ellipse cx="440" cy="140" rx="12" ry="12" fill="#f5cba7" opacity="0.5"/>
<rect x="428" y="155" width="24" height="45" rx="4" fill="#2c3e50" opacity="0.3"/>
<!-- Detection box -->
<rect x="418" y="125" width="44" height="85" fill="none" stroke="#27ae60" stroke-width="2.5" rx="2"/>
<rect x="418" y="113" width="80" height="15" rx="3" fill="#27ae60"/>
<text x="458" y="124" fill="white" font-size="9" text-anchor="middle" font-weight="bold">person 0.91</text>
<!-- Tree -->
<polygon points="70,120 55,160 85,160" fill="#27ae60" opacity="0.3"/>
<rect x="66" y="160" width="8" height="20" fill="#8B4513" opacity="0.3"/>
<!-- Legend -->
<rect x="50" y="270" width="600" height="22" rx="4" fill="#f5f5f5" stroke="#ccc" stroke-width="1"/>
<text x="350" y="285" fill="#333" font-size="10" text-anchor="middle">Each detection: bounding box (x, y, w, h) + class label + confidence score</text>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

+29
View File
@@ -0,0 +1,29 @@
<svg width="440" height="180" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="det-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#999"/>
</marker>
</defs>
<!-- Left: unit square -->
<text x="80" y="14" text-anchor="middle" fill="#333" font-size="12" font-weight="bold">Before (unit square)</text>
<!-- axes -->
<line x1="20" y1="160" x2="170" y2="160" stroke="#ccc" stroke-width="1" marker-end="url(#det-arr)"/>
<line x1="20" y1="160" x2="20" y2="20" stroke="#ccc" stroke-width="1" marker-end="url(#det-arr)"/>
<!-- square -->
<polygon points="20,160 120,160 120,60 20,60" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="2"/>
<text x="70" y="118" text-anchor="middle" fill="#3498db" font-size="12">area = 1</text>
<!-- Arrow -->
<text x="220" y="90" text-anchor="middle" fill="#333" font-size="20">→</text>
<text x="220" y="110" text-anchor="middle" fill="#666" font-size="11">transform</text>
<!-- Right: parallelogram -->
<text x="340" y="14" text-anchor="middle" fill="#333" font-size="12" font-weight="bold">After (parallelogram)</text>
<!-- axes -->
<line x1="250" y1="160" x2="420" y2="160" stroke="#ccc" stroke-width="1" marker-end="url(#det-arr)"/>
<line x1="250" y1="160" x2="250" y2="20" stroke="#ccc" stroke-width="1" marker-end="url(#det-arr)"/>
<!-- parallelogram -->
<polygon points="250,160 370,160 410,60 290,60" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="2"/>
<text x="330" y="118" text-anchor="middle" fill="#e74c3c" font-size="12">area = |det(A)|</text>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+43
View File
@@ -0,0 +1,43 @@
<svg width="380" height="200" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="dq-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#ccc"/>
</marker>
</defs>
<!-- Axes -->
<line x1="40" y1="170" x2="350" y2="170" stroke="#ccc" stroke-width="1" marker-end="url(#dq-arr)"/>
<line x1="40" y1="170" x2="40" y2="15" stroke="#ccc" stroke-width="1" marker-end="url(#dq-arr)"/>
<!-- Curve -->
<path d="M 55,145 Q 110,150 150,120 Q 195,85 240,60 Q 290,38 340,30"
fill="none" stroke="#9b59b6" stroke-width="2.5"/>
<!-- Point a -->
<circle cx="150" cy="120" r="4" fill="#e74c3c"/>
<line x1="150" y1="120" x2="150" y2="170" stroke="#e74c3c" stroke-width="0.8" stroke-dasharray="3"/>
<text x="145" y="183" fill="#e74c3c" font-size="10" text-anchor="middle">a</text>
<text x="138" y="115" fill="#e74c3c" font-size="9">f(a)</text>
<!-- Point a+h (far) - secant line -->
<circle cx="270" cy="47" r="4" fill="#999" fill-opacity="0.5"/>
<line x1="270" y1="47" x2="270" y2="170" stroke="#999" stroke-width="0.8" stroke-dasharray="3"/>
<text x="265" y="183" fill="#999" font-size="10" text-anchor="middle">a+h</text>
<line x1="110" y1="140" x2="310" y2="27" stroke="#999" stroke-width="1.5" opacity="0.4"/>
<text x="295" y="22" fill="#999" font-size="9">secant</text>
<!-- Point a+h (medium) -->
<circle cx="220" cy="70" r="4" fill="#999" fill-opacity="0.7"/>
<line x1="100" y1="145" x2="290" y2="35" stroke="#999" stroke-width="1.5" opacity="0.6"/>
<!-- Tangent (limit) -->
<line x1="80" y1="155" x2="280" y2="42" stroke="#3498db" stroke-width="2.5"/>
<text x="282" y="50" fill="#3498db" font-size="10" font-weight="bold">tangent</text>
<!-- Arrow showing h shrinking -->
<path d="M 265,160 Q 240,155 225,160" fill="none" stroke="#27ae60" stroke-width="1.2"/>
<path d="M 220,155 Q 195,150 175,155" fill="none" stroke="#27ae60" stroke-width="1.2"/>
<text x="200" y="150" fill="#27ae60" font-size="9" text-anchor="middle">h → 0</text>
<text x="190" y="198" text-anchor="middle" fill="#666" font-size="10">as h shrinks, secant → tangent</text>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

+109
View File
@@ -0,0 +1,109 @@
<svg width="700" height="280" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="diff-arrow" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#555"/>
</marker>
<marker id="diff-arrow-green" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#27ae60"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Diffusion: Forward and Reverse Processes</text>
<!-- Forward process (top row) -->
<text x="350" y="48" fill="#e74c3c" font-size="11" font-weight="bold" text-anchor="middle">Forward Process: Gradually Add Noise (q)</text>
<!-- x0: clean image -->
<rect x="30" y="60" width="70" height="70" rx="4" fill="#ddd" stroke="#999" stroke-width="1.5"/>
<rect x="45" y="70" width="25" height="25" fill="#3498db" opacity="0.4"/>
<rect x="50" y="95" width="15" height="15" fill="#e74c3c" opacity="0.3"/>
<text x="65" y="145" fill="#333" font-size="10" text-anchor="middle" font-weight="bold">x₀</text>
<text x="65" y="157" fill="#666" font-size="8" text-anchor="middle">clean</text>
<!-- Arrow + noise -->
<line x1="105" y1="95" x2="140" y2="95" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#diff-arrow)"/>
<text x="122" y="88" fill="#e74c3c" font-size="8" text-anchor="middle">+ε</text>
<!-- x1: slightly noisy -->
<rect x="145" y="60" width="70" height="70" rx="4" fill="#ddd" stroke="#999" stroke-width="1.5"/>
<rect x="160" y="70" width="25" height="25" fill="#3498db" opacity="0.3"/>
<rect x="165" y="95" width="15" height="15" fill="#e74c3c" opacity="0.2"/>
<!-- Noise dots -->
<circle cx="155" cy="75" r="2" fill="#999" opacity="0.5"/>
<circle cx="195" cy="85" r="2" fill="#999" opacity="0.4"/>
<circle cx="175" cy="115" r="2" fill="#999" opacity="0.5"/>
<text x="180" y="145" fill="#333" font-size="10" text-anchor="middle">x₁</text>
<line x1="220" y1="95" x2="255" y2="95" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#diff-arrow)"/>
<text x="237" y="88" fill="#e74c3c" font-size="8" text-anchor="middle">+ε</text>
<!-- xt: more noisy -->
<rect x="260" y="60" width="70" height="70" rx="4" fill="#ccc" stroke="#999" stroke-width="1.5"/>
<circle cx="280" cy="80" r="3" fill="#999" opacity="0.6"/>
<circle cx="300" cy="75" r="2" fill="#aaa" opacity="0.7"/>
<circle cx="275" cy="100" r="3" fill="#888" opacity="0.5"/>
<circle cx="310" cy="95" r="2" fill="#999" opacity="0.6"/>
<circle cx="290" cy="110" r="3" fill="#aaa" opacity="0.4"/>
<circle cx="270" cy="115" r="2" fill="#bbb" opacity="0.5"/>
<circle cx="305" cy="110" r="2" fill="#999" opacity="0.5"/>
<text x="295" y="145" fill="#333" font-size="10" text-anchor="middle">x_t</text>
<!-- Dots (ellipsis) -->
<text x="365" y="100" fill="#666" font-size="14" text-anchor="middle">···</text>
<line x1="385" y1="95" x2="420" y2="95" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#diff-arrow)"/>
<text x="402" y="88" fill="#e74c3c" font-size="8" text-anchor="middle">+ε</text>
<!-- xT-1 -->
<rect x="425" y="60" width="70" height="70" rx="4" fill="#bbb" stroke="#999" stroke-width="1.5"/>
<circle cx="445" cy="80" r="3" fill="#999"/>
<circle cx="465" cy="75" r="3" fill="#aaa"/>
<circle cx="440" cy="95" r="2" fill="#888"/>
<circle cx="475" cy="90" r="3" fill="#999"/>
<circle cx="450" cy="110" r="3" fill="#aaa"/>
<circle cx="470" cy="105" r="2" fill="#bbb"/>
<circle cx="455" cy="120" r="2" fill="#999"/>
<circle cx="480" cy="115" r="3" fill="#888"/>
<text x="460" y="145" fill="#333" font-size="10" text-anchor="middle">x_{T-1}</text>
<line x1="500" y1="95" x2="535" y2="95" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#diff-arrow)"/>
<text x="517" y="88" fill="#e74c3c" font-size="8" text-anchor="middle">+ε</text>
<!-- xT: pure noise -->
<rect x="540" y="60" width="70" height="70" rx="4" fill="#aaa" stroke="#999" stroke-width="1.5"/>
<!-- Dense noise -->
<circle cx="555" cy="75" r="2" fill="#888"/>
<circle cx="570" cy="70" r="3" fill="#999"/>
<circle cx="585" cy="78" r="2" fill="#777"/>
<circle cx="550" cy="90" r="3" fill="#aaa"/>
<circle cx="565" cy="88" r="2" fill="#888"/>
<circle cx="580" cy="93" r="3" fill="#999"/>
<circle cx="598" cy="85" r="2" fill="#777"/>
<circle cx="555" cy="105" r="2" fill="#999"/>
<circle cx="572" cy="100" r="3" fill="#888"/>
<circle cx="590" cy="108" r="2" fill="#aaa"/>
<circle cx="560" cy="118" r="3" fill="#777"/>
<circle cx="578" cy="115" r="2" fill="#999"/>
<circle cx="595" cy="120" r="3" fill="#888"/>
<text x="575" y="145" fill="#333" font-size="10" text-anchor="middle" font-weight="bold">x_T</text>
<text x="575" y="157" fill="#666" font-size="8" text-anchor="middle">≈ N(0,I)</text>
<!-- Reverse process (bottom) -->
<text x="350" y="185" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Reverse Process: Learn to Denoise (p_θ)</text>
<!-- Reverse arrows -->
<line x1="535" y1="200" x2="502" y2="200" stroke="#27ae60" stroke-width="1.5" marker-end="url(#diff-arrow-green)"/>
<line x1="420" y1="200" x2="387" y2="200" stroke="#27ae60" stroke-width="1.5" marker-end="url(#diff-arrow-green)"/>
<text x="350" y="205" fill="#666" font-size="14" text-anchor="middle">···</text>
<line x1="310" y1="200" x2="277" y2="200" stroke="#27ae60" stroke-width="1.5" marker-end="url(#diff-arrow-green)"/>
<line x1="220" y1="200" x2="187" y2="200" stroke="#27ae60" stroke-width="1.5" marker-end="url(#diff-arrow-green)"/>
<line x1="140" y1="200" x2="107" y2="200" stroke="#27ae60" stroke-width="1.5" marker-end="url(#diff-arrow-green)"/>
<text x="120" y="215" fill="#27ae60" font-size="7" text-anchor="middle">−ε_θ</text>
<text x="235" y="215" fill="#27ae60" font-size="7" text-anchor="middle">−ε_θ</text>
<text x="465" y="215" fill="#27ae60" font-size="7" text-anchor="middle">−ε_θ</text>
<!-- Neural network label -->
<rect x="160" y="225" width="380" height="40" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="242" fill="#333" font-size="9" text-anchor="middle">Neural network ε_θ(x_t, t) predicts the noise added at each step.</text>
<text x="350" y="256" fill="#666" font-size="9" text-anchor="middle">Training loss: L = E[ ‖ε − ε_θ(x_t, t)‖² ]. Simple MSE on noise prediction.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

+32
View File
@@ -0,0 +1,32 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 240" width="700" height="240">
<defs>
<marker id="ds-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Behavioural Cloning: Distribution Shift (Compounding Error)</text>
<!-- Expert trajectory -->
<path d="M 60,180 C 150,180 200,180 280,170 C 360,160 450,140 600,120" fill="none" stroke="#27ae60" stroke-width="3"/>
<text x="610" y="115" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">expert</text>
<!-- Learned policy trajectory - starts close, drifts -->
<path d="M 60,180 C 140,183 190,188 270,185 C 340,182 400,175 460,180 C 520,190 560,210 620,225" fill="none" stroke="#e74c3c" stroke-width="2.5" stroke-dasharray="6,3"/>
<text x="625" y="230" text-anchor="start" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">learned</text>
<!-- Small error annotations -->
<line x1="200" y1="180" x2="200" y2="184" stroke="#f39c12" stroke-width="1.5"/>
<text x="200" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">small error</text>
<line x1="400" y1="152" x2="400" y2="177" stroke="#f39c12" stroke-width="1.5"/>
<text x="400" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">error grows</text>
<line x1="560" y1="127" x2="560" y2="205" stroke="#e74c3c" stroke-width="1.5"/>
<text x="560" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">catastrophic drift</text>
<!-- Road edges -->
<line x1="50" y1="100" x2="640" y2="60" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<line x1="50" y1="230" x2="640" y2="230" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<text x="350" y="55" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">The policy visits states the expert never demonstrated → no training data → errors compound</text>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

+37
View File
@@ -0,0 +1,37 @@
<svg width="700" height="280" xmlns="http://www.w3.org/2000/svg">
<!-- Frequency Distribution (Histogram) -->
<text x="130" y="25" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Frequency Distribution</text>
<!-- axes -->
<line x1="40" y1="240" x2="280" y2="240" stroke="#333" stroke-width="1.5"/>
<line x1="40" y1="240" x2="40" y2="40" stroke="#333" stroke-width="1.5"/>
<text x="160" y="270" fill="#666" font-size="11" text-anchor="middle">Value</text>
<text x="15" y="140" fill="#666" font-size="11" text-anchor="middle" transform="rotate(-90,15,140)">Count</text>
<!-- histogram bars -->
<rect x="55" y="200" width="30" height="40" fill="#3498db" opacity="0.8" rx="1"/>
<rect x="90" y="160" width="30" height="80" fill="#3498db" opacity="0.8" rx="1"/>
<rect x="125" y="100" width="30" height="140" fill="#3498db" opacity="0.8" rx="1"/>
<rect x="160" y="80" width="30" height="160" fill="#3498db" opacity="0.8" rx="1"/>
<rect x="195" y="120" width="30" height="120" fill="#3498db" opacity="0.8" rx="1"/>
<rect x="230" y="180" width="30" height="60" fill="#3498db" opacity="0.8" rx="1"/>
<!-- Probability Distribution (Smooth Curve) -->
<text x="520" y="25" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Probability Distribution</text>
<!-- axes -->
<line x1="390" y1="240" x2="660" y2="240" stroke="#333" stroke-width="1.5"/>
<line x1="390" y1="240" x2="390" y2="40" stroke="#333" stroke-width="1.5"/>
<text x="525" y="270" fill="#666" font-size="11" text-anchor="middle">Value</text>
<text x="370" y="140" fill="#666" font-size="11" text-anchor="middle" transform="rotate(-90,370,140)">Probability</text>
<!-- smooth bell curve -->
<path d="M 400,238 C 420,236 440,220 460,180 C 475,150 490,90 525,75 C 560,90 575,150 590,180 C 610,220 630,236 650,238" fill="none" stroke="#e74c3c" stroke-width="2.5"/>
<!-- shaded area under curve -->
<path d="M 400,238 C 420,236 440,220 460,180 C 475,150 490,90 525,75 C 560,90 575,150 590,180 C 610,220 630,236 650,238 Z" fill="#e74c3c" opacity="0.15"/>
<!-- labels -->
<text x="130" y="250" fill="#3498db" font-size="11" text-anchor="middle">discrete bins</text>
<text x="525" y="250" fill="#e74c3c" font-size="11" text-anchor="middle">continuous curve</text>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+38
View File
@@ -0,0 +1,38 @@
<svg width="360" height="220" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow-du" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#e74c3c"/>
</marker>
<marker id="arrow-dv" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3498db"/>
</marker>
<marker id="arrow-ds" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#2ecc71"/>
</marker>
<marker id="arrow-dc" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#f39c12"/>
</marker>
</defs>
<!-- original u (short) -->
<line x1="30" y1="190" x2="98" y2="190" stroke="#e74c3c" stroke-width="2" marker-end="url(#arrow-du)"/>
<text x="60" y="208" fill="#e74c3c" font-size="12" font-weight="bold" text-anchor="middle">u</text>
<!-- original v from tip of u (short) -->
<line x1="106" y1="190" x2="146" y2="140" stroke="#3498db" stroke-width="2" marker-end="url(#arrow-dv)"/>
<text x="137" y="172" fill="#3498db" font-size="12" font-weight="bold">v</text>
<!-- u+v resultant (short) -->
<line x1="30" y1="190" x2="146" y2="140" stroke="#2ecc71" stroke-width="1.5" stroke-dasharray="4,3" marker-end="url(#arrow-ds)"/>
<text x="72" y="155" fill="#2ecc71" font-size="11">u+v</text>
<!-- scaled: cu (long) -->
<line x1="30" y1="190" x2="166" y2="190" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#arrow-du)"/>
<!-- scaled: cv from tip of cu -->
<line x1="174" y1="190" x2="254" y2="90" stroke="#3498db" stroke-width="2.5" marker-end="url(#arrow-dv)"/>
<!-- c(u+v) resultant (long, gold) -->
<line x1="30" y1="190" x2="254" y2="90" stroke="#f39c12" stroke-width="2.5" stroke-dasharray="6,3" marker-end="url(#arrow-dc)"/>
<text x="160" y="115" fill="#f39c12" font-size="14" font-weight="bold">c(u + v)</text>
<!-- labels -->
<text x="95" y="185" fill="#e74c3c" font-size="12" font-weight="bold">cu</text>
<text x="225" y="130" fill="#3498db" font-size="12" font-weight="bold">cv</text>
<!-- origin -->
<circle cx="30" cy="190" r="3" fill="#333"/>
<text x="18" y="208" fill="#333" font-size="12">O</text>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

+119
View File
@@ -0,0 +1,119 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 300" width="700" height="300">
<defs>
<marker id="dit-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#333"/>
</marker>
<marker id="dit-arr-orange" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#f39c12"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Diffusion Transformer (DiT)</text>
<!-- Noisy image input -->
<rect x="20" y="100" width="65" height="65" rx="6" fill="#3498db" fill-opacity="0.08" stroke="#3498db" stroke-width="1.2"/>
<circle cx="38" cy="118" r="2" fill="#3498db" opacity="0.4"/>
<circle cx="55" cy="125" r="1.5" fill="#3498db" opacity="0.5"/>
<circle cx="45" cy="140" r="2" fill="#3498db" opacity="0.3"/>
<circle cx="65" cy="115" r="1.5" fill="#3498db" opacity="0.6"/>
<circle cx="60" cy="148" r="1.8" fill="#3498db" opacity="0.35"/>
<circle cx="35" cy="152" r="1.5" fill="#3498db" opacity="0.45"/>
<text x="52" y="180" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Noisy</text>
<text x="52" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Image</text>
<!-- Arrow to Patchify -->
<line x1="85" y1="132" x2="110" y2="132" stroke="#333" stroke-width="1.2" marker-end="url(#dit-arr)"/>
<!-- Patchify box -->
<rect x="118" y="108" width="72" height="48" rx="8" fill="#1abc9c" fill-opacity="0.12" stroke="#1abc9c" stroke-width="1.5"/>
<text x="154" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#1abc9c">Patchify</text>
<text x="154" y="145" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">+ pos embed</text>
<!-- Patches illustration (small squares going down) -->
<line x1="190" y1="132" x2="215" y2="132" stroke="#333" stroke-width="1.2" marker-end="url(#dit-arr)"/>
<!-- Patch tokens flowing into transformer blocks -->
<rect x="220" y="42" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="60" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="78" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="96" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="114" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="132" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="150" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="168" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="186" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="220" y="204" width="14" height="14" rx="2" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<!-- Transformer Block 1 -->
<rect x="252" y="42" width="130" height="50" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="317" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Transformer Block</text>
<text x="317" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">MHSA + FFN</text>
<!-- Transformer Block 2 -->
<rect x="252" y="105" width="130" height="50" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="317" y="125" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Transformer Block</text>
<text x="317" y="141" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">MHSA + FFN</text>
<!-- Dots between blocks -->
<circle cx="317" cy="168" r="1.5" fill="#333"/>
<circle cx="317" cy="178" r="1.5" fill="#333"/>
<circle cx="317" cy="188" r="1.5" fill="#333"/>
<!-- Transformer Block N -->
<rect x="252" y="198" width="130" height="50" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="317" y="218" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Transformer Block</text>
<text x="317" y="234" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">MHSA + FFN</text>
<!-- Connecting lines between blocks -->
<line x1="317" y1="92" x2="317" y2="105" stroke="#333" stroke-width="1"/>
<line x1="317" y1="155" x2="317" y2="163" stroke="#333" stroke-width="1"/>
<line x1="317" y1="193" x2="317" y2="198" stroke="#333" stroke-width="1"/>
<!-- adaLN conditioning (side) -->
<!-- Timestep t -->
<rect x="420" y="85" width="55" height="28" rx="6" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1.2"/>
<text x="447" y="103" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#f39c12">t</text>
<!-- Class label c -->
<rect x="420" y="125" width="55" height="28" rx="6" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="1.2"/>
<text x="447" y="143" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#9b59b6">c</text>
<!-- Labels -->
<text x="447" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">timestep</text>
<text x="447" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">class label</text>
<!-- adaLN arrows to blocks -->
<line x1="420" y1="99" x2="382" y2="67" stroke="#f39c12" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#dit-arr-orange)"/>
<line x1="420" y1="105" x2="382" y2="125" stroke="#f39c12" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#dit-arr-orange)"/>
<line x1="430" y1="153" x2="382" y2="218" stroke="#f39c12" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#dit-arr-orange)"/>
<!-- adaLN label -->
<rect x="410" y="175" width="80" height="24" rx="6" fill="#f39c12" fill-opacity="0.08" stroke="#f39c12" stroke-width="1" stroke-dasharray="3,2"/>
<text x="450" y="191" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">adaLN-Zero</text>
<!-- Arrow from last block to output -->
<line x1="382" y1="223" x2="515" y2="223" stroke="#333" stroke-width="1.2" marker-end="url(#dit-arr)"/>
<!-- Unpatchify -->
<rect x="523" y="200" width="72" height="48" rx="8" fill="#1abc9c" fill-opacity="0.12" stroke="#1abc9c" stroke-width="1.5"/>
<text x="559" y="220" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#1abc9c">Unpatchify</text>
<text x="559" y="235" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">reassemble</text>
<!-- Arrow to output -->
<line x1="595" y1="224" x2="620" y2="224" stroke="#333" stroke-width="1.2" marker-end="url(#dit-arr)"/>
<!-- Denoised image output -->
<rect x="628" y="192" width="55" height="55" rx="6" fill="#27ae60" fill-opacity="0.08" stroke="#27ae60" stroke-width="1.5"/>
<text x="655" y="216" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">Denoised</text>
<text x="655" y="228" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">Image</text>
<!-- Key insight annotation -->
<rect x="505" y="42" width="180" height="48" rx="6" fill="#e74c3c" fill-opacity="0.06" stroke="#e74c3c" stroke-width="1" stroke-dasharray="4,2"/>
<text x="595" y="58" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Replaces U-Net</text>
<text x="595" y="72" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">Pure transformer backbone</text>
<text x="595" y="82" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">scales with compute (Chinchilla-optimal)</text>
<!-- Bottom note -->
<text x="350" y="288" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#999">adaLN conditions each block on timestep and class via learned scale/shift parameters</text>
</svg>

After

Width:  |  Height:  |  Size: 8.5 KiB

+36
View File
@@ -0,0 +1,36 @@
<svg width="380" height="200" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arr-a" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#e74c3c"/>
</marker>
<marker id="arr-b" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#3498db"/>
</marker>
</defs>
<!-- vector b (horizontal) -->
<circle cx="40" cy="150" r="3" fill="#333"/>
<line x1="40" y1="150" x2="338" y2="150" stroke="#3498db" stroke-width="2.5" marker-end="url(#arr-b)"/>
<text x="340" y="145" fill="#3498db" font-size="14" font-weight="bold">b</text>
<!-- vector a (angled up) -->
<line x1="40" y1="150" x2="228" y2="42" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#arr-a)"/>
<text x="232" y="40" fill="#e74c3c" font-size="14" font-weight="bold">a</text>
<!-- dashed projection line from tip of a down to b -->
<line x1="228" y1="42" x2="228" y2="150" stroke="#999" stroke-width="1.5" stroke-dasharray="5"/>
<!-- projection segment on b -->
<line x1="40" y1="155" x2="228" y2="155" stroke="#27ae60" stroke-width="3"/>
<text x="110" y="180" fill="#27ae60" font-size="12" font-weight="bold">proj_b(a)</text>
<!-- right angle mark at projection foot -->
<rect x="216" y="138" width="12" height="12" fill="none" stroke="#999" stroke-width="1.2"/>
<!-- angle arc -->
<path d="M 80,150 A 40,40 0 0,0 66,126" fill="none" stroke="#333" stroke-width="1.5"/>
<text x="78" y="132" fill="#333" font-size="13">θ</text>
<!-- label -->
<text x="40" y="15" fill="#666" font-size="12">a · b = ‖a‖ ‖b‖ cos(θ)</text>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+113
View File
@@ -0,0 +1,113 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 280" width="750" height="280" font-family="Arial, sans-serif">
<defs>
<marker id="dfe-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#666"/>
</marker>
</defs>
<!-- Title -->
<text x="375" y="24" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Dual Encoder vs Fusion Encoder</text>
<!-- Divider -->
<line x1="375" y1="38" x2="375" y2="260" stroke="#ccc" stroke-width="1" stroke-dasharray="6,4"/>
<!-- === Left Panel: Dual Encoder === -->
<text x="185" y="52" font-size="12" font-weight="bold" fill="#3498db" text-anchor="middle">Dual Encoder</text>
<!-- Image input -->
<rect x="30" y="72" width="55" height="35" rx="4" fill="#eee" stroke="#ccc" stroke-width="1"/>
<rect x="37" y="78" width="15" height="12" rx="1" fill="#3498db" fill-opacity="0.3"/>
<rect x="55" y="82" width="12" height="10" rx="1" fill="#27ae60" fill-opacity="0.3"/>
<text x="57" y="118" font-size="8" fill="#999" text-anchor="middle">Image</text>
<!-- Text input -->
<rect x="30" y="155" width="55" height="35" rx="4" fill="#eee" stroke="#ccc" stroke-width="1"/>
<text x="57" y="175" font-size="8" fill="#666" text-anchor="middle">Text</text>
<text x="57" y="200" font-size="8" fill="#999" text-anchor="middle">Query</text>
<!-- Arrow to image encoder -->
<line x1="85" y1="90" x2="110" y2="90" stroke="#3498db" stroke-width="1.2" marker-end="url(#dfe-arrow)"/>
<!-- Image Encoder -->
<rect x="115" y="68" width="100" height="44" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="165" y="87" font-size="10" fill="#333" text-anchor="middle">Image Encoder</text>
<text x="165" y="101" font-size="9" fill="#666" text-anchor="middle">(ViT)</text>
<!-- Arrow to text encoder -->
<line x1="85" y1="172" x2="110" y2="172" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#dfe-arrow)"/>
<!-- Text Encoder -->
<rect x="115" y="150" width="100" height="44" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="165" y="169" font-size="10" fill="#333" text-anchor="middle">Text Encoder</text>
<text x="165" y="183" font-size="9" fill="#666" text-anchor="middle">(Transformer)</text>
<!-- Vectors -->
<line x1="215" y1="90" x2="248" y2="90" stroke="#3498db" stroke-width="1.2" marker-end="url(#dfe-arrow)"/>
<line x1="215" y1="172" x2="248" y2="172" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#dfe-arrow)"/>
<!-- Vector boxes -->
<rect x="252" y="78" width="40" height="24" rx="4" fill="#3498db" fill-opacity="0.2" stroke="none"/>
<text x="272" y="94" font-size="9" fill="#3498db" text-anchor="middle">v_i</text>
<rect x="252" y="160" width="40" height="24" rx="4" fill="#e74c3c" fill-opacity="0.2" stroke="none"/>
<text x="272" y="176" font-size="9" fill="#e74c3c" text-anchor="middle">v_t</text>
<!-- Cosine similarity -->
<line x1="272" y1="102" x2="272" y2="158" stroke="#f39c12" stroke-width="1.5" stroke-dasharray="4,3"/>
<rect x="245" y="120" width="55" height="22" rx="4" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1"/>
<text x="272" y="135" font-size="9" fill="#f39c12" text-anchor="middle" font-weight="bold">cos(v_i, v_t)</text>
<!-- Label -->
<text x="185" y="230" font-size="10" fill="#666" text-anchor="middle">Independent encoders</text>
<text x="185" y="245" font-size="10" fill="#27ae60" text-anchor="middle" font-weight="bold">Fast retrieval</text>
<text x="185" y="260" font-size="9" fill="#999" text-anchor="middle">O(1) similarity computation</text>
<!-- === Right Panel: Fusion Encoder === -->
<text x="565" y="52" font-size="12" font-weight="bold" fill="#9b59b6" text-anchor="middle">Fusion Encoder</text>
<!-- Image input -->
<rect x="400" y="72" width="55" height="35" rx="4" fill="#eee" stroke="#ccc" stroke-width="1"/>
<rect x="407" y="78" width="15" height="12" rx="1" fill="#3498db" fill-opacity="0.3"/>
<rect x="425" y="82" width="12" height="10" rx="1" fill="#27ae60" fill-opacity="0.3"/>
<text x="427" y="118" font-size="8" fill="#999" text-anchor="middle">Image</text>
<!-- Text input -->
<rect x="400" y="155" width="55" height="35" rx="4" fill="#eee" stroke="#ccc" stroke-width="1"/>
<text x="427" y="175" font-size="8" fill="#666" text-anchor="middle">Text</text>
<text x="427" y="200" font-size="8" fill="#999" text-anchor="middle">Query</text>
<!-- Image features -->
<line x1="455" y1="90" x2="490" y2="90" stroke="#3498db" stroke-width="1.2"/>
<!-- Text features -->
<line x1="455" y1="172" x2="490" y2="172" stroke="#e74c3c" stroke-width="1.2"/>
<!-- Token row (image tokens) -->
<rect x="492" y="80" width="12" height="12" rx="2" fill="#3498db" fill-opacity="0.4" stroke="none"/>
<rect x="506" y="80" width="12" height="12" rx="2" fill="#3498db" fill-opacity="0.4" stroke="none"/>
<rect x="520" y="80" width="12" height="12" rx="2" fill="#3498db" fill-opacity="0.4" stroke="none"/>
<rect x="534" y="80" width="12" height="12" rx="2" fill="#3498db" fill-opacity="0.4" stroke="none"/>
<!-- Token row (text tokens) -->
<rect x="492" y="165" width="12" height="12" rx="2" fill="#e74c3c" fill-opacity="0.4" stroke="none"/>
<rect x="506" y="165" width="12" height="12" rx="2" fill="#e74c3c" fill-opacity="0.4" stroke="none"/>
<rect x="520" y="165" width="12" height="12" rx="2" fill="#e74c3c" fill-opacity="0.4" stroke="none"/>
<!-- Arrows converging -->
<line x1="540" y1="90" x2="580" y2="115" stroke="#3498db" stroke-width="1.2" marker-end="url(#dfe-arrow)"/>
<line x1="540" y1="172" x2="580" y2="148" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#dfe-arrow)"/>
<!-- Cross-Attention Transformer -->
<rect x="585" y="100" width="130" height="62" rx="8" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="650" y="122" font-size="10" fill="#333" text-anchor="middle">Cross-Attention</text>
<text x="650" y="136" font-size="10" fill="#333" text-anchor="middle">Transformer</text>
<text x="650" y="152" font-size="9" fill="#9b59b6" text-anchor="middle">(Deep Fusion)</text>
<!-- Bidirectional attention arrows inside -->
<line x1="605" y1="108" x2="695" y2="108" stroke="#9b59b6" stroke-width="0.8" stroke-dasharray="2,2"/>
<line x1="695" y1="155" x2="605" y2="155" stroke="#9b59b6" stroke-width="0.8" stroke-dasharray="2,2"/>
<!-- Label -->
<text x="565" y="230" font-size="10" fill="#666" text-anchor="middle">Token-level interaction</text>
<text x="565" y="245" font-size="10" fill="#27ae60" text-anchor="middle" font-weight="bold">Richer understanding</text>
<text x="565" y="260" font-size="9" fill="#999" text-anchor="middle">O(n*m) cross-attention cost</text>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

+34
View File
@@ -0,0 +1,34 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 200" width="700" height="200">
<defs>
<marker id="em-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#f39c12"/>
</marker>
<marker id="em-arr-b" markerWidth="8" markerHeight="6" refX="0" refY="3" orient="auto">
<path d="M8,0 L0,3 L8,6 Z" fill="#3498db"/>
</marker>
</defs>
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Earth-Mars Communication Delay</text>
<!-- Earth -->
<circle cx="100" cy="110" r="40" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="2"/>
<text x="100" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" font-weight="bold" fill="#3498db">Earth</text>
<!-- Mars -->
<circle cx="600" cy="110" r="30" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="2"/>
<text x="600" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" font-weight="bold" fill="#e74c3c">Mars</text>
<!-- Signal out -->
<line x1="145" y1="95" x2="565" y2="95" stroke="#f39c12" stroke-width="1.5" stroke-dasharray="8,4" marker-end="url(#em-arr)"/>
<text x="355" y="88" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#f39c12">command signal → 4-24 min</text>
<!-- Signal back -->
<line x1="565" y1="125" x2="145" y2="125" stroke="#3498db" stroke-width="1.5" stroke-dasharray="8,4" marker-end="url(#em-arr-b)"/>
<text x="355" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#3498db">← telemetry response 4-24 min</text>
<!-- Round trip -->
<rect x="250" y="155" width="200" height="28" rx="6" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="350" y="174" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#9b59b6">Round trip: 8-48 minutes</text>
<!-- Implication -->
<text x="350" y="198" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">No real-time joysticking — the rover must decide for itself</text>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

+71
View File
@@ -0,0 +1,71 @@
<svg width="700" height="280" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">EfficientNet: Compound Scaling</text>
<!-- Baseline network -->
<text x="90" y="55" fill="#666" font-size="10" text-anchor="middle" font-weight="bold">Baseline</text>
<rect x="50" y="65" width="80" height="120" rx="4" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<!-- Layers inside -->
<rect x="62" y="75" width="56" height="14" rx="2" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="62" y="93" width="56" height="14" rx="2" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="62" y="111" width="56" height="14" rx="2" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="62" y="129" width="56" height="14" rx="2" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="62" y="147" width="56" height="14" rx="2" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<rect x="62" y="165" width="56" height="14" rx="2" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="0.8"/>
<text x="90" y="200" fill="#3498db" font-size="8" text-anchor="middle">d layers</text>
<text x="90" y="212" fill="#3498db" font-size="8" text-anchor="middle">w channels</text>
<text x="90" y="224" fill="#3498db" font-size="8" text-anchor="middle">r resolution</text>
<!-- Width scaling -->
<text x="225" y="55" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">Width (w)</text>
<rect x="170" y="65" width="110" height="120" rx="4" fill="#e74c3c" opacity="0.08" stroke="#e74c3c" stroke-width="1.5"/>
<rect x="180" y="75" width="90" height="14" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="0.8"/>
<rect x="180" y="93" width="90" height="14" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="0.8"/>
<rect x="180" y="111" width="90" height="14" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="0.8"/>
<rect x="180" y="129" width="90" height="14" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="0.8"/>
<rect x="180" y="147" width="90" height="14" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="0.8"/>
<rect x="180" y="165" width="90" height="14" rx="2" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="0.8"/>
<text x="225" y="200" fill="#e74c3c" font-size="8" text-anchor="middle">More channels</text>
<!-- Depth scaling -->
<text x="355" y="55" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">Depth (d)</text>
<rect x="315" y="55" width="80" height="145" rx="4" fill="#27ae60" opacity="0.08" stroke="#27ae60" stroke-width="1.5"/>
<rect x="327" y="63" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="78" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="93" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="108" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="123" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="138" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="153" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="168" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<rect x="327" y="183" width="56" height="12" rx="2" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="0.8"/>
<text x="355" y="212" fill="#27ae60" font-size="8" text-anchor="middle">More layers</text>
<!-- Resolution scaling -->
<text x="480" y="55" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">Resolution (r)</text>
<rect x="430" y="50" width="100" height="150" rx="4" fill="#f39c12" opacity="0.08" stroke="#f39c12" stroke-width="1.5"/>
<rect x="442" y="60" width="76" height="20" rx="2" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="0.8"/>
<rect x="442" y="84" width="76" height="20" rx="2" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="0.8"/>
<rect x="442" y="108" width="76" height="20" rx="2" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="0.8"/>
<rect x="442" y="132" width="76" height="20" rx="2" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="0.8"/>
<rect x="442" y="156" width="76" height="20" rx="2" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="0.8"/>
<text x="480" y="212" fill="#f39c12" font-size="8" text-anchor="middle">Higher resolution</text>
<!-- Compound scaling -->
<text x="620" y="55" fill="#9b59b6" font-size="10" text-anchor="middle" font-weight="bold">Compound (φ)</text>
<rect x="565" y="50" width="110" height="160" rx="4" fill="#9b59b6" opacity="0.08" stroke="#9b59b6" stroke-width="2"/>
<rect x="575" y="58" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="75" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="92" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="109" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="126" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="143" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="160" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="177" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<rect x="575" y="194" width="90" height="14" rx="2" fill="#9b59b6" opacity="0.2" stroke="#9b59b6" stroke-width="0.8"/>
<text x="620" y="222" fill="#9b59b6" font-size="8" text-anchor="middle">All three scaled together</text>
<!-- Bottom formula box -->
<rect x="80" y="240" width="540" height="35" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="255" fill="#333" font-size="9" text-anchor="middle">d = α^φ, w = β^φ, r = γ^φ subject to α·β²·γ² ≈ 2</text>
<text x="350" y="269" fill="#666" font-size="9" text-anchor="middle">Scaling all dimensions together is more effective than scaling any single one.</text>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

+47
View File
@@ -0,0 +1,47 @@
<svg width="380" height="170" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="ev-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#999"/>
</marker>
<marker id="ev-r" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#e74c3c"/>
</marker>
<marker id="ev-b" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#3498db"/>
</marker>
<marker id="ev-g" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5" fill="#27ae60"/>
</marker>
</defs>
<!-- Left: eigenvector (stays on same line) -->
<text x="90" y="14" text-anchor="middle" fill="#333" font-size="11" font-weight="bold">Eigenvector: same direction</text>
<line x1="20" y1="150" x2="180" y2="150" stroke="#ccc" stroke-width="1" marker-end="url(#ev-arr)"/>
<line x1="20" y1="150" x2="20" y2="15" stroke="#ccc" stroke-width="1" marker-end="url(#ev-arr)"/>
<circle cx="20" cy="150" r="3" fill="#333"/>
<!-- original -->
<line x1="20" y1="150" x2="80" y2="100" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#ev-r)"/>
<text x="60" y="112" fill="#e74c3c" font-size="11">x</text>
<!-- stretched (same direction, longer) -->
<line x1="20" y1="150" x2="140" y2="50" stroke="#3498db" stroke-width="2.5" marker-end="url(#ev-b)"/>
<text x="125" y="55" fill="#3498db" font-size="11">Ax = λx</text>
<!-- dashed line showing same direction -->
<line x1="20" y1="150" x2="165" y2="30" stroke="#999" stroke-width="0.8" stroke-dasharray="4"/>
<text x="90" y="165" fill="#666" font-size="10">just scaled, not rotated</text>
<!-- Divider -->
<line x1="200" y1="10" x2="200" y2="160" stroke="#ddd" stroke-width="1" stroke-dasharray="4"/>
<!-- Right: non-eigenvector (direction changes) -->
<text x="290" y="14" text-anchor="middle" fill="#333" font-size="11" font-weight="bold">Regular vector: direction changes</text>
<line x1="220" y1="150" x2="370" y2="150" stroke="#ccc" stroke-width="1" marker-end="url(#ev-arr)"/>
<line x1="220" y1="150" x2="220" y2="15" stroke="#ccc" stroke-width="1" marker-end="url(#ev-arr)"/>
<circle cx="220" cy="150" r="3" fill="#333"/>
<!-- original -->
<line x1="220" y1="150" x2="300" y2="100" stroke="#e74c3c" stroke-width="2.5" marker-end="url(#ev-r)"/>
<text x="270" y="112" fill="#e74c3c" font-size="11">v</text>
<!-- transformed (different direction) -->
<line x1="220" y1="150" x2="350" y2="80" stroke="#27ae60" stroke-width="2.5" marker-end="url(#ev-g)"/>
<text x="340" y="72" fill="#27ae60" font-size="11">Av</text>
<text x="290" y="165" fill="#666" font-size="10">scaled AND rotated</text>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

+93
View File
@@ -0,0 +1,93 @@
<svg width="700" height="320" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="ens-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="none" stroke="#555" stroke-width="1"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Bagging vs Boosting</text>
<!-- Divider -->
<line x1="350" y1="32" x2="350" y2="310" stroke="#ccc" stroke-width="1" stroke-dasharray="4,4"/>
<!-- === BAGGING (left) === -->
<text x="175" y="50" fill="#3498db" font-size="13" font-weight="bold" text-anchor="middle">Bagging (parallel)</text>
<!-- Data box -->
<rect x="130" y="60" width="90" height="24" rx="4" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="175" y="77" fill="#333" font-size="10" text-anchor="middle">Training Data</text>
<!-- Bootstrap arrows -->
<line x1="145" y1="84" x2="80" y2="108" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<line x1="175" y1="84" x2="175" y2="108" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<line x1="205" y1="84" x2="270" y2="108" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<!-- Bootstrap samples -->
<rect x="40" y="110" width="80" height="22" rx="4" fill="#3498db" opacity="0.1" stroke="#3498db" stroke-width="1"/>
<text x="80" y="125" fill="#333" font-size="9" text-anchor="middle">Sample 1</text>
<rect x="135" y="110" width="80" height="22" rx="4" fill="#3498db" opacity="0.1" stroke="#3498db" stroke-width="1"/>
<text x="175" y="125" fill="#333" font-size="9" text-anchor="middle">Sample 2</text>
<rect x="230" y="110" width="80" height="22" rx="4" fill="#3498db" opacity="0.1" stroke="#3498db" stroke-width="1"/>
<text x="270" y="125" fill="#333" font-size="9" text-anchor="middle">Sample 3</text>
<!-- Models -->
<rect x="45" y="145" width="70" height="26" rx="4" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.2"/>
<text x="80" y="163" fill="#333" font-size="10" text-anchor="middle">Tree 1</text>
<rect x="140" y="145" width="70" height="26" rx="4" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.2"/>
<text x="175" y="163" fill="#333" font-size="10" text-anchor="middle">Tree 2</text>
<rect x="235" y="145" width="70" height="26" rx="4" fill="#3498db" opacity="0.2" stroke="#3498db" stroke-width="1.2"/>
<text x="270" y="163" fill="#333" font-size="10" text-anchor="middle">Tree 3</text>
<!-- Arrows to average -->
<line x1="80" y1="171" x2="145" y2="200" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<line x1="175" y1="171" x2="175" y2="200" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<line x1="270" y1="171" x2="205" y2="200" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<!-- Average box -->
<rect x="130" y="202" width="90" height="26" rx="4" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1.5"/>
<text x="175" y="220" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Average</text>
<text x="175" y="250" fill="#666" font-size="10" text-anchor="middle">All learners trained independently</text>
<text x="175" y="264" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">Reduces variance</text>
<!-- === BOOSTING (right) === -->
<text x="525" y="50" fill="#e74c3c" font-size="13" font-weight="bold" text-anchor="middle">Boosting (sequential)</text>
<!-- Model 1 -->
<rect x="485" y="65" width="80" height="26" rx="4" fill="#e74c3c" opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="525" y="83" fill="#333" font-size="10" text-anchor="middle">Weak 1</text>
<!-- Error arrow -->
<line x1="525" y1="91" x2="525" y2="108" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<text x="560" y="104" fill="#e74c3c" font-size="9">errors</text>
<!-- Model 2 -->
<rect x="485" y="110" width="80" height="26" rx="4" fill="#e74c3c" opacity="0.2" stroke="#e74c3c" stroke-width="1.2"/>
<text x="525" y="128" fill="#333" font-size="10" text-anchor="middle">Weak 2</text>
<!-- Error arrow -->
<line x1="525" y1="136" x2="525" y2="153" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<text x="560" y="149" fill="#e74c3c" font-size="9">errors</text>
<!-- Model 3 -->
<rect x="485" y="155" width="80" height="26" rx="4" fill="#e74c3c" opacity="0.25" stroke="#e74c3c" stroke-width="1.2"/>
<text x="525" y="173" fill="#333" font-size="10" text-anchor="middle">Weak 3</text>
<!-- Arrow to weighted sum -->
<line x1="525" y1="181" x2="525" y2="200" stroke="#555" stroke-width="1" marker-end="url(#ens-arrow)"/>
<!-- Weighted sum box -->
<rect x="475" y="202" width="100" height="26" rx="4" fill="#27ae60" opacity="0.2" stroke="#27ae60" stroke-width="1.5"/>
<text x="525" y="220" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Weighted Sum</text>
<!-- Weights annotation -->
<text x="440" y="83" fill="#666" font-size="9" text-anchor="end">w₁</text>
<text x="440" y="128" fill="#666" font-size="9" text-anchor="end">w₂</text>
<text x="440" y="173" fill="#666" font-size="9" text-anchor="end">w₃</text>
<text x="525" y="250" fill="#666" font-size="10" text-anchor="middle">Each learner fixes previous errors</text>
<text x="525" y="264" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">Reduces bias</text>
<!-- Bottom summary -->
<rect x="150" y="282" width="400" height="24" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="299" fill="#333" font-size="11" text-anchor="middle">Random Forest = bagging of trees | AdaBoost, GBM = boosting variants</text>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

+81
View File
@@ -0,0 +1,81 @@
<svg width="700" height="250" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="frcnn-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="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Faster R-CNN Pipeline</text>
<!-- Input image -->
<rect x="20" y="55" width="75" height="75" rx="4" fill="#ddd" stroke="#999" stroke-width="1.5"/>
<rect x="35" y="70" width="30" height="25" fill="#e74c3c" opacity="0.2"/>
<rect x="50" y="90" width="20" height="15" fill="#3498db" opacity="0.2"/>
<text x="57" y="145" fill="#666" font-size="9" text-anchor="middle">Input</text>
<text x="57" y="155" fill="#666" font-size="9" text-anchor="middle">Image</text>
<!-- Arrow -->
<line x1="100" y1="92" x2="130" y2="92" stroke="#555" stroke-width="1.2" marker-end="url(#frcnn-arrow)"/>
<!-- Backbone CNN -->
<rect x="135" y="55" width="85" height="75" rx="6" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="177" y="88" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">Backbone</text>
<text x="177" y="102" fill="#3498db" font-size="9" text-anchor="middle">(ResNet)</text>
<!-- Arrow to shared feature map -->
<line x1="220" y1="92" x2="250" y2="92" stroke="#555" stroke-width="1.2" marker-end="url(#frcnn-arrow)"/>
<!-- Shared feature map -->
<rect x="255" y="45" width="80" height="95" rx="4" fill="#f39c12" opacity="0.12" stroke="#f39c12" stroke-width="2"/>
<text x="295" y="82" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">Shared</text>
<text x="295" y="95" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">Feature</text>
<text x="295" y="108" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">Map</text>
<!-- Branch up to RPN -->
<line x1="335" y1="72" x2="380" y2="47" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#frcnn-arrow)"/>
<!-- RPN -->
<rect x="385" y="30" width="100" height="40" rx="6" fill="#e74c3c" opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="435" y="47" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">RPN</text>
<text x="435" y="60" fill="#e74c3c" font-size="8" text-anchor="middle">Region Proposals</text>
<!-- Proposals arrow down -->
<line x1="435" y1="70" x2="435" y2="97" stroke="#e74c3c" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#frcnn-arrow)"/>
<text x="460" y="88" fill="#e74c3c" font-size="8" text-anchor="start">proposals</text>
<!-- Branch to RoI pooling -->
<line x1="335" y1="100" x2="380" y2="115" stroke="#555" stroke-width="1.5" marker-end="url(#frcnn-arrow)"/>
<!-- RoI Pooling -->
<rect x="385" y="100" width="100" height="36" rx="6" fill="#9b59b6" opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="435" y="118" fill="#9b59b6" font-size="10" text-anchor="middle" font-weight="bold">RoI Pooling</text>
<text x="435" y="130" fill="#9b59b6" font-size="8" text-anchor="middle">fixed-size features</text>
<!-- Arrow to heads -->
<line x1="485" y1="118" x2="520" y2="95" stroke="#555" stroke-width="1.2" marker-end="url(#frcnn-arrow)"/>
<line x1="485" y1="118" x2="520" y2="140" stroke="#555" stroke-width="1.2" marker-end="url(#frcnn-arrow)"/>
<!-- Classification head -->
<rect x="525" y="75" width="80" height="36" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="565" y="93" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">Classifier</text>
<text x="565" y="105" fill="#27ae60" font-size="8" text-anchor="middle">class labels</text>
<!-- Regression head -->
<rect x="525" y="125" width="80" height="36" rx="6" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="565" y="143" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">Regressor</text>
<text x="565" y="155" fill="#3498db" font-size="8" text-anchor="middle">box offsets</text>
<!-- Output arrows -->
<line x1="605" y1="93" x2="640" y2="93" stroke="#27ae60" stroke-width="1.2" marker-end="url(#frcnn-arrow)"/>
<line x1="605" y1="143" x2="640" y2="143" stroke="#3498db" stroke-width="1.2" marker-end="url(#frcnn-arrow)"/>
<!-- Output -->
<rect x="645" y="80" width="45" height="80" rx="4" fill="#ddd" stroke="#999" stroke-width="1"/>
<rect x="652" y="95" width="25" height="15" fill="none" stroke="#27ae60" stroke-width="1.5"/>
<rect x="655" y="120" width="20" height="12" fill="none" stroke="#e74c3c" stroke-width="1.5"/>
<text x="667" y="168" fill="#666" font-size="8" text-anchor="middle">detections</text>
<!-- Bottom note -->
<rect x="70" y="190" width="560" height="45" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="207" fill="#333" font-size="10" text-anchor="middle">Two-stage: RPN proposes candidate regions, then each region is classified and refined.</text>
<text x="350" y="222" fill="#666" font-size="9" text-anchor="middle">Backbone runs once (shared features). RPN and detection heads run on the shared feature map.</text>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

+78
View File
@@ -0,0 +1,78 @@
<svg width="700" height="270" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="fcos-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="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">FCOS: Anchor-Free Per-Pixel Detection</text>
<!-- Feature map grid -->
<text x="130" y="48" fill="#666" font-size="11" text-anchor="middle">Feature Map</text>
<rect x="30" y="55" width="200" height="160" rx="4" fill="#ecf0f1" stroke="#999" stroke-width="1.5"/>
<!-- Grid lines -->
<line x1="70" y1="55" x2="70" y2="215" stroke="#ddd" stroke-width="0.5"/>
<line x1="110" y1="55" x2="110" y2="215" stroke="#ddd" stroke-width="0.5"/>
<line x1="150" y1="55" x2="150" y2="215" stroke="#ddd" stroke-width="0.5"/>
<line x1="190" y1="55" x2="190" y2="215" stroke="#ddd" stroke-width="0.5"/>
<line x1="30" y1="95" x2="230" y2="95" stroke="#ddd" stroke-width="0.5"/>
<line x1="30" y1="135" x2="230" y2="135" stroke="#ddd" stroke-width="0.5"/>
<line x1="30" y1="175" x2="230" y2="175" stroke="#ddd" stroke-width="0.5"/>
<!-- Ground truth bounding box -->
<rect x="55" y="80" width="120" height="90" rx="2" fill="none" stroke="#3498db" stroke-width="2"/>
<text x="115" y="72" fill="#3498db" font-size="8" text-anchor="middle" font-weight="bold">Ground Truth Box</text>
<!-- A point inside the box with distances shown -->
<circle cx="90" cy="115" r="5" fill="#e74c3c"/>
<!-- Distance arrows from point to box edges -->
<!-- Left (l) -->
<line x1="88" y1="115" x2="57" y2="115" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#fcos-arrow)"/>
<text x="68" y="110" fill="#e74c3c" font-size="8" text-anchor="middle" font-weight="bold">l</text>
<!-- Top (t) -->
<line x1="90" y1="113" x2="90" y2="82" stroke="#27ae60" stroke-width="1.5" marker-end="url(#fcos-arrow)"/>
<text x="97" y="95" fill="#27ae60" font-size="8" text-anchor="start" font-weight="bold">t</text>
<!-- Right (r) -->
<line x1="92" y1="115" x2="173" y2="115" stroke="#f39c12" stroke-width="1.5" marker-end="url(#fcos-arrow)"/>
<text x="140" y="110" fill="#f39c12" font-size="8" text-anchor="middle" font-weight="bold">r</text>
<!-- Bottom (b) -->
<line x1="90" y1="117" x2="90" y2="168" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#fcos-arrow)"/>
<text x="97" y="148" fill="#9b59b6" font-size="8" text-anchor="start" font-weight="bold">b</text>
<!-- Arrow to outputs -->
<line x1="240" y1="135" x2="280" y2="135" stroke="#555" stroke-width="1.5" marker-end="url(#fcos-arrow)"/>
<!-- Output heads -->
<!-- Classification -->
<rect x="290" y="55" width="170" height="40" rx="6" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="375" y="73" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">Classification Head</text>
<text x="375" y="88" fill="#3498db" font-size="8" text-anchor="middle">C class scores per pixel</text>
<!-- Regression -->
<rect x="290" y="105" width="170" height="40" rx="6" fill="#e74c3c" opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="375" y="123" fill="#e74c3c" font-size="10" text-anchor="middle" font-weight="bold">Regression Head</text>
<text x="375" y="138" fill="#e74c3c" font-size="8" text-anchor="middle">(l, t, r, b) distances per pixel</text>
<!-- Centerness -->
<rect x="290" y="155" width="170" height="40" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="375" y="173" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">Centerness Head</text>
<text x="375" y="188" fill="#27ae60" font-size="8" text-anchor="middle">suppresses low-quality detections</text>
<!-- Centerness formula -->
<rect x="485" y="55" width="200" height="65" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="585" y="75" fill="#333" font-size="9" text-anchor="middle" font-weight="bold">Centerness score:</text>
<text x="585" y="92" fill="#333" font-size="9" text-anchor="middle">√(min(l,r)/max(l,r))</text>
<text x="585" y="108" fill="#333" font-size="9" text-anchor="middle">× √(min(t,b)/max(t,b))</text>
<!-- FPN note -->
<rect x="485" y="130" width="200" height="65" rx="6" fill="#f5f5f5" stroke="#9b59b6" stroke-width="1"/>
<text x="585" y="150" fill="#9b59b6" font-size="9" text-anchor="middle" font-weight="bold">Multi-scale with FPN:</text>
<text x="585" y="168" fill="#666" font-size="9" text-anchor="middle">Small objects → high-res levels</text>
<text x="585" y="183" fill="#666" font-size="9" text-anchor="middle">Large objects → low-res levels</text>
<!-- Bottom note -->
<rect x="60" y="218" width="580" height="40" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="235" fill="#333" font-size="9" text-anchor="middle">No anchors needed. Every feature map location inside a ground truth box is a positive training sample.</text>
<text x="350" y="250" fill="#666" font-size="9" text-anchor="middle">Centerness down-weights predictions far from object centres, improving precision without NMS changes.</text>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

+53
View File
@@ -0,0 +1,53 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 260" width="700" height="260">
<defs>
<marker id="fs-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Feature Store: Same Features for Training and Serving</text>
<!-- Feature computation -->
<rect x="30" y="60" width="120" height="50" rx="8" fill="#555" fill-opacity="0.1" stroke="#555" stroke-width="1.5"/>
<text x="90" y="82" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#555">Raw Data</text>
<text x="90" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#555">events, logs, DBs</text>
<line x1="150" y1="85" x2="185" y2="85" stroke="#666" stroke-width="1.5" marker-end="url(#fs-arr)"/>
<!-- Feature engineering -->
<rect x="193" y="52" width="130" height="65" rx="10" fill="#f39c12" fill-opacity="0.1" stroke="#f39c12" stroke-width="1.5"/>
<text x="258" y="72" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Feature</text>
<text x="258" y="86" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Engineering</text>
<text x="258" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">same code for both paths</text>
<!-- Split to offline and online -->
<line x1="323" y1="70" x2="398" y2="55" stroke="#3498db" stroke-width="1.5" marker-end="url(#fs-arr)"/>
<line x1="323" y1="100" x2="398" y2="135" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#fs-arr)"/>
<!-- Offline store -->
<rect x="406" y="35" width="130" height="50" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="471" y="55" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Offline Store</text>
<text x="471" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">data warehouse (batch)</text>
<!-- Online store -->
<rect x="406" y="115" width="130" height="50" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="471" y="135" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Online Store</text>
<text x="471" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">Redis/DynamoDB (<5ms)</text>
<!-- Training reads from offline -->
<line x1="536" y1="55" x2="575" y2="55" stroke="#3498db" stroke-width="1.5" marker-end="url(#fs-arr)"/>
<rect x="583" y="35" width="90" height="45" rx="8" fill="#3498db" fill-opacity="0.08" stroke="#3498db" stroke-width="1.5"/>
<text x="628" y="55" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Training</text>
<text x="628" y="69" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">batch read</text>
<!-- Serving reads from online -->
<line x1="536" y1="140" x2="575" y2="140" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#fs-arr)"/>
<rect x="583" y="120" width="90" height="45" rx="8" fill="#e74c3c" fill-opacity="0.08" stroke="#e74c3c" stroke-width="1.5"/>
<text x="628" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Serving</text>
<text x="628" y="154" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">real-time lookup</text>
<!-- Key insight box -->
<rect x="100" y="190" width="500" height="55" rx="8" fill="#27ae60" fill-opacity="0.06" stroke="#27ae60" stroke-width="1.5"/>
<text x="350" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Key: Same feature computation → No training-serving skew</text>
<text x="350" y="228" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">Without a feature store: training computes user_age one way, serving computes it differently</text>
<text x="350" y="240" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">→ model sees different features at inference → silently wrong predictions</text>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

+83
View File
@@ -0,0 +1,83 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 220" width="800" height="220">
<text x="400" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">The Five Geometric Domains</text>
<!-- 1. Grids -->
<rect x="20" y="45" width="140" height="155" rx="10" fill="#3498db" fill-opacity="0.06" stroke="#3498db" stroke-width="1.5"/>
<text x="90" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">Grids</text>
<!-- Grid drawing -->
<g transform="translate(45, 78)">
<rect x="0" y="0" width="15" height="15" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.5"/>
<rect x="15" y="0" width="15" height="15" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="0.5"/>
<rect x="30" y="0" width="15" height="15" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.5"/>
<rect x="45" y="0" width="15" height="15" fill="#3498db" fill-opacity="0.1" stroke="#3498db" stroke-width="0.5"/>
<rect x="0" y="15" width="15" height="15" fill="#3498db" fill-opacity="0.1" stroke="#3498db" stroke-width="0.5"/>
<rect x="15" y="15" width="15" height="15" fill="#3498db" fill-opacity="0.4" stroke="#3498db" stroke-width="0.5"/>
<rect x="30" y="15" width="15" height="15" fill="#3498db" fill-opacity="0.5" stroke="#3498db" stroke-width="0.5"/>
<rect x="45" y="15" width="15" height="15" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.5"/>
<rect x="0" y="30" width="15" height="15" fill="#3498db" fill-opacity="0.3" stroke="#3498db" stroke-width="0.5"/>
<rect x="15" y="30" width="15" height="15" fill="#3498db" fill-opacity="0.1" stroke="#3498db" stroke-width="0.5"/>
<rect x="30" y="30" width="15" height="15" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="0.5"/>
<rect x="45" y="30" width="15" height="15" fill="#3498db" fill-opacity="0.4" stroke="#3498db" stroke-width="0.5"/>
</g>
<text x="90" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">images, audio</text>
<text x="90" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">symmetry: translation</text>
<text x="90" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">arch: CNN</text>
<!-- 2. Sets -->
<rect x="175" y="45" width="140" height="155" rx="10" fill="#e74c3c" fill-opacity="0.06" stroke="#e74c3c" stroke-width="1.5"/>
<text x="245" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#e74c3c">Sets</text>
<circle cx="215" cy="92" r="5" fill="#e74c3c" fill-opacity="0.4"/>
<circle cx="255" cy="85" r="5" fill="#e74c3c" fill-opacity="0.4"/>
<circle cx="235" cy="108" r="5" fill="#e74c3c" fill-opacity="0.4"/>
<circle cx="270" cy="105" r="5" fill="#e74c3c" fill-opacity="0.4"/>
<circle cx="220" cy="122" r="5" fill="#e74c3c" fill-opacity="0.4"/>
<circle cx="260" cy="120" r="5" fill="#e74c3c" fill-opacity="0.4"/>
<text x="245" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">point clouds</text>
<text x="245" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">symmetry: permutation</text>
<text x="245" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">arch: DeepSets</text>
<!-- 3. Sequences -->
<rect x="330" y="45" width="140" height="155" rx="10" fill="#27ae60" fill-opacity="0.06" stroke="#27ae60" stroke-width="1.5"/>
<text x="400" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#27ae60">Sequences</text>
<g transform="translate(355, 95)">
<rect x="0" y="0" width="18" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<line x1="18" y1="9" x2="24" y2="9" stroke="#27ae60" stroke-width="1"/>
<rect x="24" y="0" width="18" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<line x1="42" y1="9" x2="48" y2="9" stroke="#27ae60" stroke-width="1"/>
<rect x="48" y="0" width="18" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<line x1="66" y1="9" x2="72" y2="9" stroke="#27ae60" stroke-width="1"/>
<rect x="72" y="0" width="18" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
</g>
<text x="400" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">text, time series</text>
<text x="400" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">symmetry: (time) translation</text>
<text x="400" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">arch: RNN, Transformer</text>
<!-- 4. Graphs -->
<rect x="485" y="45" width="140" height="155" rx="10" fill="#f39c12" fill-opacity="0.06" stroke="#f39c12" stroke-width="1.5"/>
<text x="555" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#f39c12">Graphs</text>
<circle cx="535" cy="90" r="5" fill="#f39c12" stroke="#f39c12" stroke-width="1"/>
<circle cx="565" cy="82" r="5" fill="#f39c12" stroke="#f39c12" stroke-width="1"/>
<circle cx="580" cy="105" r="5" fill="#f39c12" stroke="#f39c12" stroke-width="1"/>
<circle cx="545" cy="115" r="5" fill="#f39c12" stroke="#f39c12" stroke-width="1"/>
<circle cx="560" cy="100" r="5" fill="#f39c12" stroke="#f39c12" stroke-width="1"/>
<line x1="535" y1="90" x2="565" y2="82" stroke="#f39c12" stroke-width="1" stroke-opacity="0.5"/>
<line x1="565" y1="82" x2="560" y2="100" stroke="#f39c12" stroke-width="1" stroke-opacity="0.5"/>
<line x1="560" y1="100" x2="580" y2="105" stroke="#f39c12" stroke-width="1" stroke-opacity="0.5"/>
<line x1="560" y1="100" x2="545" y2="115" stroke="#f39c12" stroke-width="1" stroke-opacity="0.5"/>
<line x1="535" y1="90" x2="545" y2="115" stroke="#f39c12" stroke-width="1" stroke-opacity="0.5"/>
<text x="555" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">molecules, social</text>
<text x="555" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">symmetry: node perm.</text>
<text x="555" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">arch: GNN</text>
<!-- 5. Manifolds -->
<rect x="640" y="45" width="140" height="155" rx="10" fill="#9b59b6" fill-opacity="0.06" stroke="#9b59b6" stroke-width="1.5"/>
<text x="710" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#9b59b6">Manifolds</text>
<ellipse cx="710" cy="100" rx="35" ry="22" fill="none" stroke="#9b59b6" stroke-width="1.5"/>
<path d="M 678,94 Q 710,82 742,94" fill="none" stroke="#9b59b6" stroke-width="0.8" stroke-dasharray="3,2"/>
<path d="M 685,108 Q 710,120 735,108" fill="none" stroke="#9b59b6" stroke-width="0.8" stroke-dasharray="3,2"/>
<text x="710" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#9b59b6">surfaces, meshes</text>
<text x="710" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">symmetry: gauge/diffeo.</text>
<text x="710" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">arch: mesh CNN</text>
<text x="400" y="212" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#666">Every neural architecture exploits the symmetry of one of these five domains</text>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

+126
View File
@@ -0,0 +1,126 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 350" width="800" height="350" font-family="Arial, sans-serif">
<defs>
<marker id="fl-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#666"/>
</marker>
<marker id="fl-arrow-green" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#27ae60"/>
</marker>
<marker id="fl-arrow-purple" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#9b59b6"/>
</marker>
</defs>
<!-- Title -->
<text x="400" y="24" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Flamingo Architecture</text>
<!-- === Input at bottom === -->
<text x="400" y="340" font-size="10" fill="#666" text-anchor="middle">Input: Image₁ Text₁ Image₂ Text₂ ... (interleaved sequence)</text>
<!-- Input tokens -->
<rect x="180" y="305" width="44" height="20" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<text x="202" y="319" font-size="8" fill="#3498db" text-anchor="middle">Image₁</text>
<rect x="230" y="305" width="40" height="20" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<text x="250" y="319" font-size="8" fill="#e74c3c" text-anchor="middle">Text₁</text>
<rect x="276" y="305" width="44" height="20" rx="3" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1"/>
<text x="298" y="319" font-size="8" fill="#3498db" text-anchor="middle">Image₂</text>
<rect x="326" y="305" width="40" height="20" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<text x="346" y="319" font-size="8" fill="#e74c3c" text-anchor="middle">Text₂</text>
<!-- === Frozen Vision Encoder (left side) === -->
<rect x="30" y="180" width="140" height="55" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="100" y="202" font-size="11" fill="#333" text-anchor="middle">Vision Encoder</text>
<text x="100" y="218" font-size="9" fill="#666" text-anchor="middle">(NFNet / ViT)</text>
<!-- Snowflake frozen indicator -->
<text x="155" y="195" font-size="14" fill="#3498db">&#10052;</text>
<text x="50" y="250" font-size="9" fill="#3498db" text-anchor="middle">Frozen</text>
<!-- Arrow from Vision Encoder to Perceiver Resampler -->
<line x1="100" y1="180" x2="100" y2="155" stroke="#3498db" stroke-width="1.5" marker-end="url(#fl-arrow)"/>
<!-- Perceiver Resampler -->
<rect x="30" y="105" width="140" height="48" rx="8" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="100" y="125" font-size="10" fill="#333" text-anchor="middle">Perceiver</text>
<text x="100" y="139" font-size="10" fill="#333" text-anchor="middle">Resampler</text>
<!-- Visual tokens output from perceiver -->
<line x1="170" y1="128" x2="220" y2="128" stroke="#27ae60" stroke-width="1.5" marker-end="url(#fl-arrow-green)"/>
<!-- Visual tokens (small squares) -->
<rect x="225" y="120" width="10" height="10" rx="2" fill="#27ae60" fill-opacity="0.5" stroke="none"/>
<rect x="237" y="120" width="10" height="10" rx="2" fill="#27ae60" fill-opacity="0.5" stroke="none"/>
<rect x="249" y="120" width="10" height="10" rx="2" fill="#27ae60" fill-opacity="0.5" stroke="none"/>
<rect x="261" y="120" width="10" height="10" rx="2" fill="#27ae60" fill-opacity="0.5" stroke="none"/>
<text x="248" y="145" font-size="8" fill="#27ae60" text-anchor="middle">fixed-length</text>
<text x="248" y="155" font-size="8" fill="#27ae60" text-anchor="middle">visual tokens</text>
<!-- === Main LM stack (center-right) === -->
<!-- LM Block 1 (bottom) -->
<rect x="380" y="265" width="180" height="32" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="470" y="285" font-size="10" fill="#333" text-anchor="middle">LM Block 1</text>
<text x="550" y="285" font-size="10" fill="#f39c12">&#10052;</text>
<!-- Gated Cross-Attention 1 -->
<rect x="395" y="235" width="150" height="24" rx="5" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="1.2"/>
<text x="470" y="251" font-size="9" fill="#9b59b6" text-anchor="middle">Gated Cross-Attention</text>
<!-- Arrow from visual tokens to cross attention 1 -->
<line x1="271" y1="125" x2="393" y2="247" stroke="#27ae60" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#fl-arrow-purple)"/>
<!-- Arrow LM1 to xattn1 -->
<line x1="470" y1="265" x2="470" y2="261" stroke="#666" stroke-width="1"/>
<!-- LM Block 2 -->
<rect x="380" y="200" width="180" height="32" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="470" y="220" font-size="10" fill="#333" text-anchor="middle">LM Block 2</text>
<text x="550" y="220" font-size="10" fill="#f39c12">&#10052;</text>
<!-- Arrow xattn1 to LM2 -->
<line x1="470" y1="235" x2="470" y2="234" stroke="#666" stroke-width="1"/>
<!-- Gated Cross-Attention 2 -->
<rect x="395" y="168" width="150" height="24" rx="5" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="1.2"/>
<text x="470" y="184" font-size="9" fill="#9b59b6" text-anchor="middle">Gated Cross-Attention</text>
<!-- Arrow from visual tokens to cross attention 2 -->
<line x1="271" y1="125" x2="393" y2="180" stroke="#27ae60" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#fl-arrow-purple)"/>
<!-- LM Block 3 -->
<rect x="380" y="133" width="180" height="32" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="470" y="153" font-size="10" fill="#333" text-anchor="middle">LM Block 3</text>
<text x="550" y="153" font-size="10" fill="#f39c12">&#10052;</text>
<!-- LM Block 4 -->
<rect x="380" y="95" width="180" height="32" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="470" y="115" font-size="10" fill="#333" text-anchor="middle">LM Block 4</text>
<text x="550" y="115" font-size="10" fill="#f39c12">&#10052;</text>
<!-- Connecting arrows between blocks -->
<line x1="470" y1="200" x2="470" y2="194" stroke="#666" stroke-width="1"/>
<line x1="470" y1="168" x2="470" y2="167" stroke="#666" stroke-width="1"/>
<line x1="470" y1="133" x2="470" y2="129" stroke="#666" stroke-width="1"/>
<!-- Output arrow -->
<line x1="470" y1="95" x2="470" y2="62" stroke="#666" stroke-width="1.5" marker-end="url(#fl-arrow)"/>
<!-- Output text -->
<rect x="420" y="40" width="100" height="22" rx="5" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.2"/>
<text x="470" y="55" font-size="10" fill="#27ae60" text-anchor="middle" font-weight="bold">Generated Text</text>
<!-- Legend -->
<rect x="620" y="85" width="12" height="12" rx="2" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1"/>
<text x="638" y="95" font-size="9" fill="#666">Frozen LM blocks</text>
<rect x="620" y="105" width="12" height="12" rx="2" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="1"/>
<text x="638" y="115" font-size="9" fill="#666">Trained xattn layers</text>
<rect x="620" y="125" width="12" height="12" rx="2" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1"/>
<text x="638" y="135" font-size="9" fill="#666">Trained resampler</text>
<text x="624" y="155" font-size="12" fill="#3498db">&#10052;</text>
<text x="638" y="155" font-size="9" fill="#666">= Frozen weights</text>
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

+69
View File
@@ -0,0 +1,69 @@
<svg width="700" height="260" xmlns="http://www.w3.org/2000/svg">
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Focal Loss: Down-Weighting Easy Examples</text>
<!-- Axes -->
<line x1="80" y1="200" x2="400" y2="200" stroke="#333" stroke-width="1.5"/>
<line x1="80" y1="200" x2="80" y2="45" stroke="#333" stroke-width="1.5"/>
<!-- Y axis label -->
<text x="40" y="120" fill="#333" font-size="10" text-anchor="middle" transform="rotate(-90, 40, 120)">Loss</text>
<!-- X axis label -->
<text x="240" y="225" fill="#333" font-size="10" text-anchor="middle">Probability of correct class (p_t)</text>
<!-- X axis ticks -->
<text x="80" y="215" fill="#666" font-size="8" text-anchor="middle">0</text>
<text x="160" y="215" fill="#666" font-size="8" text-anchor="middle">0.25</text>
<text x="240" y="215" fill="#666" font-size="8" text-anchor="middle">0.5</text>
<text x="320" y="215" fill="#666" font-size="8" text-anchor="middle">0.75</text>
<text x="400" y="215" fill="#666" font-size="8" text-anchor="middle">1.0</text>
<!-- Y axis ticks -->
<text x="72" y="200" fill="#666" font-size="8" text-anchor="end">0</text>
<text x="72" y="122" fill="#666" font-size="8" text-anchor="end">2.5</text>
<text x="72" y="50" fill="#666" font-size="8" text-anchor="end">5</text>
<!-- CE curve (gamma=0): -log(pt) -->
<!-- Points: pt=0.05→3.0, pt=0.2→1.6, pt=0.4→0.9, pt=0.6→0.5, pt=0.8→0.22, pt=1.0→0 -->
<polyline points="96,55 112,82 128,100 160,120 192,142 224,155 256,165 288,175 320,184 352,190 384,196 400,200"
fill="none" stroke="#e74c3c" stroke-width="2.5"/>
<text x="110" y="52" fill="#e74c3c" font-size="9" font-weight="bold">γ = 0 (CE)</text>
<!-- Focal loss gamma=1 -->
<polyline points="96,90 112,112 128,128 160,148 192,162 224,172 256,180 288,188 320,193 352,197 384,199 400,200"
fill="none" stroke="#f39c12" stroke-width="2"/>
<text x="140" y="95" fill="#f39c12" font-size="9" font-weight="bold">γ = 1</text>
<!-- Focal loss gamma=2 -->
<polyline points="96,120 112,138 128,150 160,165 192,176 224,184 256,190 288,194 320,197 352,199 384,200 400,200"
fill="none" stroke="#27ae60" stroke-width="2"/>
<text x="155" y="140" fill="#27ae60" font-size="9" font-weight="bold">γ = 2</text>
<!-- Focal loss gamma=5 -->
<polyline points="96,155 112,165 128,172 160,182 192,189 224,194 256,197 288,199 320,200 352,200 384,200 400,200"
fill="none" stroke="#3498db" stroke-width="2"/>
<text x="170" y="168" fill="#3498db" font-size="9" font-weight="bold">γ = 5</text>
<!-- Annotation: easy examples region -->
<rect x="300" y="35" width="110" height="35" rx="4" fill="#27ae60" opacity="0.1" stroke="#27ae60" stroke-width="1" stroke-dasharray="3,2"/>
<text x="355" y="50" fill="#27ae60" font-size="8" text-anchor="middle">Easy examples</text>
<text x="355" y="62" fill="#27ae60" font-size="8" text-anchor="middle">(high p_t): loss → 0</text>
<!-- Right side explanation -->
<rect x="430" y="45" width="255" height="100" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="558" y="65" fill="#333" font-size="10" text-anchor="middle" font-weight="bold">FL(p_t) = −α_t(1−p_t)^γ log(p_t)</text>
<text x="445" y="85" fill="#666" font-size="9" text-anchor="start">• γ = 0: standard cross-entropy</text>
<text x="445" y="100" fill="#666" font-size="9" text-anchor="start">• γ = 2: well-classified examples</text>
<text x="453" y="113" fill="#666" font-size="9" text-anchor="start">contribute ~100× less loss</text>
<text x="445" y="130" fill="#666" font-size="9" text-anchor="start">• Focuses training on hard examples</text>
<!-- Bottom note -->
<rect x="430" y="155" width="255" height="45" rx="6" fill="#f5f5f5" stroke="#e74c3c" stroke-width="1"/>
<text x="558" y="172" fill="#333" font-size="9" text-anchor="middle" font-weight="bold">The core one-stage detector problem:</text>
<text x="558" y="186" fill="#666" font-size="9" text-anchor="middle">~100,000 anchors, but only ~10 are objects.</text>
<text x="558" y="198" fill="#666" font-size="9" text-anchor="middle">Easy negatives overwhelm the loss → focal loss.</text>
<!-- Formula for bottom -->
<rect x="100" y="238" width="500" height="18" rx="4" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="251" fill="#666" font-size="9" text-anchor="middle">Higher γ → more aggressive down-weighting of easy examples. RetinaNet uses γ=2, α=0.25.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

+96
View File
@@ -0,0 +1,96 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="fpn-arrow" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#555"/>
</marker>
<marker id="fpn-arrow-green" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#27ae60"/>
</marker>
<marker id="fpn-arrow-purple" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#9b59b6"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Feature Pyramid Network (FPN)</text>
<!-- Labels -->
<text x="120" y="48" fill="#3498db" font-size="11" font-weight="bold" text-anchor="middle">Bottom-Up</text>
<text x="120" y="62" fill="#3498db" font-size="9" text-anchor="middle">(backbone)</text>
<text x="350" y="48" fill="#9b59b6" font-size="11" font-weight="bold" text-anchor="middle">Lateral</text>
<text x="350" y="62" fill="#9b59b6" font-size="9" text-anchor="middle">(1×1 conv)</text>
<text x="530" y="48" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Top-Down</text>
<text x="530" y="62" fill="#27ae60" font-size="9" text-anchor="middle">(+ upsample)</text>
<!-- Bottom-up pathway (left) -->
<!-- C2: large -->
<rect x="50" y="75" width="140" height="30" rx="3" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="95" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C2 (H/4 × W/4)</text>
<!-- Arrow down -->
<line x1="120" y1="105" x2="120" y2="125" stroke="#3498db" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<!-- C3 -->
<rect x="65" y="130" width="110" height="30" rx="3" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="150" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C3 (H/8 × W/8)</text>
<!-- Arrow down -->
<line x1="120" y1="160" x2="120" y2="180" stroke="#3498db" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<!-- C4 -->
<rect x="80" y="185" width="80" height="30" rx="3" fill="#3498db" opacity="0.18" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="205" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C4 (H/16)</text>
<!-- Arrow down -->
<line x1="120" y1="215" x2="120" y2="235" stroke="#3498db" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<!-- C5 -->
<rect x="90" y="240" width="60" height="30" rx="3" fill="#3498db" opacity="0.22" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="260" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C5 (H/32)</text>
<!-- Lateral connections (1x1 conv arrows) -->
<line x1="190" y1="90" x2="380" y2="90" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<line x1="175" y1="145" x2="380" y2="145" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<line x1="160" y1="200" x2="380" y2="200" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<line x1="150" y1="255" x2="380" y2="255" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<!-- Top-down pathway + FPN outputs (right) -->
<!-- P5 -->
<rect x="460" y="240" width="60" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="490" y="260" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P5</text>
<!-- Merge node + P4 -->
<circle cx="420" y="200" r="8" fill="#fff" stroke="#f39c12" stroke-width="1.5"/>
<text x="420" y="204" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">+</text>
<line x1="490" y1="240" x2="420" y2="210" stroke="#27ae60" stroke-width="1.2" marker-end="url(#fpn-arrow-green)"/>
<text x="465" y="228" fill="#27ae60" font-size="7" text-anchor="middle">2× up</text>
<line x1="430" y1="200" x2="458" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<rect x="460" y="185" width="80" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="500" y="205" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P4</text>
<!-- Merge node + P3 -->
<circle cx="420" y="145" r="8" fill="#fff" stroke="#f39c12" stroke-width="1.5"/>
<text x="420" y="149" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">+</text>
<line x1="490" y1="185" x2="420" y2="155" stroke="#27ae60" stroke-width="1.2" marker-end="url(#fpn-arrow-green)"/>
<text x="465" y="173" fill="#27ae60" font-size="7" text-anchor="middle">2× up</text>
<line x1="430" y1="145" x2="458" y2="145" stroke="#555" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<rect x="460" y="130" width="110" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="515" y="150" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P3</text>
<!-- Merge node + P2 -->
<circle cx="420" y="90" r="8" fill="#fff" stroke="#f39c12" stroke-width="1.5"/>
<text x="420" y="94" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">+</text>
<line x1="500" y1="130" x2="420" y2="100" stroke="#27ae60" stroke-width="1.2" marker-end="url(#fpn-arrow-green)"/>
<text x="470" y="118" fill="#27ae60" font-size="7" text-anchor="middle">2× up</text>
<line x1="430" y1="90" x2="458" y2="90" stroke="#555" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<rect x="460" y="75" width="140" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="530" y="95" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P2</text>
<!-- Detection labels on right -->
<text x="635" y="95" fill="#666" font-size="8" text-anchor="start">← small objects</text>
<text x="605" y="150" fill="#666" font-size="8" text-anchor="start">← medium</text>
<text x="575" y="205" fill="#666" font-size="8" text-anchor="start">← medium</text>
<text x="535" y="260" fill="#666" font-size="8" text-anchor="start">← large objects</text>
<!-- Bottom note -->
<rect x="100" y="278" width="500" height="18" rx="4" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="291" fill="#666" font-size="9" text-anchor="middle">Each pyramid level has strong semantics (from top-down path) and good spatial resolution (from bottom-up).</text>
</svg>

After

Width:  |  Height:  |  Size: 6.5 KiB

+64
View File
@@ -0,0 +1,64 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 220" width="750" height="220">
<defs>
<marker id="fd-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<text x="375" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Fraud Detection: Real-Time Pipeline</text>
<!-- Transaction -->
<rect x="20" y="55" width="80" height="45" rx="8" fill="#555" fill-opacity="0.1" stroke="#555" stroke-width="1.5"/>
<text x="60" y="75" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#555">Transaction</text>
<text x="60" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#555">$249, NYC</text>
<line x1="100" y1="77" x2="128" y2="77" stroke="#666" stroke-width="1.5" marker-end="url(#fd-arr)"/>
<!-- Feature Pipeline -->
<rect x="136" y="42" width="120" height="70" rx="10" fill="#3498db" fill-opacity="0.1" stroke="#3498db" stroke-width="1.5"/>
<text x="196" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Feature Pipeline</text>
<text x="196" y="76" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">user history</text>
<text x="196" y="87" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">velocity (5 txns/5min)</text>
<text x="196" y="98" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">device, location delta</text>
<text x="196" y="108" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">~10ms</text>
<line x1="256" y1="77" x2="284" y2="77" stroke="#666" stroke-width="1.5" marker-end="url(#fd-arr)"/>
<!-- ML Model -->
<rect x="292" y="50" width="100" height="55" rx="10" fill="#f39c12" fill-opacity="0.1" stroke="#f39c12" stroke-width="1.5"/>
<text x="342" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">ML Model</text>
<text x="342" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">P(fraud) = 0.82</text>
<text x="342" y="98" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#f39c12">~5ms</text>
<line x1="392" y1="77" x2="420" y2="77" stroke="#666" stroke-width="1.5" marker-end="url(#fd-arr)"/>
<!-- Decision Engine -->
<rect x="428" y="42" width="100" height="70" rx="10" fill="#9b59b6" fill-opacity="0.1" stroke="#9b59b6" stroke-width="1.5"/>
<text x="478" y="62" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">Decision</text>
<text x="478" y="76" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">Engine</text>
<text x="478" y="92" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#9b59b6">>0.9: block</text>
<text x="478" y="102" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#9b59b6">0.3-0.9: review</text>
<!-- Three outcomes -->
<line x1="528" y1="60" x2="580" y2="50" stroke="#27ae60" stroke-width="1.5" marker-end="url(#fd-arr)"/>
<line x1="528" y1="77" x2="580" y2="80" stroke="#f39c12" stroke-width="1.5" marker-end="url(#fd-arr)"/>
<line x1="528" y1="95" x2="580" y2="110" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#fd-arr)"/>
<rect x="588" y="38" width="70" height="25" rx="5" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="1"/>
<text x="623" y="55" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Allow</text>
<rect x="588" y="68" width="70" height="25" rx="5" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<text x="623" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Review</text>
<rect x="588" y="98" width="70" height="25" rx="5" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1"/>
<text x="623" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Block</text>
<!-- Human review feedback loop -->
<rect x="665" y="65" width="70" height="30" rx="5" fill="#9b59b6" fill-opacity="0.1" stroke="#9b59b6" stroke-width="1"/>
<text x="700" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#9b59b6">Human</text>
<path d="M 700,95 C 700,170 400,175 196,130" fill="none" stroke="#9b59b6" stroke-width="1.2" marker-end="url(#fd-arr)" stroke-dasharray="4,2"/>
<text x="450" y="168" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">labels → retrain</text>
<text x="375" y="200" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Total latency: ~15ms (well within 100ms payment processing window)</text>
<text x="375" y="215" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Human review creates feedback loop for continuous model improvement</text>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

+124
View File
@@ -0,0 +1,124 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 280" width="800" height="280">
<defs>
<marker id="arr-blue" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#3498db"/>
</marker>
<marker id="arr-red" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#e74c3c"/>
</marker>
<marker id="arr-green" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#27ae60"/>
</marker>
<marker id="arr-gray" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6 Z" fill="#666"/>
</marker>
</defs>
<!-- Title -->
<text x="400" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Fusion Strategies for Multimodal Learning</text>
<!-- Divider lines -->
<line x1="267" y1="32" x2="267" y2="275" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<line x1="533" y1="32" x2="533" y2="275" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<!-- ====== EARLY FUSION (left panel) ====== -->
<text x="134" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">Early Fusion</text>
<!-- Raw inputs -->
<rect x="64" y="230" width="58" height="30" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="93" y="249" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">Image</text>
<rect x="146" y="230" width="58" height="30" rx="6" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="175" y="249" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">Text</text>
<!-- Concat box -->
<rect x="74" y="190" width="120" height="26" rx="6" fill="#f39c12" fill-opacity="0.12" stroke="#f39c12" stroke-width="1.5"/>
<text x="134" y="207" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">Concatenate</text>
<!-- Arrows from inputs to concat -->
<line x1="93" y1="230" x2="110" y2="216" stroke="#666" stroke-width="1.2" marker-end="url(#arr-gray)"/>
<line x1="175" y1="230" x2="158" y2="216" stroke="#666" stroke-width="1.2" marker-end="url(#arr-gray)"/>
<!-- Shared model -->
<rect x="84" y="126" width="100" height="46" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="134" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Shared</text>
<text x="134" y="162" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Model</text>
<!-- Arrow concat to model -->
<line x1="134" y1="190" x2="134" y2="172" stroke="#3498db" stroke-width="1.5" marker-end="url(#arr-blue)"/>
<!-- Output -->
<rect x="99" y="72" width="70" height="30" rx="8" fill="#3498db" fill-opacity="0.25" stroke="#3498db" stroke-width="1.5"/>
<text x="134" y="91" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#3498db">Output</text>
<!-- Arrow model to output -->
<line x1="134" y1="126" x2="134" y2="102" stroke="#3498db" stroke-width="1.5" marker-end="url(#arr-blue)"/>
<!-- ====== MIDDLE FUSION (center panel) ====== -->
<text x="400" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e74c3c">Middle Fusion</text>
<!-- Two encoder boxes -->
<rect x="305" y="210" width="80" height="46" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="345" y="231" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Image</text>
<text x="345" y="244" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Encoder</text>
<rect x="415" y="210" width="80" height="46" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="455" y="231" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Text</text>
<text x="455" y="244" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Encoder</text>
<!-- Cross-Attention box -->
<rect x="350" y="142" width="100" height="40" rx="8" fill="#f39c12" fill-opacity="0.15" stroke="#f39c12" stroke-width="1.5"/>
<text x="400" y="160" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Cross-</text>
<text x="400" y="173" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">Attention</text>
<!-- Arrows from encoders to cross-attention -->
<line x1="345" y1="210" x2="375" y2="182" stroke="#666" stroke-width="1.2" marker-end="url(#arr-gray)"/>
<line x1="455" y1="210" x2="425" y2="182" stroke="#666" stroke-width="1.2" marker-end="url(#arr-gray)"/>
<!-- Output -->
<rect x="365" y="72" width="70" height="30" rx="8" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="1.5"/>
<text x="400" y="91" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#e74c3c">Output</text>
<!-- Arrow cross-attention to output -->
<line x1="400" y1="142" x2="400" y2="102" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#arr-red)"/>
<!-- ====== LATE FUSION (right panel) ====== -->
<text x="666" y="48" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#27ae60">Late Fusion</text>
<!-- Pipeline 1: Image -->
<rect x="575" y="220" width="70" height="36" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="610" y="236" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">Image</text>
<text x="610" y="248" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">Encoder</text>
<rect x="575" y="160" width="70" height="36" rx="8" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="610" y="176" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">Image</text>
<text x="610" y="188" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">Predictor</text>
<line x1="610" y1="220" x2="610" y2="196" stroke="#3498db" stroke-width="1.2" marker-end="url(#arr-blue)"/>
<!-- Pipeline 2: Text -->
<rect x="690" y="220" width="70" height="36" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="725" y="236" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">Text</text>
<text x="725" y="248" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">Encoder</text>
<rect x="690" y="160" width="70" height="36" rx="8" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="725" y="176" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">Text</text>
<text x="725" y="188" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">Predictor</text>
<line x1="725" y1="220" x2="725" y2="196" stroke="#e74c3c" stroke-width="1.2" marker-end="url(#arr-red)"/>
<!-- Combine box -->
<rect x="626" y="106" width="80" height="32" rx="8" fill="#27ae60" fill-opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="666" y="126" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Combine</text>
<!-- Arrows to combine -->
<line x1="610" y1="160" x2="642" y2="138" stroke="#666" stroke-width="1.2" marker-end="url(#arr-gray)"/>
<line x1="725" y1="160" x2="692" y2="138" stroke="#666" stroke-width="1.2" marker-end="url(#arr-gray)"/>
<!-- Final output -->
<rect x="631" y="60" width="70" height="30" rx="8" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="666" y="79" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#27ae60">Output</text>
<!-- Arrow combine to output -->
<line x1="666" y1="106" x2="666" y2="90" stroke="#27ae60" stroke-width="1.5" marker-end="url(#arr-green)"/>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

+52
View File
@@ -0,0 +1,52 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 230" width="700" height="230">
<defs>
<marker id="gat-arr" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<path d="M0,0 L7,2.5 L0,5 Z" fill="#666"/>
</marker>
</defs>
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">GCN (Fixed Weights) vs GAT (Learned Attention)</text>
<line x1="350" y1="35" x2="350" y2="220" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<!-- GCN (left) -->
<text x="175" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">GCN: Fixed by Degree</text>
<circle cx="175" cy="130" r="22" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="2"/>
<text x="175" y="135" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e74c3c">i</text>
<circle cx="80" cy="80" r="15" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<circle cx="270" cy="80" r="15" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<circle cx="80" cy="180" r="15" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="1.5"/>
<!-- Equal-width arrows (uniform weight) -->
<line x1="93" y1="90" x2="155" y2="118" stroke="#3498db" stroke-width="3" marker-end="url(#gat-arr)"/>
<line x1="257" y1="90" x2="195" y2="118" stroke="#3498db" stroke-width="3" marker-end="url(#gat-arr)"/>
<line x1="93" y1="172" x2="155" y2="142" stroke="#3498db" stroke-width="3" marker-end="url(#gat-arr)"/>
<text x="100" y="108" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">⅓</text>
<text x="250" y="108" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">⅓</text>
<text x="100" y="158" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">⅓</text>
<text x="175" y="215" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">all neighbours contribute equally</text>
<!-- GAT (right) -->
<text x="525" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#f39c12">GAT: Learned Attention</text>
<circle cx="525" cy="130" r="22" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="2"/>
<text x="525" y="135" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e74c3c">i</text>
<circle cx="430" cy="80" r="15" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="1.5"/>
<circle cx="620" cy="80" r="15" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="1.5"/>
<circle cx="430" cy="180" r="15" fill="#f39c12" fill-opacity="0.2" stroke="#f39c12" stroke-width="1.5"/>
<!-- Variable-width arrows -->
<line x1="443" y1="90" x2="505" y2="118" stroke="#f39c12" stroke-width="6" stroke-opacity="0.7" marker-end="url(#gat-arr)"/>
<line x1="607" y1="90" x2="545" y2="118" stroke="#f39c12" stroke-width="2" stroke-opacity="0.5" marker-end="url(#gat-arr)"/>
<line x1="443" y1="172" x2="505" y2="142" stroke="#f39c12" stroke-width="3.5" stroke-opacity="0.6" marker-end="url(#gat-arr)"/>
<text x="450" y="108" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#f39c12">0.6</text>
<text x="600" y="108" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">0.1</text>
<text x="450" y="158" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">0.3</text>
<text x="525" y="215" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">important neighbours get more weight</text>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

+43
View File
@@ -0,0 +1,43 @@
<svg width="420" height="120" xmlns="http://www.w3.org/2000/svg">
<!-- Original matrix -->
<path d="M 10,10 L 5,10 L 5,110 L 10,110" fill="none" stroke="#333" stroke-width="2"/>
<path d="M 100,10 L 105,10 L 105,110 L 100,110" fill="none" stroke="#333" stroke-width="2"/>
<text x="30" y="38" fill="#333" font-size="15">2</text>
<text x="57" y="38" fill="#333" font-size="15">1</text>
<text x="84" y="38" fill="#333" font-size="15">5</text>
<text x="30" y="68" fill="#333" font-size="15">4</text>
<text x="57" y="68" fill="#333" font-size="15">3</text>
<text x="84" y="68" fill="#333" font-size="15">7</text>
<text x="30" y="98" fill="#333" font-size="15">6</text>
<text x="57" y="98" fill="#333" font-size="15">5</text>
<text x="84" y="98" fill="#333" font-size="15">9</text>
<!-- Arrow 1 -->
<text x="130" y="60" fill="#333" font-size="18">→</text>
<text x="120" y="80" fill="#666" font-size="9">row ops</text>
<!-- REF -->
<path d="M 155,10 L 150,10 L 150,110 L 155,110" fill="none" stroke="#333" stroke-width="2"/>
<path d="M 245,10 L 250,10 L 250,110 L 245,110" fill="none" stroke="#333" stroke-width="2"/>
<text x="175" y="38" fill="#e74c3c" font-size="15" font-weight="bold">2</text>
<text x="202" y="38" fill="#333" font-size="15">1</text>
<text x="229" y="38" fill="#333" font-size="15">5</text>
<text x="175" y="68" fill="#ccc" font-size="15">0</text>
<text x="202" y="68" fill="#e74c3c" font-size="15" font-weight="bold">1</text>
<text x="229" y="68" fill="#333" font-size="15">-3</text>
<text x="175" y="98" fill="#ccc" font-size="15">0</text>
<text x="202" y="98" fill="#ccc" font-size="15">0</text>
<text x="229" y="98" fill="#e74c3c" font-size="15" font-weight="bold">-2</text>
<!-- Arrow 2 -->
<text x="275" y="60" fill="#333" font-size="18">→</text>
<text x="268" y="80" fill="#666" font-size="9">solve ↑</text>
<!-- Solution -->
<path d="M 305,10 L 300,10 L 300,110 L 305,110" fill="none" stroke="#333" stroke-width="2"/>
<path d="M 375,10 L 380,10 L 380,110 L 375,110" fill="none" stroke="#333" stroke-width="2"/>
<text x="320" y="38" fill="#333" font-size="14">x₁ = ?</text>
<text x="320" y="68" fill="#333" font-size="14">x₂ = ?</text>
<text x="320" y="98" fill="#27ae60" font-size="14" font-weight="bold">x₃ = 1</text>
<text x="300" y="118" fill="#666" font-size="9">back substitution: solve from bottom up</text>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

+135
View File
@@ -0,0 +1,135 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 280" width="800" height="280">
<defs>
<marker id="em-arr" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#333"/>
</marker>
<marker id="em-arr-both" markerWidth="8" markerHeight="6" refX="4" refY="3" orient="auto">
<path d="M0,3 L4,0 L8,3 L4,6 Z" fill="#333"/>
</marker>
</defs>
<!-- Title -->
<text x="400" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Evaluation Metrics for Generative Models</text>
<!-- Dividers -->
<line x1="267" y1="38" x2="267" y2="260" stroke="#ccc" stroke-width="0.8" stroke-dasharray="4,3"/>
<line x1="533" y1="38" x2="533" y2="260" stroke="#ccc" stroke-width="0.8" stroke-dasharray="4,3"/>
<!-- ==================== FID Panel (Left) ==================== -->
<text x="133" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#333">FID</text>
<text x="133" y="64" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Frechet Inception Distance</text>
<!-- Real distribution (blue blob) -->
<ellipse cx="90" cy="145" rx="55" ry="38" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="90" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Real</text>
<text x="90" y="154" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">Distribution</text>
<!-- Generated distribution (red blob) -->
<ellipse cx="180" cy="145" rx="55" ry="38" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="180" y="142" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#e74c3c">Generated</text>
<text x="180" y="154" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">Distribution</text>
<!-- Double-headed Frechet distance arrow -->
<line x1="90" y1="183" x2="180" y2="183" stroke="#333" stroke-width="1.5"/>
<polygon points="90,179 82,183 90,187" fill="#333"/>
<polygon points="180,179 188,183 180,187" fill="#333"/>
<text x="135" y="198" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#333">d_F</text>
<!-- Formulation -->
<text x="133" y="222" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">Compares mean + covariance</text>
<text x="133" y="234" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">of Inception features</text>
<!-- Good/Bad indicator -->
<rect x="55" y="244" width="155" height="18" rx="4" fill="#27ae60" fill-opacity="0.08" stroke="#27ae60" stroke-width="0.8"/>
<text x="133" y="257" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">Lower FID = better quality + diversity</text>
<!-- ==================== IS Panel (Middle) ==================== -->
<text x="400" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#333">IS</text>
<text x="400" y="64" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Inception Score</text>
<!-- Generated distribution blob -->
<ellipse cx="400" cy="125" rx="65" ry="30" fill="#9b59b6" fill-opacity="0.12" stroke="#9b59b6" stroke-width="1.2"/>
<text x="400" y="122" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#9b59b6">Generated</text>
<text x="400" y="134" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">Images</text>
<!-- Split arrow -->
<line x1="400" y1="155" x2="400" y2="168" stroke="#333" stroke-width="1.2"/>
<!-- Fork -->
<line x1="400" y1="168" x2="340" y2="185" stroke="#333" stroke-width="1.2" marker-end="url(#em-arr)"/>
<line x1="400" y1="168" x2="460" y2="185" stroke="#333" stroke-width="1.2" marker-end="url(#em-arr)"/>
<!-- Quality branch -->
<rect x="290" y="188" width="100" height="36" rx="6" fill="#3498db" fill-opacity="0.1" stroke="#3498db" stroke-width="1"/>
<text x="340" y="204" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#3498db">Quality</text>
<text x="340" y="216" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">p(y|x) is peaked</text>
<!-- Peaked distribution mini-chart -->
<line x1="305" y1="230" x2="375" y2="230" stroke="#ccc" stroke-width="0.5"/>
<path d="M325,230 Q330,230 335,225 Q340,210 345,225 Q350,230 355,230" fill="none" stroke="#3498db" stroke-width="1.2"/>
<text x="340" y="242" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#999">confident class</text>
<!-- Diversity branch -->
<rect x="410" y="188" width="100" height="36" rx="6" fill="#27ae60" fill-opacity="0.1" stroke="#27ae60" stroke-width="1"/>
<text x="460" y="204" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Diversity</text>
<text x="460" y="216" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">p(y) is uniform</text>
<!-- Flat distribution mini-chart -->
<line x1="425" y1="230" x2="495" y2="230" stroke="#ccc" stroke-width="0.5"/>
<line x1="430" y1="220" x2="430" y2="230" stroke="#27ae60" stroke-width="3" opacity="0.5"/>
<line x1="440" y1="220" x2="440" y2="230" stroke="#27ae60" stroke-width="3" opacity="0.5"/>
<line x1="450" y1="220" x2="450" y2="230" stroke="#27ae60" stroke-width="3" opacity="0.5"/>
<line x1="460" y1="220" x2="460" y2="230" stroke="#27ae60" stroke-width="3" opacity="0.5"/>
<line x1="470" y1="220" x2="470" y2="230" stroke="#27ae60" stroke-width="3" opacity="0.5"/>
<line x1="480" y1="220" x2="480" y2="230" stroke="#27ae60" stroke-width="3" opacity="0.5"/>
<line x1="490" y1="220" x2="490" y2="230" stroke="#27ae60" stroke-width="3" opacity="0.5"/>
<text x="460" y="242" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#999">many classes</text>
<!-- IS score note -->
<rect x="320" y="250" width="160" height="18" rx="4" fill="#f39c12" fill-opacity="0.08" stroke="#f39c12" stroke-width="0.8"/>
<text x="400" y="263" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#f39c12">Higher IS = better (quality x diversity)</text>
<!-- ==================== CLIPScore Panel (Right) ==================== -->
<text x="667" y="52" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#333">CLIPScore</text>
<text x="667" y="64" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#666">Text-Image Alignment</text>
<!-- Shared embedding space -->
<rect x="567" y="78" width="200" height="130" rx="8" fill="#1abc9c" fill-opacity="0.05" stroke="#1abc9c" stroke-width="1" stroke-dasharray="4,2"/>
<text x="667" y="94" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#1abc9c">Shared CLIP Embedding Space</text>
<!-- Image embedding point -->
<circle cx="620" cy="140" r="18" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="620" y="137" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">Image</text>
<text x="620" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">embed</text>
<!-- Text embedding point -->
<circle cx="715" cy="140" r="18" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="715" y="137" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">Text</text>
<text x="715" y="148" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#e74c3c">embed</text>
<!-- Cosine similarity arrow -->
<line x1="638" y1="140" x2="697" y2="140" stroke="#333" stroke-width="1.5"/>
<polygon points="638,136 630,140 638,144" fill="#333"/>
<polygon points="697,136 705,140 697,144" fill="#333"/>
<text x="667" y="133" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#333">cos(v, w)</text>
<!-- Small diagram showing alignment -->
<text x="667" y="178" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">Measures semantic alignment</text>
<text x="667" y="190" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">between generated image and prompt</text>
<!-- CLIPScore note -->
<rect x="587" y="244" width="160" height="18" rx="4" fill="#1abc9c" fill-opacity="0.08" stroke="#1abc9c" stroke-width="0.8"/>
<text x="667" y="257" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#1abc9c">Higher CLIPScore = better alignment</text>
<!-- Input labels under CLIPScore -->
<!-- Image input -->
<rect x="590" y="210" width="60" height="22" rx="4" fill="#3498db" fill-opacity="0.08" stroke="#3498db" stroke-width="0.8"/>
<text x="620" y="224" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#3498db">Gen. Image</text>
<!-- Text input -->
<rect x="685" y="210" width="60" height="22" rx="4" fill="#e74c3c" fill-opacity="0.08" stroke="#e74c3c" stroke-width="0.8"/>
<text x="715" y="224" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#e74c3c">Text Prompt</text>
<!-- Arrows from inputs to embeddings -->
<line x1="620" y1="210" x2="620" y2="158" stroke="#3498db" stroke-width="0.8" marker-end="url(#em-arr)"/>
<line x1="715" y1="210" x2="715" y2="158" stroke="#e74c3c" stroke-width="0.8" marker-end="url(#em-arr)"/>
</svg>

After

Width:  |  Height:  |  Size: 9.6 KiB

+109
View File
@@ -0,0 +1,109 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 320" width="750" height="320">
<text x="375" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">GPU Cluster: Node Architecture and Network Topology</text>
<!-- Single node detail -->
<rect x="30" y="45" width="320" height="130" rx="10" fill="#3498db" fill-opacity="0.04" stroke="#3498db" stroke-width="2"/>
<text x="190" y="65" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#3498db">GPU Server Node</text>
<!-- GPUs inside node -->
<rect x="45" y="78" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="63" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<rect x="85" y="78" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="103" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<rect x="125" y="78" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="143" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<rect x="165" y="78" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="183" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<rect x="215" y="78" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="233" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<rect x="255" y="78" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="273" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<rect x="295" y="78" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="313" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<!-- Hidden 8th GPU -->
<rect x="45" y="110" width="36" height="28" rx="4" fill="#27ae60" fill-opacity="0.25" stroke="#27ae60" stroke-width="1.5"/>
<text x="63" y="128" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#27ae60">H100</text>
<!-- NVLink label -->
<line x1="81" y1="92" x2="85" y2="92" stroke="#f39c12" stroke-width="2"/>
<line x1="121" y1="92" x2="125" y2="92" stroke="#f39c12" stroke-width="2"/>
<line x1="161" y1="92" x2="165" y2="92" stroke="#f39c12" stroke-width="2"/>
<line x1="201" y1="92" x2="215" y2="92" stroke="#f39c12" stroke-width="2"/>
<line x1="251" y1="92" x2="255" y2="92" stroke="#f39c12" stroke-width="2"/>
<line x1="291" y1="92" x2="295" y2="92" stroke="#f39c12" stroke-width="2"/>
<text x="190" y="152" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">NVLink: 900 GB/s per GPU (intra-node)</text>
<text x="190" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">8 × InfiniBand ports: 400 Gb/s each (inter-node)</text>
<!-- Cluster view (right) -->
<text x="560" y="50" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="#333">Fat Tree Network (Cluster)</text>
<!-- Spine switches -->
<rect x="480" y="65" width="40" height="20" rx="4" fill="#9b59b6" fill-opacity="0.2" stroke="#9b59b6" stroke-width="1.5"/>
<rect x="530" y="65" width="40" height="20" rx="4" fill="#9b59b6" fill-opacity="0.2" stroke="#9b59b6" stroke-width="1.5"/>
<rect x="580" y="65" width="40" height="20" rx="4" fill="#9b59b6" fill-opacity="0.2" stroke="#9b59b6" stroke-width="1.5"/>
<rect x="630" y="65" width="40" height="20" rx="4" fill="#9b59b6" fill-opacity="0.2" stroke="#9b59b6" stroke-width="1.5"/>
<text x="560" y="58" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">spine switches</text>
<!-- Leaf switches -->
<rect x="450" y="120" width="35" height="18" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="495" y="120" width="35" height="18" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="540" y="120" width="35" height="18" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="585" y="120" width="35" height="18" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="630" y="120" width="35" height="18" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<rect x="675" y="120" width="35" height="18" rx="3" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="1"/>
<text x="560" y="112" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">leaf switches</text>
<!-- Connections spine to leaf -->
<line x1="500" y1="85" x2="467" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="500" y1="85" x2="512" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="550" y1="85" x2="512" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="550" y1="85" x2="557" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="600" y1="85" x2="557" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="600" y1="85" x2="602" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="650" y1="85" x2="602" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="650" y1="85" x2="647" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="500" y1="85" x2="557" y2="120" stroke="#ccc" stroke-width="0.7"/>
<line x1="650" y1="85" x2="692" y2="120" stroke="#ccc" stroke-width="0.7"/>
<!-- GPU nodes -->
<rect x="445" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="472" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="502" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="532" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="562" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="592" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="622" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="652" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<rect x="682" y="155" width="25" height="18" rx="3" fill="#27ae60" fill-opacity="0.3" stroke="#27ae60" stroke-width="0.8"/>
<line x1="457" y1="155" x2="457" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="484" y1="155" x2="484" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="514" y1="155" x2="514" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="544" y1="155" x2="544" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="574" y1="155" x2="574" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="604" y1="155" x2="604" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="634" y1="155" x2="634" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="664" y1="155" x2="664" y2="138" stroke="#ccc" stroke-width="0.7"/>
<line x1="694" y1="155" x2="694" y2="138" stroke="#ccc" stroke-width="0.7"/>
<text x="560" y="188" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#27ae60">GPU nodes (8 GPUs each)</text>
<!-- Scale label -->
<rect x="50" y="210" width="650" height="90" rx="8" fill="#f5f5f5" stroke="#ddd" stroke-width="1"/>
<text x="375" y="232" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" font-weight="bold" fill="#333">Scale Examples</text>
<text x="170" y="252" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">Research: 64 GPUs (8 nodes)</text>
<text x="170" y="266" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">fine-tune 7B models</text>
<text x="375" y="252" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#f39c12">Production: 256-1024 GPUs</text>
<text x="375" y="266" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#f39c12">train 70B models</text>
<text x="580" y="252" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">Frontier: 16,000+ GPUs</text>
<text x="580" y="266" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#e74c3c">Llama 3, GPT-4 class</text>
<text x="375" y="290" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#666">MTBF at 16K GPUs: ~hours. Checkpointing + elastic training = survival.</text>
</svg>

After

Width:  |  Height:  |  Size: 9.2 KiB

+79
View File
@@ -0,0 +1,79 @@
<svg width="700" height="230" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="gc-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="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Grad-CAM: Gradient-weighted Class Activation Mapping</text>
<!-- Input image -->
<text x="60" y="48" fill="#666" font-size="10" text-anchor="middle">Input Image</text>
<rect x="20" y="55" width="80" height="80" rx="4" fill="#ddd" stroke="#999" stroke-width="1.5"/>
<!-- Simple "dog face" representation -->
<circle cx="45" cy="85" r="6" fill="#8B4513" opacity="0.6"/>
<circle cx="75" cy="85" r="6" fill="#8B4513" opacity="0.6"/>
<ellipse cx="60" cy="100" rx="8" ry="5" fill="#333" opacity="0.3"/>
<circle cx="60" cy="90" r="20" fill="none" stroke="#8B4513" stroke-width="1" opacity="0.5"/>
<!-- Arrow -->
<line x1="105" y1="95" x2="135" y2="95" stroke="#555" stroke-width="1.2" marker-end="url(#gc-arrow)"/>
<!-- CNN backbone -->
<rect x="140" y="55" width="80" height="80" rx="6" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="180" y="92" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">CNN</text>
<text x="180" y="106" fill="#3498db" font-size="9" text-anchor="middle">backbone</text>
<!-- Arrow to feature maps -->
<line x1="220" y1="95" x2="250" y2="95" stroke="#555" stroke-width="1.2" marker-end="url(#gc-arrow)"/>
<!-- Last conv feature maps (stack) -->
<text x="300" y="48" fill="#666" font-size="10" text-anchor="middle">Last Conv Maps</text>
<rect x="258" y="70" width="40" height="40" rx="3" fill="#f39c12" opacity="0.15" stroke="#f39c12" stroke-width="1"/>
<rect x="265" y="63" width="40" height="40" rx="3" fill="#f39c12" opacity="0.2" stroke="#f39c12" stroke-width="1"/>
<rect x="272" y="56" width="40" height="40" rx="3" fill="#f39c12" opacity="0.25" stroke="#f39c12" stroke-width="1.5"/>
<text x="292" y="80" fill="#f39c12" font-size="8" text-anchor="middle">A^k</text>
<!-- Gradient arrow (from class score) -->
<text x="355" y="155" fill="#e74c3c" font-size="9" text-anchor="middle" font-weight="bold">∂y^c / ∂A^k</text>
<line x1="355" y1="142" x2="355" y2="115" stroke="#e74c3c" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#gc-arrow)"/>
<!-- Class score -->
<rect x="330" y="55" width="50" height="40" rx="4" fill="#e74c3c" opacity="0.12" stroke="#e74c3c" stroke-width="1.5"/>
<text x="355" y="72" fill="#e74c3c" font-size="9" text-anchor="middle" font-weight="bold">y^c</text>
<text x="355" y="85" fill="#e74c3c" font-size="8" text-anchor="middle">= "dog"</text>
<!-- GAP + weight arrow -->
<line x1="312" y1="95" x2="330" y2="75" stroke="#555" stroke-width="1" marker-end="url(#gc-arrow)"/>
<!-- Weights alpha_k -->
<text x="420" y="48" fill="#666" font-size="10" text-anchor="middle">Weights</text>
<rect x="395" y="55" width="50" height="40" rx="4" fill="#9b59b6" opacity="0.12" stroke="#9b59b6" stroke-width="1.5"/>
<text x="420" y="73" fill="#9b59b6" font-size="9" text-anchor="middle" font-weight="bold">α_k</text>
<text x="420" y="86" fill="#9b59b6" font-size="8" text-anchor="middle">GAP(∇)</text>
<!-- Arrow: weighted combination -->
<line x1="445" y1="75" x2="478" y2="85" stroke="#555" stroke-width="1.2" marker-end="url(#gc-arrow)"/>
<!-- Weighted sum + ReLU -->
<rect x="483" y="55" width="80" height="80" rx="6" fill="#27ae60" opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="523" y="85" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">ReLU(Σ α_k A^k)</text>
<text x="523" y="100" fill="#27ae60" font-size="8" text-anchor="middle">Grad-CAM</text>
<text x="523" y="112" fill="#27ae60" font-size="8" text-anchor="middle">heatmap</text>
<!-- Arrow to overlay -->
<line x1="563" y1="95" x2="590" y2="95" stroke="#555" stroke-width="1.2" marker-end="url(#gc-arrow)"/>
<!-- Final overlay -->
<text x="645" y="48" fill="#666" font-size="10" text-anchor="middle">Overlay</text>
<rect x="600" y="55" width="80" height="80" rx="4" fill="#ddd" stroke="#999" stroke-width="1.5"/>
<!-- Heatmap overlay (warm region on the dog face) -->
<rect x="604" y="59" width="72" height="72" fill="#ddd"/>
<circle cx="640" cy="85" r="25" fill="#e74c3c" opacity="0.3"/>
<circle cx="640" cy="85" r="15" fill="#f39c12" opacity="0.4"/>
<circle cx="640" cy="85" r="8" fill="#f1c40f" opacity="0.5"/>
<!-- Bottom note -->
<rect x="100" y="175" width="500" height="45" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="192" fill="#333" font-size="10" text-anchor="middle">Grad-CAM backpropagates the class score to the last conv layer,</text>
<text x="350" y="207" fill="#333" font-size="10" text-anchor="middle">computes per-channel importance (α_k), and highlights the most relevant image regions.</text>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

+46
View File
@@ -0,0 +1,46 @@
<svg width="380" height="200" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="gc-r" markerWidth="6" markerHeight="4" refX="6" refY="2" orient="auto">
<path d="M0,0 L6,2 L0,4" fill="#e74c3c"/>
</marker>
</defs>
<text x="190" y="14" text-anchor="middle" fill="#333" font-size="12" font-weight="bold">Gradient vectors on contour lines</text>
<!-- Contour ellipses (representing f(x,y) = x² + y²) -->
<ellipse cx="160" cy="105" rx="25" ry="25" fill="none" stroke="#3498db" stroke-width="1.5"/>
<text x="188" y="100" fill="#3498db" font-size="9">c=1</text>
<ellipse cx="160" cy="105" rx="50" ry="50" fill="none" stroke="#3498db" stroke-width="1.2"/>
<text x="214" y="100" fill="#3498db" font-size="9">c=2</text>
<ellipse cx="160" cy="105" rx="75" ry="75" fill="none" stroke="#3498db" stroke-width="1"/>
<text x="238" y="100" fill="#3498db" font-size="9">c=3</text>
<ellipse cx="160" cy="105" rx="95" ry="95" fill="none" stroke="#3498db" stroke-width="0.8" stroke-dasharray="4"/>
<!-- Gradient arrows (pointing radially outward = uphill) -->
<line x1="185" y1="105" x2="210" y2="105" stroke="#e74c3c" stroke-width="2" marker-end="url(#gc-r)"/>
<line x1="160" y1="80" x2="160" y2="55" stroke="#e74c3c" stroke-width="2" marker-end="url(#gc-r)"/>
<line x1="135" y1="105" x2="110" y2="105" stroke="#e74c3c" stroke-width="2" marker-end="url(#gc-r)"/>
<line x1="160" y1="130" x2="160" y2="155" stroke="#e74c3c" stroke-width="2" marker-end="url(#gc-r)"/>
<!-- diagonal arrows -->
<line x1="178" y1="87" x2="198" y2="67" stroke="#e74c3c" stroke-width="1.8" marker-end="url(#gc-r)"/>
<line x1="142" y1="123" x2="122" y2="143" stroke="#e74c3c" stroke-width="1.8" marker-end="url(#gc-r)"/>
<line x1="178" y1="123" x2="198" y2="143" stroke="#e74c3c" stroke-width="1.8" marker-end="url(#gc-r)"/>
<line x1="142" y1="87" x2="122" y2="67" stroke="#e74c3c" stroke-width="1.8" marker-end="url(#gc-r)"/>
<!-- Center point -->
<circle cx="160" cy="105" r="3" fill="#333"/>
<text x="164" y="112" fill="#333" font-size="9">min</text>
<!-- Legend -->
<line x1="280" y1="60" x2="310" y2="60" stroke="#3498db" stroke-width="1.5"/>
<text x="315" y="63" fill="#3498db" font-size="10">contour lines</text>
<line x1="280" y1="80" x2="305" y2="80" stroke="#e74c3c" stroke-width="2" marker-end="url(#gc-r)"/>
<text x="315" y="83" fill="#e74c3c" font-size="10">∇f (gradient)</text>
<text x="310" y="120" fill="#666" font-size="10">gradient is always</text>
<text x="310" y="133" fill="#666" font-size="10">⊥ to contour lines</text>
<text x="310" y="150" fill="#27ae60" font-size="10">-∇f = downhill</text>
<text x="310" y="163" fill="#27ae60" font-size="10">(gradient descent)</text>
<text x="190" y="195" text-anchor="middle" fill="#666" font-size="10">for f(x,y) = x² + y², contours are circles, gradients point radially out</text>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

+50
View File
@@ -0,0 +1,50 @@
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="gd-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="none" stroke="#e74c3c" stroke-width="1.2"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Gradient Descent: Rolling Downhill on the Loss Surface</text>
<!-- Axes -->
<line x1="60" y1="250" x2="640" y2="250" stroke="#333" stroke-width="1.5"/>
<line x1="60" y1="250" x2="60" y2="40" stroke="#333" stroke-width="1.5"/>
<text x="350" y="275" fill="#666" font-size="11" text-anchor="middle">parameter w</text>
<text x="35" y="145" fill="#666" font-size="11" text-anchor="middle" transform="rotate(-90,35,145)">Loss L(w)</text>
<!-- Loss curve -->
<path d="M 80,80 C 110,65 140,55 170,80 C 200,105 220,170 260,200 C 300,230 320,240 360,240 C 400,240 420,230 440,210 C 460,190 480,165 510,155 C 540,150 560,155 580,170 C 600,185 620,200 640,210" fill="none" stroke="#3498db" stroke-width="2.5"/>
<!-- Global minimum marker -->
<circle cx="360" cy="240" r="4" fill="#27ae60"/>
<text x="360" y="260" fill="#27ae60" font-size="10" font-weight="bold" text-anchor="middle">global min</text>
<!-- Local minimum marker -->
<circle cx="520" cy="152" r="3" fill="#f39c12"/>
<text x="520" y="145" fill="#f39c12" font-size="9" text-anchor="middle">local min</text>
<!-- Ball 1: large learning rate (overshooting) -->
<circle cx="150" cy="68" r="8" fill="#e74c3c" opacity="0.8"/>
<line x1="158" y1="72" x2="250" y2="195" stroke="#e74c3c" stroke-width="1.5" stroke-dasharray="5,3" marker-end="url(#gd-arrow)"/>
<text x="148" y="55" fill="#e74c3c" font-size="10" font-weight="bold" text-anchor="middle">large lr</text>
<text x="210" y="115" fill="#e74c3c" font-size="9" transform="rotate(55,210,115)">big step</text>
<!-- Ball 2: good learning rate -->
<circle cx="260" cy="200" r="7" fill="#27ae60" opacity="0.8"/>
<circle cx="300" cy="228" r="6" fill="#27ae60" opacity="0.6"/>
<circle cx="330" cy="237" r="5" fill="#27ae60" opacity="0.5"/>
<line x1="267" y1="204" x2="296" y2="225" stroke="#27ae60" stroke-width="1.2" stroke-dasharray="3,2"/>
<line x1="306" y1="230" x2="326" y2="236" stroke="#27ae60" stroke-width="1.2" stroke-dasharray="3,2"/>
<text x="290" y="195" fill="#27ae60" font-size="10" font-weight="bold" text-anchor="middle">good lr</text>
<!-- Ball 3: small learning rate -->
<circle cx="480" cy="165" r="6" fill="#9b59b6" opacity="0.8"/>
<circle cx="488" cy="162" r="5" fill="#9b59b6" opacity="0.6"/>
<circle cx="495" cy="159" r="4.5" fill="#9b59b6" opacity="0.5"/>
<text x="488" y="183" fill="#9b59b6" font-size="10" font-weight="bold" text-anchor="middle">small lr</text>
<text x="488" y="195" fill="#9b59b6" font-size="9" text-anchor="middle">(slow, stuck)</text>
<!-- Update rule -->
<rect x="195" y="280" width="310" height="20" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="294" fill="#333" font-size="11" text-anchor="middle">w ← w - η · dL/dw (η = learning rate)</text>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

+57
View File
@@ -0,0 +1,57 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 650 200" width="650" height="200">
<text x="325" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">A Graph and its Adjacency Matrix</text>
<!-- Graph drawing -->
<circle cx="100" cy="80" r="16" fill="#3498db" fill-opacity="0.2" stroke="#3498db" stroke-width="2"/>
<text x="100" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#3498db">1</text>
<circle cx="190" cy="80" r="16" fill="#e74c3c" fill-opacity="0.2" stroke="#e74c3c" stroke-width="2"/>
<text x="190" y="85" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e74c3c">2</text>
<circle cx="145" cy="160" r="16" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="2"/>
<text x="145" y="165" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#27ae60">3</text>
<!-- Edges -->
<line x1="116" y1="80" x2="174" y2="80" stroke="#666" stroke-width="1.5"/>
<line x1="107" y1="95" x2="138" y2="145" stroke="#666" stroke-width="1.5"/>
<line x1="183" y1="95" x2="152" y2="145" stroke="#666" stroke-width="1.5"/>
<!-- Equals -->
<text x="270" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="20" fill="#666">=</text>
<!-- Matrix -->
<text x="320" y="70" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" fill="#666">A =</text>
<!-- Column headers -->
<text x="380" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">1</text>
<text x="420" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">2</text>
<text x="460" y="60" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">3</text>
<!-- Row headers -->
<text x="345" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#3498db">1</text>
<text x="345" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#e74c3c">2</text>
<text x="345" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" fill="#27ae60">3</text>
<!-- Brackets -->
<text x="358" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="50" fill="#333" font-weight="100">[</text>
<text x="482" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="50" fill="#333" font-weight="100">]</text>
<!-- Matrix entries -->
<text x="380" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#ccc">0</text>
<text x="420" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">1</text>
<text x="460" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">1</text>
<text x="380" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">1</text>
<text x="420" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#ccc">0</text>
<text x="460" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">1</text>
<text x="380" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">1</text>
<text x="420" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">1</text>
<text x="460" y="150" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#ccc">0</text>
<!-- Notes -->
<text x="540" y="90" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">A_ij = 1 if edge</text>
<text x="540" y="108" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">A_ij = 0 otherwise</text>
<text x="540" y="130" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">Symmetric (undirected)</text>
<text x="540" y="148" text-anchor="start" font-family="Arial, sans-serif" font-size="9" fill="#666">Diagonal = 0 (no self-loops)</text>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

+49
View File
@@ -0,0 +1,49 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 230" width="700" height="230">
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">Graph Laplacian: Measuring Signal Smoothness</text>
<line x1="350" y1="35" x2="350" y2="220" stroke="#ccc" stroke-width="1" stroke-dasharray="4,3"/>
<!-- Smooth signal (left) -->
<text x="175" y="50" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#27ae60">Smooth Signal (low x^T L x)</text>
<circle cx="100" cy="110" r="22" fill="#27ae60" fill-opacity="0.7" stroke="#1e8449" stroke-width="1.5"/>
<text x="100" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">0.9</text>
<circle cx="180" cy="90" r="22" fill="#27ae60" fill-opacity="0.8" stroke="#1e8449" stroke-width="1.5"/>
<text x="180" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">1.0</text>
<circle cx="250" cy="120" r="22" fill="#27ae60" fill-opacity="0.65" stroke="#1e8449" stroke-width="1.5"/>
<text x="250" y="125" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">0.8</text>
<circle cx="175" cy="170" r="22" fill="#27ae60" fill-opacity="0.75" stroke="#1e8449" stroke-width="1.5"/>
<text x="175" y="175" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">0.9</text>
<line x1="120" y1="105" x2="160" y2="95" stroke="#666" stroke-width="1.2"/>
<line x1="200" y1="95" x2="230" y2="115" stroke="#666" stroke-width="1.2"/>
<line x1="175" y1="110" x2="175" y2="148" stroke="#666" stroke-width="1.2"/>
<line x1="115" y1="125" x2="158" y2="160" stroke="#666" stroke-width="1.2"/>
<text x="175" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#27ae60">neighbours have similar values</text>
<!-- Non-smooth signal (right) -->
<text x="525" y="50" text-anchor="middle" font-family="Arial, sans-serif" font-size="12" font-weight="bold" fill="#e74c3c">Non-Smooth Signal (high x^T L x)</text>
<circle cx="450" cy="110" r="22" fill="#e74c3c" fill-opacity="0.8" stroke="#c0392b" stroke-width="1.5"/>
<text x="450" y="115" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">0.9</text>
<circle cx="530" cy="90" r="22" fill="#3498db" fill-opacity="0.5" stroke="#2980b9" stroke-width="1.5"/>
<text x="530" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">-0.8</text>
<circle cx="600" cy="120" r="22" fill="#e74c3c" fill-opacity="0.6" stroke="#c0392b" stroke-width="1.5"/>
<text x="600" y="125" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">0.7</text>
<circle cx="525" cy="170" r="22" fill="#3498db" fill-opacity="0.7" stroke="#2980b9" stroke-width="1.5"/>
<text x="525" y="175" text-anchor="middle" font-family="Arial, sans-serif" font-size="11" font-weight="bold" fill="white">-0.5</text>
<line x1="470" y1="105" x2="510" y2="95" stroke="#666" stroke-width="1.2"/>
<line x1="550" y1="95" x2="580" y2="115" stroke="#666" stroke-width="1.2"/>
<line x1="525" y1="110" x2="525" y2="148" stroke="#666" stroke-width="1.2"/>
<line x1="465" y1="125" x2="508" y2="160" stroke="#666" stroke-width="1.2"/>
<text x="525" y="210" text-anchor="middle" font-family="Arial, sans-serif" font-size="10" fill="#e74c3c">neighbours have very different values</text>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

+109
View File
@@ -0,0 +1,109 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250" width="700" height="250" font-family="Arial, sans-serif">
<defs>
<marker id="gc-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#666"/>
</marker>
<marker id="gc-arrow-green" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#27ae60"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="24" font-size="14" font-weight="bold" fill="#333" text-anchor="middle">Grounding via Coordinate Tokenisation</text>
<!-- Image with bounding boxes -->
<rect x="20" y="45" width="160" height="130" rx="4" fill="#f5f5f5" stroke="#ccc" stroke-width="1"/>
<!-- Sky region -->
<rect x="22" y="47" width="156" height="40" rx="2" fill="#3498db" fill-opacity="0.15"/>
<!-- Ground / grass -->
<rect x="22" y="87" width="156" height="86" rx="2" fill="#27ae60" fill-opacity="0.1"/>
<!-- Dog bounding box -->
<rect x="45" y="65" width="60" height="70" rx="2" fill="none" stroke="#e74c3c" stroke-width="2" stroke-dasharray="4,2"/>
<text x="75" y="108" font-size="10" fill="#e74c3c" text-anchor="middle" font-weight="bold">dog</text>
<!-- Bench bounding box -->
<rect x="115" y="90" width="55" height="40" rx="2" fill="none" stroke="#3498db" stroke-width="2" stroke-dasharray="4,2"/>
<text x="142" y="114" font-size="9" fill="#3498db" text-anchor="middle" font-weight="bold">bench</text>
<!-- Coordinate labels on dog box -->
<text x="38" y="62" font-size="7" fill="#e74c3c">(x1,y1)</text>
<text x="88" y="143" font-size="7" fill="#e74c3c">(x2,y2)</text>
<text x="100" y="192" font-size="9" fill="#666" text-anchor="middle">Image with detected objects</text>
<!-- Arrow from image to token sequence -->
<line x1="180" y1="110" x2="210" y2="110" stroke="#666" stroke-width="1.5" marker-end="url(#gc-arrow)"/>
<!-- Generated text with coordinate tokens -->
<text x="430" y="52" font-size="11" fill="#666" text-anchor="middle">Generated Token Sequence</text>
<!-- Row 1: "A [dog] <coords>" -->
<rect x="220" y="68" width="24" height="22" rx="4" fill="#999" fill-opacity="0.12" stroke="#999" stroke-width="1"/>
<text x="232" y="83" font-size="9" fill="#333" text-anchor="middle">A</text>
<rect x="250" y="68" width="38" height="22" rx="4" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="269" y="83" font-size="9" fill="#e74c3c" text-anchor="middle" font-weight="bold">dog</text>
<rect x="295" y="68" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="311" y="83" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;x1&gt;</text>
<rect x="332" y="68" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="348" y="83" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;y1&gt;</text>
<rect x="369" y="68" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="385" y="83" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;x2&gt;</text>
<rect x="406" y="68" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="422" y="83" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;y2&gt;</text>
<!-- Row 2: "sitting on a [bench] <coords>" -->
<rect x="220" y="100" width="50" height="22" rx="4" fill="#999" fill-opacity="0.12" stroke="#999" stroke-width="1"/>
<text x="245" y="115" font-size="9" fill="#333" text-anchor="middle">sitting</text>
<rect x="276" y="100" width="28" height="22" rx="4" fill="#999" fill-opacity="0.12" stroke="#999" stroke-width="1"/>
<text x="290" y="115" font-size="9" fill="#333" text-anchor="middle">on</text>
<rect x="310" y="100" width="20" height="22" rx="4" fill="#999" fill-opacity="0.12" stroke="#999" stroke-width="1"/>
<text x="320" y="115" font-size="9" fill="#333" text-anchor="middle">a</text>
<rect x="336" y="100" width="50" height="22" rx="4" fill="#3498db" fill-opacity="0.15" stroke="#3498db" stroke-width="1.2"/>
<text x="361" y="115" font-size="9" fill="#3498db" text-anchor="middle" font-weight="bold">bench</text>
<rect x="392" y="100" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="408" y="115" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;x1&gt;</text>
<rect x="429" y="100" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="445" y="115" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;y1&gt;</text>
<rect x="466" y="100" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="482" y="115" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;x2&gt;</text>
<rect x="503" y="100" width="32" height="22" rx="4" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="519" y="115" font-size="8" fill="#27ae60" text-anchor="middle" font-weight="bold">&lt;y2&gt;</text>
<!-- Arrow from dog bbox to dog coord tokens -->
<path d="M 105 100 C 160 70, 220 55, 311 68" fill="none" stroke="#e74c3c" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#gc-arrow)"/>
<!-- Arrow from bench bbox to bench coord tokens -->
<path d="M 170 110 C 220 130, 330 130, 408 122" fill="none" stroke="#3498db" stroke-width="1.2" stroke-dasharray="4,3" marker-end="url(#gc-arrow)"/>
<!-- Legend -->
<rect x="220" y="150" width="14" height="14" rx="3" fill="#999" fill-opacity="0.12" stroke="#999" stroke-width="1"/>
<text x="240" y="162" font-size="9" fill="#666">Text tokens</text>
<rect x="310" y="150" width="14" height="14" rx="3" fill="#27ae60" fill-opacity="0.2" stroke="#27ae60" stroke-width="1.2"/>
<text x="330" y="162" font-size="9" fill="#666">Coordinate tokens</text>
<rect x="440" y="150" width="14" height="14" rx="3" fill="#e74c3c" fill-opacity="0.15" stroke="#e74c3c" stroke-width="1.2"/>
<text x="460" y="162" font-size="9" fill="#666">Entity tokens</text>
<!-- Bottom description -->
<text x="350" y="195" font-size="9" fill="#999" text-anchor="middle">Coordinates are discretised into special vocabulary tokens (e.g., bins of 0-999)</text>
<text x="350" y="210" font-size="9" fill="#999" text-anchor="middle">enabling grounding as a natural text generation task</text>
<!-- Example models -->
<text x="350" y="238" font-size="9" fill="#666" text-anchor="middle">Models: Kosmos-2, Shikra, Qwen-VL, Ferret</text>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

+127
View File
@@ -0,0 +1,127 @@
<svg xmlns="http://www.w3.org/2000/svg" width="700" height="290">
<defs>
<marker id="arr3" viewBox="0 0 10 6" refX="10" refY="3" markerWidth="8" markerHeight="6" orient="auto">
<polygon points="0,0 10,3 0,6" fill="#666"/>
</marker>
</defs>
<!-- Title -->
<text x="350" y="22" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" font-weight="bold" fill="#333">HiFi-GAN Generator Structure</text>
<!-- ===== INPUT: Mel Spectrogram (narrow, tall) ===== -->
<rect x="20" y="55" width="50" height="100" rx="6" fill="#9b59b6" fill-opacity="0.15" stroke="#9b59b6" stroke-width="1.5"/>
<text x="45" y="98" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#9b59b6">Mel</text>
<text x="45" y="110" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#9b59b6">Spec</text>
<text x="45" y="122" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">80 ch</text>
<!-- Arrow -->
<line x1="70" y1="105" x2="90" y2="105" stroke="#666" stroke-width="1.2" marker-end="url(#arr3)"/>
<!-- ===== Upsample Block 1 ===== -->
<rect x="92" y="60" width="62" height="90" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="123" y="82" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">TransConv</text>
<text x="123" y="93" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">Upsample</text>
<text x="123" y="104" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">8x</text>
<!-- MRF block 1 -->
<rect x="97" y="109" width="52" height="34" rx="4" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1"/>
<text x="123" y="121" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#e74c3c">MRF</text>
<text x="123" y="131" text-anchor="middle" font-family="Arial, sans-serif" font-size="6" fill="#666">k=3,7,11</text>
<!-- Arrow -->
<line x1="154" y1="105" x2="176" y2="105" stroke="#666" stroke-width="1.2" marker-end="url(#arr3)"/>
<!-- ===== Upsample Block 2 ===== -->
<rect x="178" y="55" width="72" height="100" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="214" y="78" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">TransConv</text>
<text x="214" y="89" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">Upsample</text>
<text x="214" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">8x</text>
<!-- MRF block 2 -->
<rect x="185" y="106" width="58" height="40" rx="4" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1"/>
<text x="214" y="120" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#e74c3c">MRF</text>
<text x="214" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="6" fill="#666">k=3,7,11</text>
<text x="214" y="140" text-anchor="middle" font-family="Arial, sans-serif" font-size="6" fill="#666">d=1,3,5</text>
<!-- Arrow -->
<line x1="250" y1="105" x2="274" y2="105" stroke="#666" stroke-width="1.2" marker-end="url(#arr3)"/>
<!-- ===== Upsample Block 3 ===== -->
<rect x="276" y="50" width="82" height="110" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="317" y="73" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">TransConv</text>
<text x="317" y="84" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">Upsample</text>
<text x="317" y="95" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">2x</text>
<!-- MRF block 3 -->
<rect x="284" y="101" width="66" height="50" rx="4" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1"/>
<text x="317" y="116" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#e74c3c">MRF</text>
<!-- Parallel kernel paths -->
<rect x="289" y="121" width="16" height="12" rx="2" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="0.5"/>
<text x="297" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="5" fill="#e74c3c">k3</text>
<rect x="308" y="121" width="16" height="12" rx="2" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="0.5"/>
<text x="316" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="5" fill="#e74c3c">k7</text>
<rect x="327" y="121" width="18" height="12" rx="2" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="0.5"/>
<text x="336" y="130" text-anchor="middle" font-family="Arial, sans-serif" font-size="5" fill="#e74c3c">k11</text>
<text x="317" y="146" text-anchor="middle" font-family="Arial, sans-serif" font-size="6" fill="#666">sum outputs</text>
<!-- Arrow -->
<line x1="358" y1="105" x2="382" y2="105" stroke="#666" stroke-width="1.2" marker-end="url(#arr3)"/>
<!-- ===== Upsample Block 4 ===== -->
<rect x="384" y="47" width="90" height="116" rx="6" fill="#3498db" fill-opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="429" y="68" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">TransConv</text>
<text x="429" y="79" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" fill="#3498db">Upsample</text>
<text x="429" y="90" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">2x</text>
<!-- MRF block 4 -->
<rect x="392" y="97" width="74" height="56" rx="4" fill="#e74c3c" fill-opacity="0.12" stroke="#e74c3c" stroke-width="1"/>
<text x="429" y="112" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" font-weight="bold" fill="#e74c3c">MRF</text>
<rect x="397" y="117" width="18" height="12" rx="2" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="0.5"/>
<text x="406" y="126" text-anchor="middle" font-family="Arial, sans-serif" font-size="5" fill="#e74c3c">k3</text>
<rect x="419" y="117" width="18" height="12" rx="2" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="0.5"/>
<text x="428" y="126" text-anchor="middle" font-family="Arial, sans-serif" font-size="5" fill="#e74c3c">k7</text>
<rect x="441" y="117" width="18" height="12" rx="2" fill="#e74c3c" fill-opacity="0.25" stroke="#e74c3c" stroke-width="0.5"/>
<text x="450" y="126" text-anchor="middle" font-family="Arial, sans-serif" font-size="5" fill="#e74c3c">k11</text>
<text x="429" y="146" text-anchor="middle" font-family="Arial, sans-serif" font-size="6" fill="#666">sum outputs</text>
<!-- Arrow -->
<line x1="474" y1="105" x2="498" y2="105" stroke="#666" stroke-width="1.2" marker-end="url(#arr3)"/>
<!-- ===== Final Conv ===== -->
<rect x="500" y="72" width="65" height="66" rx="6" fill="#27ae60" fill-opacity="0.12" stroke="#27ae60" stroke-width="1.5"/>
<text x="532" y="96" text-anchor="middle" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#27ae60">Conv1d</text>
<text x="532" y="108" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">k=7</text>
<text x="532" y="119" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#27ae60">+ tanh</text>
<!-- Arrow -->
<line x1="565" y1="105" x2="589" y2="105" stroke="#666" stroke-width="1.2" marker-end="url(#arr3)"/>
<!-- ===== OUTPUT: Waveform (wide, shorter) ===== -->
<rect x="591" y="75" width="90" height="60" rx="6" fill="#27ae60" fill-opacity="0.18" stroke="#27ae60" stroke-width="1.5"/>
<text x="636" y="100" text-anchor="middle" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#27ae60">Waveform</text>
<text x="636" y="113" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">24 kHz audio</text>
<text x="636" y="125" text-anchor="middle" font-family="Arial, sans-serif" font-size="7" fill="#666">1-channel</text>
<!-- Waveform squiggle in output box -->
<polyline points="600,95 606,90 612,100 618,88 624,102 630,89 636,98 642,90 648,100 654,92 660,97 666,91 672,96" fill="none" stroke="#27ae60" stroke-width="0.8" stroke-opacity="0.4"/>
<!-- ===== MRF Explanation ===== -->
<rect x="20" y="175" width="310" height="55" rx="6" fill="#e74c3c" fill-opacity="0.06" stroke="#e74c3c" stroke-width="1" stroke-dasharray="3,2"/>
<text x="30" y="192" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#e74c3c">Multi-Receptive Field Fusion (MRF):</text>
<text x="30" y="204" font-family="Arial, sans-serif" font-size="8" fill="#666">Parallel ResBlocks with different kernel sizes (3, 7, 11) and</text>
<text x="30" y="216" font-family="Arial, sans-serif" font-size="8" fill="#666">dilation rates (1, 3, 5). Outputs summed to capture patterns at</text>
<text x="30" y="228" font-family="Arial, sans-serif" font-size="8" fill="#666">multiple temporal scales simultaneously.</text>
<!-- Upsample factor label -->
<rect x="345" y="175" width="170" height="55" rx="6" fill="#3498db" fill-opacity="0.06" stroke="#3498db" stroke-width="1" stroke-dasharray="3,2"/>
<text x="355" y="192" font-family="Arial, sans-serif" font-size="8" font-weight="bold" fill="#3498db">Transposed Convolution Upsampling:</text>
<text x="355" y="204" font-family="Arial, sans-serif" font-size="8" fill="#666">Total upsample factor = 8 x 8 x 2 x 2 = 256</text>
<text x="355" y="216" font-family="Arial, sans-serif" font-size="8" fill="#666">Matches hop_size=256 of mel transform.</text>
<text x="355" y="228" font-family="Arial, sans-serif" font-size="8" fill="#666">Each stage: LeakyReLU activation.</text>
<!-- Note box -->
<rect x="20" y="245" width="660" height="35" rx="6" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="35" y="260" font-family="Arial, sans-serif" font-size="9" font-weight="bold" fill="#333">Note:</text>
<text x="70" y="260" font-family="Arial, sans-serif" font-size="9" fill="#666">Multi-period + multi-scale discriminators train the generator adversarially. MPD captures periodic structures</text>
<text x="35" y="273" font-family="Arial, sans-serif" font-size="9" fill="#666">(pitch harmonics) while MSD evaluates audio quality at different time resolutions. Combined with mel loss for stability.</text>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

+68
View File
@@ -0,0 +1,68 @@
<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>

After

Width:  |  Height:  |  Size: 4.0 KiB

+45
View File
@@ -0,0 +1,45 @@
<svg width="420" height="380" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow-hx" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<path d="M0,0 L8,3 L0,6" fill="#999"/>
</marker>
</defs>
<!-- x-axis (height) — going bottom-left -->
<line x1="180" y1="300" x2="50" y2="360" stroke="#999" stroke-width="1.5" marker-end="url(#arrow-hx)"/>
<text x="20" y="375" fill="#999" font-size="12">height</text>
<!-- y-axis (weight) — going right -->
<line x1="180" y1="300" x2="400" y2="300" stroke="#999" stroke-width="1.5" marker-end="url(#arrow-hx)"/>
<text x="390" y="320" fill="#999" font-size="12">weight</text>
<!-- z-axis (age) — going up -->
<line x1="180" y1="300" x2="180" y2="40" stroke="#999" stroke-width="1.5" marker-end="url(#arrow-hx)"/>
<text x="185" y="35" fill="#999" font-size="12">age</text>
<!-- Alice: h=[165, 60, 28] -->
<!-- project: x=180-30=150, y_horiz=300+(-15)=285 shifted right by weight ~60 → ~210, z up by age ~28 -->
<line x1="180" y1="300" x2="148" y2="312" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="148" y1="312" x2="218" y2="312" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="218" y1="312" x2="218" y2="222" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="180" y1="300" x2="218" y2="222" stroke="#e74c3c" stroke-width="2"/>
<circle cx="218" cy="222" r="6" fill="#e74c3c"/>
<text x="228" y="218" fill="#e74c3c" font-size="12" font-weight="bold">Alice (165, 60, 28)</text>
<!-- Carol: h=[170, 65, 30] — close to Alice -->
<line x1="180" y1="300" x2="140" y2="316" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="140" y1="316" x2="230" y2="316" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="230" y1="316" x2="230" y2="206" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="180" y1="300" x2="230" y2="206" stroke="#2ecc71" stroke-width="2"/>
<circle cx="230" cy="206" r="6" fill="#2ecc71"/>
<text x="240" y="202" fill="#2ecc71" font-size="12" font-weight="bold">Carol (170, 65, 30)</text>
<!-- Bob: h=[185, 85, 45] — far from Alice -->
<line x1="180" y1="300" x2="120" y2="326" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="120" y1="326" x2="310" y2="326" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="310" y1="326" x2="310" y2="116" stroke="#ccc" stroke-width="0.8" stroke-dasharray="3,3"/>
<line x1="180" y1="300" x2="310" y2="116" stroke="#3498db" stroke-width="2"/>
<circle cx="310" cy="116" r="6" fill="#3498db"/>
<text x="320" y="112" fill="#3498db" font-size="12" font-weight="bold">Bob (185, 85, 45)</text>
<!-- origin -->
<circle cx="180" cy="300" r="3" fill="#333"/>
<text x="185" y="315" fill="#333" font-size="11">O</text>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

Some files were not shown because too many files have changed in this diff Show More