MCPcopy Create free account
hub / github.com/DFin/Neural-Network-Visualisation / getSampleByIndex

Function getSampleByIndex

assets/main.js:121–129  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

119 return this.getSampleByIndex(randomIndex);
120 },
121 getSampleByIndex(index) {
122 if (!Number.isFinite(index) || index < 0 || index >= totalSamples) return null;
123 const pixels = normaliseSlice(index);
124 return {
125 index,
126 digit: labelBytes[index],
127 pixels,
128 };
129 },
130 };
131}
132

Callers

nothing calls this directly

Calls 1

normaliseSliceFunction · 0.85

Tested by

no test coverage detected