File size: 35,166 Bytes
5a90c80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<title>Cells Among the Real Inputs</title>
<style>
  .viz-root { color-scheme: light;
    --surface-1:#fcfcfb; --page:#f9f9f7; --ink:#0b0b0b; --ink-2:#52514e; --muted:#898781; --grid:#e1e0d9; --axis:#c3c2b7; --ring:rgba(11,11,11,0.10);
    --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; }
  @media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .viz-root { color-scheme: dark;
    --surface-1:#1a1a19; --page:#0d0d0d; --ink:#ffffff; --ink-2:#c3c2b7; --muted:#898781; --grid:#2c2c2a; --axis:#383835; --ring:rgba(255,255,255,0.10);
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; } }
  :root[data-theme="dark"] .viz-root { color-scheme: dark;
    --surface-1:#1a1a19; --page:#0d0d0d; --ink:#ffffff; --ink-2:#c3c2b7; --muted:#898781; --grid:#2c2c2a; --axis:#383835; --ring:rgba(255,255,255,0.10);
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; }
  body { margin: 0; }
  .viz-root { background: var(--page); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; padding: 24px 20px 60px; }
  main { max-width: 1180px; margin: 0 auto; }
  h1 { font-size: 1.4rem; font-weight: 650; margin: 0 0 4px; }
  p.lede { color: var(--ink-2); max-width: 90ch; margin: 0 0 12px; }
  .controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 8px 0 12px; font-size: 0.9rem; color: var(--ink-2); }
  .controls button { font: inherit; color: var(--ink); background: var(--surface-1); border: 1px solid var(--ring); border-radius: 4px; padding: 3px 10px; cursor: pointer; }
  .controls button.on { background: var(--s1); color: #fff; border-color: var(--s1); }
  .row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
  @media (max-width: 860px) { .row { grid-template-columns: 1fr; } }
  .panel { background: var(--surface-1); border: 1px solid var(--ring); border-radius: 6px; padding: 10px 12px 8px; position: relative; }
  .panel h3 { font-size: 0.92rem; font-weight: 600; margin: 0 0 2px; }
  .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--ink-2); margin: 2px 0 6px; }
  .legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; }
  svg { display: block; width: 100%; height: auto; }
  .tip { position: absolute; pointer-events: none; background: var(--surface-1); border: 1px solid var(--ring); border-radius: 4px; padding: 6px 8px; font-size: 0.78rem; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,0.12); display: none; white-space: nowrap; z-index: 2; }
  .note { color: var(--ink-2); font-size: 0.86rem; max-width: 90ch; }
</style>
<div class="viz-root"><main>
<h1>Cells among the real inputs</h1>
<p class="lede">A graph on the 113 &times; 113 real pairs: two pairs are joined when the network gives them the same answer and a path between them holds that answer at every state. The edges tested are each pair's four lattice neighbours and two random pairs with the same answer; the connected components are the cells among the real inputs at three levels of the geometry, the torus of every frequency (each clock along its own shortest arc), the surface of real inputs, and the cut's space (straight chords). A missing edge can only split a component, so each count is an upper bound on the true number of cells that contain real inputs. The dashed line is the number of distinct answers the network gives, the count a network with one cell per answer would have.</p>
<div class="controls"><span id="tabs"></span></div>
<div class="row">
  <div class="panel" id="p-components"></div>
  <div class="panel" id="p-alone"></div>
</div>
<div class="row">
  <div class="panel" id="p-share"></div>
  <div class="panel" id="p-per"></div>
</div>
<p class="note" id="note"></p>
</main></div>
<script type="application/json" id="data">{"MLP":{"run":"mlp_p113_wd0.3_w512_d128_frac0.3_seed0","p":113,"frames":[{"step":0,"test_acc":0.0067,"train_acc":0.0084,"answers_given":108,"edges_tested":30413,"torus":{"components":899,"components_per_answer":8.324,"largest_component_share":0.9247,"alone":702,"edges_held":0.633},"surface":{"components":9678,"components_per_answer":89.611,"largest_component_share":0.0277,"alone":7972,"edges_held":0.1228},"chord":{"components":204,"components_per_answer":1.889,"largest_component_share":0.9924,"alone":99,"edges_held":0.8593}},{"step":4,"test_acc":0.0067,"train_acc":0.0084,"answers_given":101,"edges_tested":30729,"torus":{"components":652,"components_per_answer":6.455,"largest_component_share":0.9511,"alone":510,"edges_held":0.6555},"surface":{"components":9457,"components_per_answer":93.634,"largest_component_share":0.024,"alone":7482,"edges_held":0.1329},"chord":{"components":175,"components_per_answer":1.733,"largest_component_share":0.994,"alone":83,"edges_held":0.8693}},{"step":8,"test_acc":0.0067,"train_acc":0.0084,"answers_given":104,"edges_tested":30194,"torus":{"components":484,"components_per_answer":4.654,"largest_component_share":0.9665,"alone":354,"edges_held":0.7035},"surface":{"components":9659,"components_per_answer":92.875,"largest_component_share":0.0255,"alone":7753,"edges_held":0.1256},"chord":{"components":135,"components_per_answer":1.298,"largest_component_share":0.9975,"alone":35,"edges_held":0.9084}},{"step":13,"test_acc":0.0067,"train_acc":0.0084,"answers_given":108,"edges_tested":28613,"torus":{"components":415,"components_per_answer":3.843,"largest_component_share":0.9724,"alone":274,"edges_held":0.7434},"surface":{"components":10412,"components_per_answer":96.407,"largest_component_share":0.0275,"alone":8727,"edges_held":0.0954},"chord":{"components":127,"components_per_answer":1.176,"largest_component_share":0.9985,"alone":20,"edges_held":0.9474}},{"step":19,"test_acc":0.0067,"train_acc":0.0084,"answers_given":112,"edges_tested":28185,"torus":{"components":347,"components_per_answer":3.098,"largest_component_share":0.979,"alone":215,"edges_held":0.7733},"surface":{"components":10638,"components_per_answer":94.982,"largest_component_share":0.0275,"alone":9017,"edges_held":0.0872},"chord":{"components":121,"components_per_answer":1.08,"largest_component_share":0.9993,"alone":11,"edges_held":0.9629}},{"step":28,"test_acc":0.0067,"train_acc":0.0084,"answers_given":113,"edges_tested":27860,"torus":{"components":329,"components_per_answer":2.912,"largest_component_share":0.9818,"alone":203,"edges_held":0.7822},"surface":{"components":10865,"components_per_answer":96.15,"largest_component_share":0.0282,"alone":9358,"edges_held":0.0779},"chord":{"components":116,"components_per_answer":1.027,"largest_component_share":0.9998,"alone":3,"edges_held":0.9718}},{"step":40,"test_acc":0.0067,"train_acc":0.0084,"answers_given":113,"edges_tested":27645,"torus":{"components":382,"components_per_answer":3.381,"largest_component_share":0.9769,"alone":247,"edges_held":0.7484},"surface":{"components":11097,"components_per_answer":98.204,"largest_component_share":0.0285,"alone":9764,"edges_held":0.0698},"chord":{"components":123,"components_per_answer":1.088,"largest_component_share":0.9992,"alone":10,"edges_held":0.9634}},{"step":64,"test_acc":0.0067,"train_acc":0.0084,"answers_given":113,"edges_tested":27662,"torus":{"components":815,"components_per_answer":7.212,"largest_component_share":0.9358,"alone":616,"edges_held":0.6222},"surface":{"components":11280,"components_per_answer":99.823,"largest_component_share":0.031,"alone":10127,"edges_held":0.0621},"chord":{"components":156,"components_per_answer":1.381,"largest_component_share":0.9966,"alone":42,"edges_held":0.905}},{"step":93,"test_acc":0.0067,"train_acc":0.0084,"answers_given":113,"edges_tested":27647,"torus":{"components":1014,"components_per_answer":8.973,"largest_component_share":0.9165,"alone":786,"edges_held":0.5924},"surface":{"components":11170,"components_per_answer":98.85,"largest_component_share":0.0339,"alone":9972,"edges_held":0.0664},"chord":{"components":179,"components_per_answer":1.584,"largest_component_share":0.9948,"alone":65,"edges_held":0.8747}},{"step":134,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27615,"torus":{"components":1120,"components_per_answer":9.912,"largest_component_share":0.9027,"alone":856,"edges_held":0.5868},"surface":{"components":11133,"components_per_answer":98.522,"largest_component_share":0.0351,"alone":9937,"edges_held":0.0686},"chord":{"components":226,"components_per_answer":2.0,"largest_component_share":0.9908,"alone":109,"edges_held":0.857}},{"step":194,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27576,"torus":{"components":1129,"components_per_answer":9.991,"largest_component_share":0.9055,"alone":881,"edges_held":0.5806},"surface":{"components":11132,"components_per_answer":98.513,"largest_component_share":0.0354,"alone":9947,"edges_held":0.0685},"chord":{"components":202,"components_per_answer":1.788,"largest_component_share":0.9926,"alone":84,"edges_held":0.8469}},{"step":309,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27573,"torus":{"components":1198,"components_per_answer":10.602,"largest_component_share":0.8969,"alone":931,"edges_held":0.5725},"surface":{"components":11119,"components_per_answer":98.398,"largest_component_share":0.0355,"alone":9936,"edges_held":0.0693},"chord":{"components":247,"components_per_answer":2.186,"largest_component_share":0.9885,"alone":122,"edges_held":0.8364}},{"step":447,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27564,"torus":{"components":1307,"components_per_answer":11.566,"largest_component_share":0.8915,"alone":1045,"edges_held":0.5702},"surface":{"components":11114,"components_per_answer":98.354,"largest_component_share":0.0361,"alone":9934,"edges_held":0.0692},"chord":{"components":264,"components_per_answer":2.336,"largest_component_share":0.9872,"alone":139,"edges_held":0.8235}},{"step":647,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27553,"torus":{"components":1323,"components_per_answer":11.708,"largest_component_share":0.8886,"alone":1055,"edges_held":0.5633},"surface":{"components":11102,"components_per_answer":98.248,"largest_component_share":0.037,"alone":9935,"edges_held":0.0697},"chord":{"components":317,"components_per_answer":2.805,"largest_component_share":0.9832,"alone":194,"edges_held":0.8069}},{"step":936,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27560,"torus":{"components":1443,"components_per_answer":12.77,"largest_component_share":0.8756,"alone":1155,"edges_held":0.5563},"surface":{"components":11094,"components_per_answer":98.177,"largest_component_share":0.0372,"alone":9941,"edges_held":0.0709},"chord":{"components":330,"components_per_answer":2.92,"largest_component_share":0.9822,"alone":207,"edges_held":0.7996}},{"step":1355,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27549,"torus":{"components":1384,"components_per_answer":12.248,"largest_component_share":0.8849,"alone":1132,"edges_held":0.5644},"surface":{"components":11083,"components_per_answer":98.08,"largest_component_share":0.0378,"alone":9917,"edges_held":0.0718},"chord":{"components":294,"components_per_answer":2.602,"largest_component_share":0.9847,"alone":168,"edges_held":0.799}},{"step":2151,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27570,"torus":{"components":1308,"components_per_answer":11.575,"largest_component_share":0.8888,"alone":1025,"edges_held":0.572},"surface":{"components":11053,"components_per_answer":97.814,"largest_component_share":0.0377,"alone":9866,"edges_held":0.073},"chord":{"components":281,"components_per_answer":2.487,"largest_component_share":0.9859,"alone":159,"edges_held":0.8122}},{"step":3114,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27604,"torus":{"components":1251,"components_per_answer":11.071,"largest_component_share":0.8947,"alone":989,"edges_held":0.5824},"surface":{"components":11041,"components_per_answer":97.708,"largest_component_share":0.0377,"alone":9844,"edges_held":0.0736},"chord":{"components":271,"components_per_answer":2.398,"largest_component_share":0.9869,"alone":151,"edges_held":0.823}},{"step":4507,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27575,"torus":{"components":1163,"components_per_answer":10.292,"largest_component_share":0.9051,"alone":939,"edges_held":0.5913},"surface":{"components":11047,"components_per_answer":97.761,"largest_component_share":0.0375,"alone":9860,"edges_held":0.074},"chord":{"components":265,"components_per_answer":2.345,"largest_component_share":0.9875,"alone":145,"edges_held":0.8257}},{"step":6524,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27587,"torus":{"components":1148,"components_per_answer":10.159,"largest_component_share":0.9049,"alone":901,"edges_held":0.5936},"surface":{"components":11021,"components_per_answer":97.531,"largest_component_share":0.0382,"alone":9826,"edges_held":0.0748},"chord":{"components":272,"components_per_answer":2.407,"largest_component_share":0.9866,"alone":148,"edges_held":0.8289}},{"step":10357,"test_acc":0.0,"train_acc":1.0,"answers_given":113,"edges_tested":27582,"torus":{"components":1191,"components_per_answer":10.54,"largest_component_share":0.901,"alone":943,"edges_held":0.596},"surface":{"components":11033,"components_per_answer":97.637,"largest_component_share":0.0385,"alone":9876,"edges_held":0.0752},"chord":{"components":258,"components_per_answer":2.283,"largest_component_share":0.988,"alone":137,"edges_held":0.8275}},{"step":14992,"test_acc":0.0003,"train_acc":1.0,"answers_given":113,"edges_tested":27764,"torus":{"components":1238,"components_per_answer":10.956,"largest_component_share":0.8991,"alone":992,"edges_held":0.5915},"surface":{"components":10936,"components_per_answer":96.779,"largest_component_share":0.0409,"alone":9739,"edges_held":0.0805},"chord":{"components":282,"components_per_answer":2.496,"largest_component_share":0.9858,"alone":159,"edges_held":0.8208}},{"step":21701,"test_acc":0.0903,"train_acc":1.0,"answers_given":113,"edges_tested":28700,"torus":{"components":1746,"components_per_answer":15.451,"largest_component_share":0.8528,"alone":1451,"edges_held":0.5323},"surface":{"components":10357,"components_per_answer":91.655,"largest_component_share":0.047,"alone":8874,"edges_held":0.1023},"chord":{"components":1091,"components_per_answer":9.655,"largest_component_share":0.9099,"alone":859,"edges_held":0.6544}},{"step":31411,"test_acc":0.9979,"train_acc":1.0,"answers_given":113,"edges_tested":38027,"torus":{"components":116,"components_per_answer":1.027,"largest_component_share":0.9998,"alone":3,"edges_held":0.9908},"surface":{"components":130,"components_per_answer":1.15,"largest_component_share":0.9987,"alone":17,"edges_held":0.9838},"chord":{"components":518,"components_per_answer":4.584,"largest_component_share":0.9627,"alone":354,"edges_held":0.7049}},{"step":49300,"test_acc":1.0,"train_acc":1.0,"answers_given":113,"edges_tested":38066,"torus":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0},"surface":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0},"chord":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":0.9999}},{"step":67910,"test_acc":1.0,"train_acc":1.0,"answers_given":113,"edges_tested":38066,"torus":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0},"surface":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0},"chord":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0}},{"step":100000,"test_acc":1.0,"train_acc":1.0,"answers_given":113,"edges_tested":38066,"torus":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0},"surface":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0},"chord":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":1.0}}]},"Transformer":{"run":"tf_p113_d128_h4_m512_wd1.0_frac0.3_seed0","p":113,"frames":[{"step":0,"test_acc":0.0082,"train_acc":0.0086,"answers_given":11,"edges_tested":48047,"torus":{"components":33,"components_per_answer":3.0,"largest_component_share":0.9983,"alone":23,"edges_held":0.8612},"surface":{"components":3061,"components_per_answer":278.273,"largest_component_share":0.3916,"alone":1740,"edges_held":0.4168},"chord":{"components":15,"components_per_answer":1.364,"largest_component_share":0.9997,"alone":5,"edges_held":0.9862}},{"step":5,"test_acc":0.0075,"train_acc":0.0102,"answers_given":18,"edges_tested":44569,"torus":{"components":74,"components_per_answer":4.111,"largest_component_share":0.9952,"alone":52,"edges_held":0.8426},"surface":{"components":3551,"components_per_answer":197.278,"largest_component_share":0.3011,"alone":1949,"edges_held":0.3751},"chord":{"components":35,"components_per_answer":1.944,"largest_component_share":0.9984,"alone":16,"edges_held":0.9701}},{"step":10,"test_acc":0.0057,"train_acc":0.0188,"answers_given":58,"edges_tested":36342,"torus":{"components":227,"components_per_answer":3.914,"largest_component_share":0.985,"alone":161,"edges_held":0.7774},"surface":{"components":6144,"components_per_answer":105.931,"largest_component_share":0.0598,"alone":4027,"edges_held":0.2538},"chord":{"components":130,"components_per_answer":2.241,"largest_component_share":0.9921,"alone":68,"edges_held":0.9394}},{"step":16,"test_acc":0.0057,"train_acc":0.0308,"answers_given":81,"edges_tested":31564,"torus":{"components":577,"components_per_answer":7.123,"largest_component_share":0.9532,"alone":440,"edges_held":0.6789},"surface":{"components":8525,"components_per_answer":105.247,"largest_component_share":0.04,"alone":6514,"edges_held":0.1614},"chord":{"components":212,"components_per_answer":2.617,"largest_component_share":0.9854,"alone":117,"edges_held":0.8877}},{"step":25,"test_acc":0.005,"train_acc":0.053,"answers_given":103,"edges_tested":29774,"torus":{"components":1105,"components_per_answer":10.728,"largest_component_share":0.9,"alone":860,"edges_held":0.6032},"surface":{"components":9470,"components_per_answer":91.942,"largest_component_share":0.0397,"alone":7584,"edges_held":0.1226},"chord":{"components":281,"components_per_answer":2.728,"largest_component_share":0.9839,"alone":166,"edges_held":0.8245}},{"step":39,"test_acc":0.0069,"train_acc":0.089,"answers_given":112,"edges_tested":28485,"torus":{"components":2165,"components_per_answer":19.33,"largest_component_share":0.7841,"alone":1684,"edges_held":0.4812},"surface":{"components":10595,"components_per_answer":94.598,"largest_component_share":0.0283,"alone":9054,"edges_held":0.0824},"chord":{"components":581,"components_per_answer":5.188,"largest_component_share":0.9565,"alone":423,"edges_held":0.7051}},{"step":60,"test_acc":0.02,"train_acc":0.2321,"answers_given":113,"edges_tested":27250,"torus":{"components":5882,"components_per_answer":52.053,"largest_component_share":0.2712,"alone":4382,"edges_held":0.2642},"surface":{"components":11748,"components_per_answer":103.965,"largest_component_share":0.0235,"alone":10890,"edges_held":0.0409},"chord":{"components":2396,"components_per_answer":21.204,"largest_component_share":0.7539,"alone":1843,"edges_held":0.4562}},{"step":94,"test_acc":0.1055,"train_acc":0.5928,"answers_given":113,"edges_tested":27236,"torus":{"components":9222,"components_per_answer":81.611,"largest_component_share":0.0758,"alone":7447,"edges_held":0.1336},"surface":{"components":12200,"components_per_answer":107.965,"largest_component_share":0.02,"alone":11707,"edges_held":0.0224},"chord":{"components":6021,"components_per_answer":53.283,"largest_component_share":0.2753,"alone":4499,"edges_held":0.263}},{"step":134,"test_acc":0.2514,"train_acc":0.9319,"answers_given":113,"edges_tested":28855,"torus":{"components":9821,"components_per_answer":86.912,"largest_component_share":0.0585,"alone":8122,"edges_held":0.105},"surface":{"components":12121,"components_per_answer":107.265,"largest_component_share":0.0213,"alone":11558,"edges_held":0.0242},"chord":{"components":7252,"components_per_answer":64.177,"largest_component_share":0.1692,"alone":5540,"edges_held":0.1988}},{"step":209,"test_acc":0.248,"train_acc":0.9517,"answers_given":113,"edges_tested":28819,"torus":{"components":9815,"components_per_answer":86.858,"largest_component_share":0.059,"alone":8154,"edges_held":0.1052},"surface":{"components":12153,"components_per_answer":107.549,"largest_component_share":0.0207,"alone":11604,"edges_held":0.0231},"chord":{"components":7259,"components_per_answer":64.239,"largest_component_share":0.1735,"alone":5593,"edges_held":0.1992}},{"step":326,"test_acc":0.2465,"train_acc":0.9671,"answers_given":113,"edges_tested":28754,"torus":{"components":9753,"components_per_answer":86.31,"largest_component_share":0.0597,"alone":8065,"edges_held":0.1074},"surface":{"components":12219,"components_per_answer":108.133,"largest_component_share":0.0204,"alone":11725,"edges_held":0.0208},"chord":{"components":7154,"components_per_answer":63.31,"largest_component_share":0.1855,"alone":5540,"edges_held":0.203}},{"step":509,"test_acc":0.2527,"train_acc":0.9872,"answers_given":113,"edges_tested":28961,"torus":{"components":9468,"components_per_answer":83.788,"largest_component_share":0.0636,"alone":7711,"edges_held":0.1173},"surface":{"components":12121,"components_per_answer":107.265,"largest_component_share":0.0214,"alone":11553,"edges_held":0.0243},"chord":{"components":6705,"components_per_answer":59.336,"largest_component_share":0.2149,"alone":5066,"edges_held":0.2194}},{"step":795,"test_acc":0.2644,"train_acc":0.9997,"answers_given":113,"edges_tested":29056,"torus":{"components":9321,"components_per_answer":82.487,"largest_component_share":0.065,"alone":7549,"edges_held":0.1221},"surface":{"components":12105,"components_per_answer":107.124,"largest_component_share":0.0211,"alone":11523,"edges_held":0.0249},"chord":{"components":6331,"components_per_answer":56.027,"largest_component_share":0.2622,"alone":4759,"edges_held":0.2349}},{"step":1135,"test_acc":0.2672,"train_acc":1.0,"answers_given":113,"edges_tested":29011,"torus":{"components":9310,"components_per_answer":82.389,"largest_component_share":0.0675,"alone":7548,"edges_held":0.1226},"surface":{"components":12086,"components_per_answer":106.956,"largest_component_share":0.0215,"alone":11484,"edges_held":0.0255},"chord":{"components":6388,"components_per_answer":56.531,"largest_component_share":0.2494,"alone":4815,"edges_held":0.2321}},{"step":1772,"test_acc":0.2568,"train_acc":1.0,"answers_given":113,"edges_tested":28915,"torus":{"components":9273,"components_per_answer":82.062,"largest_component_share":0.0733,"alone":7538,"edges_held":0.1237},"surface":{"components":12115,"components_per_answer":107.212,"largest_component_share":0.0207,"alone":11525,"edges_held":0.0241},"chord":{"components":6356,"components_per_answer":56.248,"largest_component_share":0.2644,"alone":4806,"edges_held":0.2344}},{"step":2766,"test_acc":0.2709,"train_acc":1.0,"answers_given":113,"edges_tested":29043,"torus":{"components":9122,"components_per_answer":80.726,"largest_component_share":0.0734,"alone":7288,"edges_held":0.1283},"surface":{"components":12043,"components_per_answer":106.575,"largest_component_share":0.0222,"alone":11406,"edges_held":0.0267},"chord":{"components":6204,"components_per_answer":54.903,"largest_component_share":0.2635,"alone":4652,"edges_held":0.2366}},{"step":3613,"test_acc":0.2682,"train_acc":1.0,"answers_given":113,"edges_tested":29003,"torus":{"components":9531,"components_per_answer":84.345,"largest_component_share":0.0692,"alone":7807,"edges_held":0.115},"surface":{"components":12118,"components_per_answer":107.239,"largest_component_share":0.022,"alone":11561,"edges_held":0.0245},"chord":{"components":6551,"components_per_answer":57.973,"largest_component_share":0.2236,"alone":4921,"edges_held":0.2237}},{"step":5159,"test_acc":0.2665,"train_acc":1.0,"answers_given":113,"edges_tested":29063,"torus":{"components":9627,"components_per_answer":85.195,"largest_component_share":0.0666,"alone":7934,"edges_held":0.1111},"surface":{"components":12091,"components_per_answer":107.0,"largest_component_share":0.0226,"alone":11518,"edges_held":0.0253},"chord":{"components":6758,"components_per_answer":59.805,"largest_component_share":0.1953,"alone":5084,"edges_held":0.2156}},{"step":8053,"test_acc":0.2627,"train_acc":1.0,"answers_given":113,"edges_tested":29353,"torus":{"components":8736,"components_per_answer":77.31,"largest_component_share":0.0853,"alone":6891,"edges_held":0.1416},"surface":{"components":11804,"components_per_answer":104.46,"largest_component_share":0.0247,"alone":10997,"edges_held":0.0354},"chord":{"components":5634,"components_per_answer":49.858,"largest_component_share":0.3327,"alone":4276,"edges_held":0.2579}},{"step":11498,"test_acc":0.2686,"train_acc":1.0,"answers_given":113,"edges_tested":29516,"torus":{"components":8863,"components_per_answer":78.434,"largest_component_share":0.0817,"alone":7033,"edges_held":0.1372},"surface":{"components":11728,"components_per_answer":103.788,"largest_component_share":0.026,"alone":10869,"edges_held":0.0387},"chord":{"components":6130,"components_per_answer":54.248,"largest_component_share":0.2752,"alone":4651,"edges_held":0.2381}},{"step":15020,"test_acc":0.3015,"train_acc":1.0,"answers_given":113,"edges_tested":29570,"torus":{"components":7973,"components_per_answer":70.558,"largest_component_share":0.1311,"alone":6270,"edges_held":0.1686},"surface":{"components":11497,"components_per_answer":101.743,"largest_component_share":0.0258,"alone":10428,"edges_held":0.0471},"chord":{"components":5409,"components_per_answer":47.867,"largest_component_share":0.3526,"alone":4064,"edges_held":0.2666}},{"step":16418,"test_acc":0.4175,"train_acc":1.0,"answers_given":113,"edges_tested":30299,"torus":{"components":5997,"components_per_answer":53.071,"largest_component_share":0.3082,"alone":4664,"edges_held":0.2348},"surface":{"components":10897,"components_per_answer":96.434,"largest_component_share":0.0295,"alone":9386,"edges_held":0.0655},"chord":{"components":3946,"components_per_answer":34.92,"largest_component_share":0.558,"alone":3020,"edges_held":0.3232}},{"step":16900,"test_acc":0.6368,"train_acc":1.0,"answers_given":113,"edges_tested":32598,"torus":{"components":3462,"components_per_answer":30.637,"largest_component_share":0.6434,"alone":2795,"edges_held":0.3285},"surface":{"components":9376,"components_per_answer":82.973,"largest_component_share":0.0448,"alone":7100,"edges_held":0.1086},"chord":{"components":2372,"components_per_answer":20.991,"largest_component_share":0.7756,"alone":1932,"edges_held":0.3972}},{"step":17400,"test_acc":0.8938,"train_acc":1.0,"answers_given":113,"edges_tested":36246,"torus":{"components":850,"components_per_answer":7.522,"largest_component_share":0.9372,"alone":687,"edges_held":0.5502},"surface":{"components":3299,"components_per_answer":29.195,"largest_component_share":0.5589,"alone":2134,"edges_held":0.3067},"chord":{"components":577,"components_per_answer":5.106,"largest_component_share":0.9612,"alone":436,"edges_held":0.5694}},{"step":19619,"test_acc":0.9998,"train_acc":1.0,"answers_given":113,"edges_tested":38064,"torus":{"components":114,"components_per_answer":1.009,"largest_component_share":0.9999,"alone":1,"edges_held":0.9606},"surface":{"components":115,"components_per_answer":1.018,"largest_component_share":0.9998,"alone":2,"edges_held":0.9828},"chord":{"components":114,"components_per_answer":1.009,"largest_component_share":0.9999,"alone":1,"edges_held":0.7516}},{"step":29700,"test_acc":0.98,"train_acc":0.993,"answers_given":113,"edges_tested":37706,"torus":{"components":240,"components_per_answer":2.124,"largest_component_share":0.985,"alone":104,"edges_held":0.8409},"surface":{"components":755,"components_per_answer":6.681,"largest_component_share":0.9265,"alone":477,"edges_held":0.8151},"chord":{"components":988,"components_per_answer":8.743,"largest_component_share":0.8894,"alone":611,"edges_held":0.579}},{"step":40000,"test_acc":1.0,"train_acc":1.0,"answers_given":113,"edges_tested":38066,"torus":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":0.9618},"surface":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":0.9986},"chord":{"components":113,"components_per_answer":1.0,"largest_component_share":1.0,"alone":0,"edges_held":0.7264}}]}}</script>
<script>
(function () {
  const RUNS = JSON.parse(document.getElementById("data").textContent);
  const names = Object.keys(RUNS);
  const PATHS = ["torus", "surface", "chord"];
  const LABEL = {torus: "torus of every frequency", surface: "surface of real inputs", chord: "cut's space (chords)"};
  const COLOUR = ["var(--s1)", "var(--s2)", "var(--s3)"];
  let model = names[0];
  const $ = id => document.getElementById(id);
  const ns = "http://www.w3.org/2000/svg";
  const el = (tag, attrs, text) => { const e = document.createElementNS(ns, tag); for (const k in attrs) e.setAttribute(k, attrs[k]); if (text !== undefined) e.textContent = text; return e; };
  function tabs() {
    const wrap = $("tabs"); while (wrap.firstChild) wrap.removeChild(wrap.firstChild);
    names.forEach(nm => { const b = document.createElement("button"); b.textContent = nm; b.className = nm === model ? "on" : ""; b.onclick = () => { model = nm; tabs(); draw(); }; wrap.appendChild(b); });
  }
  function chart(container, title, series, yLabel, ylog, reference) {
    while (container.firstChild) container.removeChild(container.firstChild);
    const h = document.createElement("h3"); h.textContent = title; container.appendChild(h);
    const legend = document.createElement("div"); legend.className = "legend";
    series.forEach(s => { const e = document.createElement("span"); const sw = document.createElement("i"); sw.style.background = s.colour; if (s.dashed) { sw.style.background = "none"; sw.style.borderTop = "1px dashed var(--muted)"; sw.style.height = "0"; } e.appendChild(sw); e.appendChild(document.createTextNode(s.name)); legend.appendChild(e); });
    container.appendChild(legend);
    const W = 520, H = 210, ML = 50, MR = 12, MT = 10, MB = 30;
    const svg = el("svg", {viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": title});
    const xs = series[0].points.map(p => p[0]);
    const xmax = Math.max(...xs);
    const xOf = x => ML + Math.log10(x + 1) / Math.log10(xmax + 1) * (W - ML - MR);
    let vals = series.flatMap(s => s.points.map(p => p[1])).filter(v => ylog ? v > 0 : true);
    let lo = ylog ? Math.pow(10, Math.floor(Math.log10(Math.min(...vals)))) : 0, hi = ylog ? Math.pow(10, Math.ceil(Math.log10(Math.max(...vals)))) : Math.max(1, ...vals) * 1.05;
    const yOf = v => ylog ? MT + (1 - (Math.log10(Math.max(v, lo)) - Math.log10(lo)) / (Math.log10(hi) - Math.log10(lo))) * (H - MT - MB) : MT + (1 - v / hi) * (H - MT - MB);
    const ticks = ylog ? (() => { const t = []; for (let e = Math.log10(lo); e <= Math.log10(hi) + 1e-9; e++) t.push(Math.pow(10, e)); return t; })() : [0, hi / 2, hi];
    for (const t of ticks) { svg.appendChild(el("line", {x1: ML, x2: W - MR, y1: yOf(t), y2: yOf(t), stroke: "var(--grid)"})); svg.appendChild(el("text", {x: ML - 5, y: yOf(t) + 3, "text-anchor": "end", "font-size": 10, fill: "var(--muted)"}, ylog ? t.toLocaleString() : t.toFixed(hi <= 1 ? 2 : 0))); }
    for (const t of [0, 10, 100, 1000, 10000, 100000].filter(t => t <= xmax)) svg.appendChild(el("text", {x: xOf(t), y: H - MB + 14, "text-anchor": "middle", "font-size": 10, fill: "var(--muted)"}, t >= 1000 ? (t / 1000) + "k" : String(t)));
    svg.appendChild(el("line", {x1: ML, x2: W - MR, y1: H - MB, y2: H - MB, stroke: "var(--axis)"}));
    svg.appendChild(el("text", {x: 4, y: MT + 8, "font-size": 10, fill: "var(--muted)"}, yLabel));
    svg.appendChild(el("text", {x: W - MR, y: H - 4, "text-anchor": "end", "font-size": 10, fill: "var(--muted)"}, "training step"));
    series.forEach(s => {
      const d = s.points.map((p, j) => (j ? "L" : "M") + xOf(p[0]).toFixed(1) + " " + yOf(p[1]).toFixed(1)).join(" ");
      svg.appendChild(el("path", {d, fill: "none", stroke: s.dashed ? "var(--muted)" : s.colour, "stroke-width": s.dashed ? 1 : 2, "stroke-dasharray": s.dashed ? "4 3" : "", "stroke-linejoin": "round"}));
    });
    const cross = el("line", {x1: 0, x2: 0, y1: MT, y2: H - MB, stroke: "var(--muted)", opacity: 0}); svg.appendChild(cross);
    container.appendChild(svg);
    const tip = document.createElement("div"); tip.className = "tip"; container.appendChild(tip);
    svg.addEventListener("pointermove", ev => {
      const r = svg.getBoundingClientRect(); const x = (ev.clientX - r.left) / r.width * W;
      let best = 0, dist = Infinity; xs.forEach((v, i) => { const dd = Math.abs(xOf(v) - x); if (dd < dist) { dist = dd; best = i; } });
      cross.setAttribute("x1", xOf(xs[best])); cross.setAttribute("x2", xOf(xs[best])); cross.setAttribute("opacity", 0.8);
      while (tip.firstChild) tip.removeChild(tip.firstChild);
      const b = document.createElement("b"); b.textContent = "step " + xs[best].toLocaleString(); tip.appendChild(b);
      series.forEach(s => { const d = document.createElement("div"); d.textContent = s.name + ": " + (s.points[best] ? s.points[best][1].toLocaleString() : ""); tip.appendChild(d); });
      tip.style.display = "block"; tip.style.left = Math.min(ev.clientX - r.left + 12, r.width - 220) + "px"; tip.style.top = (ev.clientY - r.top - 10) + "px";
    });
    svg.addEventListener("pointerleave", () => { tip.style.display = "none"; cross.setAttribute("opacity", 0); });
  }
  function draw() {
    const run = RUNS[model], frames = run.frames;
    const seriesOf = key => PATHS.map((k, i) => ({name: LABEL[k], colour: COLOUR[i], points: frames.map(f => [f.step, f[k][key]])}));
    chart($("p-components"), "Number of cells among the 12,769 real pairs", [...seriesOf("components"), {name: "distinct answers given", dashed: true, points: frames.map(f => [f.step, f.answers_given])}], "cells (log)", true);
    chart($("p-alone"), "Pairs alone in their cell", seriesOf("alone"), "pairs", false);
    chart($("p-share"), "Share of pairs in the largest cell of their answer", seriesOf("largest_component_share"), "fraction", false);
    chart($("p-per"), "Cells per answer, mean over the answers given", seriesOf("components_per_answer"), "cells per answer (log)", true);
    const last = frames[frames.length - 1];
    $("note").textContent = "At the last checkpoint (step " + last.step.toLocaleString() + ") " + last.edges_tested.toLocaleString() + " same-answer edges were tested; the fraction held was " + PATHS.map(k => LABEL[k] + " " + (100 * last[k].edges_held).toFixed(1) + "%").join(", ") + ".";
  }
  tabs(); draw();
})();
</script>