MCPcopy
hub / github.com/tensorflow/tfjs / onBatchEnd

Method onBatchEnd

tfjs-layers/src/base_callbacks.ts:443–456  ·  view source on GitHub ↗
(batch: number, logs?: UnresolvedLogs)

Source from the content-addressed store, hash-verified

441 }
442
443 override async onBatchEnd(batch: number, logs?: UnresolvedLogs):
444 Promise<void> {
445 const ps: Array<void|Promise<void>> = [];
446 if (this.batchEnd != null) {
447 await resolveScalarsInLogs(logs);
448 ps.push(this.batchEnd(batch, logs as Logs));
449 }
450 if (this.yieldEvery === 'batch') {
451 ps.push(this.nextFrameFunc());
452 } else if (util.isNumber(this.yieldEvery)) {
453 ps.push(this.maybeWait(this.currentEpoch, batch, logs));
454 }
455 await Promise.all(ps);
456 }
457
458 override async onTrainBegin(logs?: UnresolvedLogs): Promise<void> {
459 if (this.trainBegin != null) {

Callers

nothing calls this directly

Calls 4

maybeWaitMethod · 0.95
resolveScalarsInLogsFunction · 0.90
allMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected