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

Function maybeRenderDuringTraining

cart-pole/ui.js:66–71  ·  view source on GitHub ↗
(cartPole)

Source from the content-addressed store, hash-verified

64// Objects and functions to support display of cart pole status during training.
65let renderDuringTraining = true;
66export async function maybeRenderDuringTraining(cartPole) {
67 if (renderDuringTraining) {
68 renderCartPole(cartPole, cartPoleCanvas);
69 await tf.nextFrame(); // Unblock UI thread.
70 }
71}
72
73/**
74 * A function invoked at the end of every game during training.

Callers 1

trainMethod · 0.90

Calls 1

renderCartPoleFunction · 0.85

Tested by

no test coverage detected