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

Method hiddenLayerSizes

cart-pole/index.js:315–321  ·  view source on GitHub ↗

* Get the sizes of the hidden layers. * * @returns {number | number[]} If the model has only one hidden layer, * return the size of the layer as a single number. If the model has * multiple hidden layers, return the sizes as an Array of numbers.

()

Source from the content-addressed store, hash-verified

313 * multiple hidden layers, return the sizes as an Array of numbers.
314 */
315 hiddenLayerSizes() {
316 const sizes = [];
317 for (let i = 0; i < this.policyNet.layers.length - 1; ++i) {
318 sizes.push(this.policyNet.layers[i].units);
319 }
320 return sizes.length === 1 ? sizes[0] : sizes;
321 }
322}
323
324/**

Callers 1

setUpUIFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected