DDPG algorithm/Experience Buffer/ rl.util.ExperienceBuffer

조회 수: 3 (최근 30일)
hieu nguyen
hieu nguyen 2023년 4월 26일
답변: Aravind 2025년 2월 12일
I want to code my own DDPG algorithm. In the intial steps, the Batch size is bigger than the number of experiences in experience buffer, how can I still get enough sampled data for my miniBatch ?
I use rl.util.ExperienceBuffer to create my experience buffer and use createSampledExperienceMiniBatch(buffer,BatchSize) function to get datas for minBatch. However, when the data in experience buffer is smaller than the BatchSize, the function return 0x0 cell.

답변 (1개)

Aravind
Aravind 2025년 2월 12일
To manage the initial phase when your experience buffer has fewer experiences than the desired mini-batch size in a DDPG algorithm, you consider one of these two options:
  1. Adjust the Mini-Batch Size Dynamically: Use the current buffer size as the mini-batch size if it is smaller than the desired size when calling the “createSampledExperienceMiniBatch” function. This allows the agent to learn at each time step. However, the downside is that the agent might not explore sufficiently, potentially leading to a sub-optimal policy by the end of training.
  2. Warm-Up Phase: Implement an initial phase where the agent collects experiences without updating the policy to ensure the buffer is adequately filled. This is a common approach in training a DDPG agent. The agent takes random actions until the buffer is filled with enough entries to match the batch size. Once the buffer length meets the batch size, you can begin training thus avoiding errors with the “createSampledExperienceMiniBatch” function.
I hope this addresses your query.

카테고리

Help CenterFile Exchange에서 Power and Energy Systems에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by