Packages
Faber TWEANN - Topology and Weight Evolving Artificial Neural Networks
Current section
Files
Jump to
Current section
Files
assets/neuroevolution-cycle.svg
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 600">
<defs>
<linearGradient id="populationGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#2196F3;stop-opacity:1" />
<stop offset="100%" style="stop-color:#1565C0;stop-opacity:1" />
</linearGradient>
<linearGradient id="evaluationGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#4CAF50;stop-opacity:1" />
<stop offset="100%" style="stop-color:#2E7D32;stop-opacity:1" />
</linearGradient>
<linearGradient id="selectionGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#FF9800;stop-opacity:1" />
<stop offset="100%" style="stop-color:#E65100;stop-opacity:1" />
</linearGradient>
<linearGradient id="reproductionGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#9C27B0;stop-opacity:1" />
<stop offset="100%" style="stop-color:#6A1B9A;stop-opacity:1" />
</linearGradient>
<marker id="arrow" markerWidth="12" markerHeight="8" refX="10" refY="4" orient="auto">
<polygon points="0 0, 12 4, 0 8" fill="#666"/>
</marker>
<marker id="blueArrow" markerWidth="12" markerHeight="8" refX="10" refY="4" orient="auto">
<polygon points="0 0, 12 4, 0 8" fill="#2196F3"/>
</marker>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="2" dy="2" stdDeviation="3" flood-opacity="0.2"/>
</filter>
</defs>
<!-- Background -->
<rect width="900" height="600" fill="#f8f9fa"/>
<!-- Title -->
<text x="450" y="35" font-family="Arial, sans-serif" font-size="22" font-weight="bold" text-anchor="middle" fill="#333">
The Neuroevolution Cycle
</text>
<text x="450" y="55" font-family="Arial, sans-serif" font-size="12" text-anchor="middle" fill="#666">
Population-based optimization through iterative evaluation, selection, and reproduction
</text>
<!-- Central cycle arrows (large circular flow) -->
<path d="M 450 150 C 600 150 680 270 680 320" stroke="#ddd" stroke-width="40" fill="none" stroke-linecap="round"/>
<path d="M 680 320 C 680 370 600 490 450 490" stroke="#ddd" stroke-width="40" fill="none" stroke-linecap="round"/>
<path d="M 450 490 C 300 490 220 370 220 320" stroke="#ddd" stroke-width="40" fill="none" stroke-linecap="round"/>
<path d="M 220 320 C 220 270 300 150 450 150" stroke="#ddd" stroke-width="40" fill="none" stroke-linecap="round"/>
<!-- === POPULATION (Top) === -->
<rect x="320" y="80" width="260" height="100" rx="15" fill="url(#populationGrad)" filter="url(#shadow)"/>
<text x="450" y="115" font-family="Arial, sans-serif" font-size="16" font-weight="bold" text-anchor="middle" fill="white">
1. POPULATION
</text>
<text x="450" y="138" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="rgba(255,255,255,0.9)">
Collection of neural network genotypes
</text>
<!-- Small genome icons -->
<circle cx="360" cy="160" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="390" cy="160" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="420" cy="160" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="450" cy="160" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="480" cy="160" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="510" cy="160" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="540" cy="160" r="10" fill="rgba(255,255,255,0.3)"/>
<!-- Arrow 1→2 -->
<path d="M 585 130 Q 650 130 700 200" stroke="#4CAF50" stroke-width="4" fill="none" marker-end="url(#arrow)"/>
<text x="670" y="150" font-family="Arial, sans-serif" font-size="11" fill="#4CAF50" font-weight="bold">spawn</text>
<!-- === EVALUATION (Right) === -->
<rect x="620" y="220" width="250" height="120" rx="15" fill="url(#evaluationGrad)" filter="url(#shadow)"/>
<text x="745" y="255" font-family="Arial, sans-serif" font-size="16" font-weight="bold" text-anchor="middle" fill="white">
2. EVALUATION
</text>
<text x="745" y="280" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="rgba(255,255,255,0.9)">
Run phenotype in environment
</text>
<text x="745" y="298" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="rgba(255,255,255,0.9)">
Calculate fitness score
</text>
<!-- Fitness meter -->
<rect x="680" y="310" width="130" height="15" rx="3" fill="rgba(0,0,0,0.2)"/>
<rect x="680" y="310" width="95" height="15" rx="3" fill="rgba(255,255,255,0.6)"/>
<text x="745" y="321" font-family="Arial, sans-serif" font-size="9" text-anchor="middle" fill="#2E7D32">fitness: 0.73</text>
<!-- Arrow 2→3 -->
<path d="M 745 345 Q 745 420 680 470" stroke="#FF9800" stroke-width="4" fill="none" marker-end="url(#arrow)"/>
<text x="750" y="410" font-family="Arial, sans-serif" font-size="11" fill="#FF9800" font-weight="bold">rank</text>
<!-- === SELECTION (Bottom) === -->
<rect x="430" y="430" width="260" height="110" rx="15" fill="url(#selectionGrad)" filter="url(#shadow)"/>
<text x="560" y="465" font-family="Arial, sans-serif" font-size="16" font-weight="bold" text-anchor="middle" fill="white">
3. SELECTION
</text>
<text x="560" y="490" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="rgba(255,255,255,0.9)">
Tournament / Truncation
</text>
<!-- Selection visualization -->
<circle cx="470" cy="520" r="10" fill="rgba(255,255,255,0.7)"/>
<circle cx="500" cy="520" r="10" fill="rgba(255,255,255,0.7)"/>
<circle cx="530" cy="520" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="560" cy="520" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="590" cy="520" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="620" cy="520" r="10" fill="rgba(255,255,255,0.3)"/>
<circle cx="650" cy="520" r="10" fill="rgba(255,255,255,0.3)"/>
<text x="560" y="515" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="white">survivors</text>
<!-- Arrow 3→4 -->
<path d="M 425 490 Q 340 490 260 420" stroke="#9C27B0" stroke-width="4" fill="none" marker-end="url(#arrow)"/>
<text x="320" y="475" font-family="Arial, sans-serif" font-size="11" fill="#9C27B0" font-weight="bold">breed</text>
<!-- === REPRODUCTION (Left) === -->
<rect x="30" y="260" width="240" height="150" rx="15" fill="url(#reproductionGrad)" filter="url(#shadow)"/>
<text x="150" y="295" font-family="Arial, sans-serif" font-size="16" font-weight="bold" text-anchor="middle" fill="white">
4. REPRODUCTION
</text>
<!-- Mutation box -->
<rect x="50" y="310" width="100" height="45" rx="6" fill="rgba(255,255,255,0.2)"/>
<text x="100" y="330" font-family="Arial, sans-serif" font-size="10" font-weight="bold" text-anchor="middle" fill="white">Mutation</text>
<text x="100" y="345" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="rgba(255,255,255,0.8)">weights, topology</text>
<!-- Crossover box -->
<rect x="160" y="310" width="100" height="45" rx="6" fill="rgba(255,255,255,0.2)"/>
<text x="210" y="330" font-family="Arial, sans-serif" font-size="10" font-weight="bold" text-anchor="middle" fill="white">Crossover</text>
<text x="210" y="345" font-family="Arial, sans-serif" font-size="8" text-anchor="middle" fill="rgba(255,255,255,0.8)">gene alignment</text>
<!-- Elite preservation -->
<rect x="50" y="360" width="210" height="35" rx="6" fill="rgba(255,255,255,0.15)"/>
<text x="155" y="382" font-family="Arial, sans-serif" font-size="10" text-anchor="middle" fill="rgba(255,255,255,0.9)">
Elitism: best genotypes copied unchanged
</text>
<!-- Arrow 4→1 -->
<path d="M 150 255 Q 150 180 310 140" stroke="#2196F3" stroke-width="4" fill="none" marker-end="url(#blueArrow)"/>
<text x="200" y="190" font-family="Arial, sans-serif" font-size="11" fill="#2196F3" font-weight="bold">next gen</text>
<!-- Generation counter in center -->
<circle cx="450" cy="320" r="50" fill="white" stroke="#333" stroke-width="2" filter="url(#shadow)"/>
<text x="450" y="310" font-family="Arial, sans-serif" font-size="12" text-anchor="middle" fill="#666">Generation</text>
<text x="450" y="335" font-family="Arial, sans-serif" font-size="24" font-weight="bold" text-anchor="middle" fill="#333">N</text>
<!-- Side panels with details -->
<!-- Fitness Functions panel -->
<rect x="30" y="75" width="180" height="165" rx="8" fill="white" stroke="#4CAF50" stroke-width="1" filter="url(#shadow)"/>
<text x="120" y="100" font-family="Arial, sans-serif" font-size="12" font-weight="bold" text-anchor="middle" fill="#4CAF50">
Fitness Functions
</text>
<line x1="45" y1="110" x2="195" y2="110" stroke="#e0e0e0" stroke-width="1"/>
<text x="55" y="130" font-family="Arial, sans-serif" font-size="10" fill="#666">XOR accuracy</text>
<text x="55" y="148" font-family="Arial, sans-serif" font-size="10" fill="#666">Pole balance time</text>
<text x="55" y="166" font-family="Arial, sans-serif" font-size="10" fill="#666">T-maze completion</text>
<text x="55" y="184" font-family="Arial, sans-serif" font-size="10" fill="#666">Predator/prey survival</text>
<text x="55" y="202" font-family="Arial, sans-serif" font-size="10" fill="#666">Forex profit/Sharpe</text>
<text x="55" y="220" font-family="Arial, sans-serif" font-size="10" fill="#666">Custom evaluators...</text>
<!-- Mutation Types panel -->
<rect x="690" y="365" width="180" height="145" rx="8" fill="white" stroke="#9C27B0" stroke-width="1" filter="url(#shadow)"/>
<text x="780" y="390" font-family="Arial, sans-serif" font-size="12" font-weight="bold" text-anchor="middle" fill="#9C27B0">
Mutation Types
</text>
<line x1="705" y1="400" x2="855" y2="400" stroke="#e0e0e0" stroke-width="1"/>
<text x="715" y="420" font-family="Arial, sans-serif" font-size="10" fill="#666">• Weight perturbation</text>
<text x="715" y="438" font-family="Arial, sans-serif" font-size="10" fill="#666">• Add neuron</text>
<text x="715" y="456" font-family="Arial, sans-serif" font-size="10" fill="#666">• Add connection</text>
<text x="715" y="474" font-family="Arial, sans-serif" font-size="10" fill="#666">• Delete connection</text>
<text x="715" y="492" font-family="Arial, sans-serif" font-size="10" fill="#666">• Change activation fn</text>
<!-- Termination Criteria panel -->
<rect x="30" y="430" width="180" height="110" rx="8" fill="white" stroke="#FF5722" stroke-width="1" filter="url(#shadow)"/>
<text x="120" y="455" font-family="Arial, sans-serif" font-size="12" font-weight="bold" text-anchor="middle" fill="#FF5722">
Termination Criteria
</text>
<line x1="45" y1="465" x2="195" y2="465" stroke="#e0e0e0" stroke-width="1"/>
<text x="55" y="485" font-family="Arial, sans-serif" font-size="10" fill="#666">✓ Target fitness reached</text>
<text x="55" y="503" font-family="Arial, sans-serif" font-size="10" fill="#666">✓ Max generations</text>
<text x="55" y="521" font-family="Arial, sans-serif" font-size="10" fill="#666">✓ Fitness stagnation</text>
<!-- Bottom summary -->
<rect x="220" y="555" width="460" height="35" rx="6" fill="#e3f2fd" stroke="#2196F3" stroke-width="1"/>
<text x="450" y="577" font-family="Arial, sans-serif" font-size="11" text-anchor="middle" fill="#1565C0">
Each iteration improves the population. Over many generations, optimal neural network topologies emerge.
</text>
</svg>