Merge remote-tracking branch 'upstream/main' into unify_policy_api

这个提交包含在:
Alexander Soare
2024-04-16 17:30:41 +01:00
当前提交 0eb899de73
共有 4 个文件被更改,包括 23 次插入 和 17 次删除

查看文件

@ -53,16 +53,10 @@ step = 0
done = False
while not done:
for batch in dataloader:
for k in batch:
batch[k] = batch[k].to(device, non_blocking=True)
batch = {k: v.to(device, non_blocking=True) for k, v in batch.items()}
info = policy.update(batch)
if step % log_freq == 0:
num_samples = (step + 1) * cfg.batch_size
loss = info["loss"]
update_s = info["update_s"]
print(
f"step: {step} samples: {num_samples} loss: {loss:.3f} update_time: {update_s:.3f} (seconds)"
)
print(f"step: {step} loss: {info['loss']:.3f} update_time: {info['update_s']:.3f} (seconds)")
step += 1
if step >= training_steps:
done = True