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

Function classesFromLabel

mnist-core/model.js:102–107  ·  view source on GitHub ↗
(y)

Source from the content-addressed store, hash-verified

100
101// Given a logits or label vector, return the class indices.
102export function classesFromLabel(y) {
103 const axis = 1;
104 const pred = y.argMax(axis);
105
106 return Array.from(pred.dataSync());
107}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected