SPB Git

Repository Public

demo-viz-ai.html 1.6 KB 15 lines html

1<!-- Banc d'essai de SK.viz (IA) : jetons, arcs d'attention calculés par SKN.attention, matrice, réseau, schéma d'architecture. -->2<div class="scene" data-bg="theme">3  <svg class="sk-art" viewBox="0 0 1920 1080"><g id="a"></g></svg>4</div>5<script>6var r = SKN.rng(4), n = 5, d = 4, Q = [], i, j; for (i = 0; i < n; i++) { Q.push([]); for (j = 0; j < d; j++) Q[i].push(r.normal()); }7var A = SKN.attention(Q, Q, Q);8var tk = SK.viz.tokens({ parent: "#a", x: 520, y: 300, tokens: ["Le", "chat", "dort", "au", "soleil"], at: 0.3 });9SK.viz.arcs({ tokens: tk, from: 2, weights: A.weights[2], at: 1.4 }); tk.highlight(2, { at: 1.3 });10var hm = SK.viz.heatmap({ parent: "#a", x: 180, y: 520, w: 420, h: 280, matrix: A.weights, rows: ["Le", "chat", "dort", "au", "soleil"], at: 2.0, values: true }); hm.focusRow(2, { at: 3.4 });11SK.viz.network({ parent: "#a", x: 760, y: 470, w: 440, h: 330, layers: [3, 5, 5, 2], at: 2.2, labels: ["Entrée", "", "", "Sortie"], pulses: { at: 3.6, count: 6 } });12SK.viz.flow({ parent: "#a", at: 3.0, nodes: [{ id: "u", x: 1420, y: 250, w: 300, h: 110, label: "Requête", icon: "#s-person" }, { id: "m", x: 1620, y: 480, w: 300, h: 110, label: "Modèle", sub: "inférence", color: "var(--gold)", icon: "#s-chip" }, { id: "d", x: 1420, y: 710, w: 300, h: 110, label: "Mémoire", color: "var(--s)", icon: "#s-database" }], edges: [{ from: "u", to: "m", packets: 4, loop: true }, { from: "m", to: "d", packets: 3, loop: true, dashed: true }] });13SK.provenance("Illustration — poids d'attention calculés sur des vecteurs aléatoires (graine 4)", { at: 2.2 });14</script>15
Files main
Menu

Theme