MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / displayBatches

Function displayBatches

data-generator/ui.js:150–169  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

148 * third element is 1 if player 1 wins, 0 otherwise.
149 */
150export async function displayBatches(arr) {
151 toArrayContainerElement.textContent = '';
152 let i = 0;
153 for (const batch of arr) {
154 const oneKeyRow = document.createElement('div');
155 oneKeyRow.className = 'divTableRow';
156 oneKeyRow.align = 'left';
157 const featuresDiv = document.createElement('div');
158 const labelDiv = document.createElement('div');
159 // TODO(bileschi): Style this better.
160 featuresDiv.className = 'divTableCell';
161 labelDiv.className = 'divTableCell';
162 featuresDiv.textContent = batch.features;
163 labelDiv.textContent = batch.label
164 oneKeyRow.appendChild(featuresDiv);
165 oneKeyRow.appendChild(labelDiv);
166 // add the div child to updateSampleRowOutput
167 toArrayContainerElement.appendChild(oneKeyRow);
168 }
169};
170
171export function updatePredictionInputs() {
172 const container = document.getElementById('prediction-input');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected