MCPcopy Index your code
hub / github.com/tensorflow/tfjs / logMetrics

Method logMetrics

tfjs-node/src/callbacks.ts:277–293  ·  view source on GitHub ↗
(logs: Logs, prefix: string, step: number)

Source from the content-addressed store, hash-verified

275 }
276
277 private logMetrics(logs: Logs, prefix: string, step: number) {
278 for (const key in logs) {
279 if (key === 'batch' || key === 'size' || key === 'num_steps') {
280 continue;
281 }
282
283 const VAL_PREFIX = 'val_';
284 if (key.startsWith(VAL_PREFIX)) {
285 this.ensureValWriterCreated();
286 const scalarName = prefix + key.slice(VAL_PREFIX.length);
287 this.valWriter.scalar(scalarName, logs[key], step);
288 } else {
289 this.ensureTrainWriterCreated();
290 this.trainWriter.scalar(`${prefix}${key}`, logs[key], step);
291 }
292 }
293 }
294
295 private logWeights(step: number) {
296 for (const weights of this.model.weights) {

Callers 1

constructorMethod · 0.95

Calls 4

scalarMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected