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

Function predict

mnist-core/model.js:93–99  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

91
92// Predict the digit number from a batch of input images.
93export function predict(x) {
94 const pred = tf.tidy(() => {
95 const axis = 1;
96 return model(x).argMax(axis);
97 });
98 return Array.from(pred.dataSync());
99}
100
101// Given a logits or label vector, return the class indices.
102export function classesFromLabel(y) {

Callers 2

prepUIFunction · 0.50
setPredictFunctionFunction · 0.50

Calls 1

modelFunction · 0.85

Tested by

no test coverage detected