"use client"; import { motion } from "framer-motion"; import { COLORS, VizFrame } from "./common"; /** * Schematic adaptation of Figure 1 from "Deep Residual Learning" (He 2015): * a plain (no-skip) network gets *worse* as depth grows past โ‰ˆ 30 layers, * while a residual network keeps improving. */ export function ResNetDepth({ width = 760, height = 420, }: { width?: number; height?: number; }) { const padX = 70; const padY = 60; const innerW = width - padX * 2; const innerH = height - padY - 60; const xMax = 160; const yMax = 14; const sx = (x: number) => padX + (x / xMax) * innerW; const sy = (y: number) => padY + (1 - y / yMax) * innerH; // Synthetic but qualitatively faithful shapes. const depths = [18, 34, 50, 100, 152]; const plain = [9.0, 9.8, 10.7, 12.2, 13.4]; const resnet = [8.4, 7.6, 6.5, 5.6, 5.1]; const plainPath = `M ${depths.map((d, i) => `${sx(d)},${sy(plain[i])}`).join(" L ")}`; const resnetPath = `M ${depths.map((d, i) => `${sx(d)},${sy(resnet[i])}`).join(" L ")}`; return ( {/* Axes */} {[2, 4, 6, 8, 10, 12, 14].map((v) => ( {v}% ))} {[18, 34, 50, 100, 152].map((d) => ( {d} ))} depth (layers) test error {depths.map((d, i) => ( ))} {/* Legend */} plain โ€” gets worse with depth residual โ€” keeps improving schematic adaptation of He et al. 2015, Figure 1 ); }