Class

ReplayMemory

ReplayMemory(maxSize)

The Replay Memory

Constructor

# new ReplayMemory(maxSize)

Parameters:
Name Type Description
maxSize number

The maximal size of the replay memory

View Source core/src/Agents/DQNAgent/DQNAgent.ts, line 301

Classes

ReplayMemory

Members

number

# maxSize

Get the max size

View Source core/src/Agents/DQNAgent/DQNAgent.ts, line 312

number

# size

Get the current size

View Source core/src/Agents/DQNAgent/DQNAgent.ts, line 319

Methods

# maxSize() → {number}

Get the max size

View Source core/src/Agents/DQNAgent/DQNAgent.ts, line 466

number

# sample(batchSize, rngnullable) → {BatchSample}

Sample from memory

Parameters:
Name Type Attributes Description
batchSize number

The size of the batch to sample

rng seedrandom.PRNG <nullable>

The random number generator to use for sampling

View Source core/src/Agents/DQNAgent/DQNAgent.ts, line 483

The batch sample

BatchSample

# save(experience) → {void}

Save an experience in the replay memory

Parameters:
Name Type Description
experience Experience

The experience to save

View Source core/src/Agents/DQNAgent/DQNAgent.ts, line 491

void

# size() → {number}

Get the current size

View Source core/src/Agents/DQNAgent/DQNAgent.ts, line 474

number