Resize replay memory experience buffer
maxLengthis greater than or equal to the number of experiences stored in the buffer, then
bufferretains its stored experiences.
maxLengthis less than the number of experiences stored in the buffer, then
bufferretains only the
maxLengthmost recent experiences.
Resize Experience Buffer in Reinforcement Learning Agent
Create an environment for training the agent. For this example, load a predefined environment.
env = rlPredefinedEnv("SimplePendulumWithImage-Discrete");
Extract the observation and action specifications from the agent.
obsInfo = getObservationInfo(env); actInfo = getActionInfo(env);
Create a DQN agent from the environment specifications.
agent = rlDQNAgent(obsInfo,actInfo);
By default, the agent uses an experience buffer with a maximum size of 10,000.
ans = rlReplayMemory with properties: MaxLength: 10000 Length: 0
Increase the maximum size of the experience buffer to 20,000.
View the updated experience buffer.
ans = rlReplayMemory with properties: MaxLength: 20000 Length: 0
maxLength — Maximum buffer length
This property is read-only.
Maximum buffer length, specified as a nonnegative integer.
Introduced in R2022b