policies/utils.py

这个提交包含在:
Cadene
2024-04-05 11:47:15 +00:00
父节点 a420714ee4
当前提交 c17dffe944

查看文件

@ -0,0 +1,10 @@
def populate_queues(queues, batch):
for key in batch:
if len(queues[key]) != queues[key].maxlen:
# initialize by copying the first observation several times until the queue is full
while len(queues[key]) != queues[key].maxlen:
queues[key].append(batch[key])
else:
# add latest observation to the queue
queues[key].append(batch[key])
return queues