"use client"; import { motion } from "framer-motion"; import { COLORS, VizFrame } from "./common"; /** Self-supervised pretext task: mask a patch, predict its pixels. */ export function MaskedPatch({ width = 640, height = 380, }: { width?: number; height?: number; }) { const N = 8; const cellW = 26; const padX = 22; const padY = 30; const ax = padX; const ay = padY; const bx = padX + N * cellW + 80; const by = padY; const masked = (i: number, j: number) => i >= 2 && i <= 4 && j >= 3 && j <= 5; return ( masked input model reconstruction {Array.from({ length: N * N }, (_, k) => { const i = Math.floor(k / N); const j = k % N; const v = (Math.sin(j * 0.6) + Math.cos(i * 0.7)) * 0.5 + 0.5; const isMask = masked(i, j); return ( {/* Left: masked input */} {/* Right: reconstruction with predicted patch fades in */} ); })} {/* Arrow */} encoder + decoder loss = ‖predicted_patch − true_patch‖² · no human labels needed ); }