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

Method constructor

snake-dqn/train.js:32–37  ·  view source on GitHub ↗
(bufferLength)

Source from the content-addressed store, hash-verified

30
31class MovingAverager {
32 constructor(bufferLength) {
33 this.buffer = [];
34 for (let i = 0; i < bufferLength; ++i) {
35 this.buffer.push(null);
36 }
37 }
38
39 append(x) {
40 this.buffer.shift();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected