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

Function configureCallbacks

tfjs-layers/src/base_callbacks.ts:579–609  ·  view source on GitHub ↗
(
    callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,
    initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,
    batchSize: number, doValidation: boolean,
    callbackMetrics: string[])

Source from the content-addressed store, hash-verified

577}
578
579export function configureCallbacks(
580 callbacks: BaseCallback[], verbose: ModelLoggingVerbosity, epochs: number,
581 initialEpoch: number, numTrainSamples: number, stepsPerEpoch: number,
582 batchSize: number, doValidation: boolean,
583 callbackMetrics: string[]): {callbackList: CallbackList, history: History} {
584 const history = new History();
585 const actualCallbacks: BaseCallback[] = [
586 new BaseLogger(), ...CallbackConstructorRegistry.createCallbacks(verbose)
587 ];
588 if (callbacks != null) {
589 actualCallbacks.push(...callbacks);
590 }
591 actualCallbacks.push(history);
592 const callbackList = new CallbackList(actualCallbacks);
593
594 // TODO(cais): Figure out when this LayersModel instance can have a
595 // dynamically
596 // set property called 'callback_model' as in PyKeras.
597
598 callbackList.setParams({
599 epochs,
600 initialEpoch,
601 samples: numTrainSamples,
602 steps: stepsPerEpoch,
603 batchSize,
604 verbose,
605 doValidation,
606 metrics: callbackMetrics,
607 });
608 return {callbackList, history};
609}

Callers 2

fitLoopMethod · 0.90
fitDatasetFunction · 0.90

Calls 3

setParamsMethod · 0.95
createCallbacksMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…