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

Function plotAccuracy

mnist/ui.js:80–94  ·  view source on GitHub ↗
(batch, accuracy, set)

Source from the content-addressed store, hash-verified

78
79const accuracyValues = [[], []];
80export function plotAccuracy(batch, accuracy, set) {
81 const accuracyContainer = document.getElementById('accuracy-canvas');
82 const series = set === 'train' ? 0 : 1;
83 accuracyValues[series].push({x: batch, y: accuracy});
84 tfvis.render.linechart(
85 accuracyContainer,
86 {values: accuracyValues, series: ['train', 'validation']}, {
87 xLabel: 'Batch #',
88 yLabel: 'Accuracy',
89 width: 400,
90 height: 300,
91 });
92 accuracyLabelElement.innerText =
93 `last accuracy: ${(accuracy * 100).toFixed(1)}%`;
94}
95
96export function draw(image, canvas) {
97 const [width, height] = [28, 28];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected