MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / constructor

Method constructor

cart-pole/index.js:61–67  ·  view source on GitHub ↗

* Constructor of PolicyNetwork. * * @param {number | number[] | tf.LayersModel} hiddenLayerSizes * Can be any of the following * - Size of the hidden layer, as a single number (for a single hidden * layer) * - An Array of numbers (for any number of hidden layers). *

(hiddenLayerSizesOrModel)

Source from the content-addressed store, hash-verified

59 * - An instance of tf.LayersModel.
60 */
61 constructor(hiddenLayerSizesOrModel) {
62 if (hiddenLayerSizesOrModel instanceof tf.LayersModel) {
63 this.policyNet = hiddenLayerSizesOrModel;
64 } else {
65 this.createPolicyNetwork(hiddenLayerSizesOrModel);
66 }
67 }
68
69 /**
70 * Create the underlying model of this policy network.

Callers

nothing calls this directly

Calls 1

createPolicyNetworkMethod · 0.95

Tested by

no test coverage detected