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

Method getStateTensor

cart-pole/cart_pole.js:81–83  ·  view source on GitHub ↗

* Get current state as a tf.Tensor of shape [1, 4].

()

Source from the content-addressed store, hash-verified

79 * Get current state as a tf.Tensor of shape [1, 4].
80 */
81 getStateTensor() {
82 return tf.tensor2d([[this.x, this.xDot, this.theta, this.thetaDot]]);
83 }
84
85 /**
86 * Update the cart-pole system using an action.

Callers 2

setUpUIFunction · 0.95
trainMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected