MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / f

Method f

cart-pole/index.js:182–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181 getGradientsAndSaveActions(inputTensor) {
182 const f = () => tf.tidy(() => {
183 const [logits, actions] = this.getLogitsAndActions(inputTensor);
184 this.currentActions_ = actions.dataSync();
185 const labels =
186 tf.sub(1, tf.tensor2d(this.currentActions_, actions.shape));
187 return tf.losses.sigmoidCrossEntropy(labels, logits).asScalar();
188 });
189 return tf.variableGrads(f);
190 }
191

Callers

nothing calls this directly

Calls 1

getLogitsAndActionsMethod · 0.95

Tested by

no test coverage detected