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

Function computeGradients

tfjs-core/src/optimizers/optimizer.ts:109–112  ·  view source on GitHub ↗

* Executes f() and computes the gradient of the scalar output of f() with * respect to the list of trainable variables provided by `varList`. If no * list is provided, it defaults to all trainable variables. * * @param f The function to execute and whose output to use for computing *

(f: () => Scalar, varList?: Variable[])

Source from the content-addressed store, hash-verified

107 * @doc {heading: 'Training', subheading: 'Optimizers'}
108 */
109 computeGradients(f: () => Scalar, varList?: Variable[]):
110 {value: Scalar, grads: NamedTensorMap} {
111 return variableGrads(f, varList);
112 }
113
114 /**
115 * Updates variables by using the computed gradients.

Callers

nothing calls this directly

Calls 1

variableGradsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…