MCPcopy Create free account
hub / github.com/tensorflow/tfjs / trainOnBatch

Method trainOnBatch

tfjs-layers/src/models.ts:997–1002  ·  view source on GitHub ↗

* Runs a single gradient update on a single batch of data. * * This method differs from `fit()` and `fitDataset()` in the following * regards: * - It operates on exactly one batch of data. * - It returns only the loss and metric values, instead of * returning the batch-by-b

(
      x: Tensor|Tensor[]|{[inputName: string]: Tensor},
      y: Tensor|Tensor[]|
      {[inputName: string]: Tensor})

Source from the content-addressed store, hash-verified

995 * @doc {heading: 'Models', subheading: 'Classes'}
996 */
997 override async trainOnBatch(
998 x: Tensor|Tensor[]|{[inputName: string]: Tensor},
999 y: Tensor|Tensor[]|
1000 {[inputName: string]: Tensor}): Promise<number|number[]> {
1001 return this.model.trainOnBatch(x, y);
1002 }
1003
1004 /* See parent class for JsDoc */
1005 /** @nocollapse */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected