EfficientZero icon indicating copy to clipboard operation
EfficientZero copied to clipboard

Question about the index of pad_child_visits_lst in selfplay_worker.py

Open puyuan1996 opened this issue 3 years ago • 2 comments

Thanks for you open-sourced code very much.

I am very confused about this code segment in put_last_trajectory method in selfplay_worker.py:

In Line 69 , why is, pad_child_visits_lst = game_histories[i].child_visits[beg_index:end_index] rather than pad_child_visits_lst = game_histories[i].child_visits[:self.config.num_unroll_steps],

in my understanding, the game_histories[i].child_visits[0] is the child_visits of stacked obs game_histories[i].obs_history[beg_index],

is this a bug?

Looking forward to your reply!

puyuan1996 avatar Oct 27 '22 09:10 puyuan1996

Thank you for your correction.

I think it should be a bug. Except for the observation history, all the other statistics (eg, visits, values, rewards) should be indexed from 0 instead of self.config.stacked_observations. This bug seems to cause misplaced data at the boundary.

Really thank you for your detailed reading. We will fix this these days and check out the performance :)

YeWR avatar Oct 31 '22 03:10 YeWR

Really thank you for your reply.

Looking forward to the analysis experiment of the performance impact of this bug!!

Best Wishes.

puyuan1996 avatar Nov 06 '22 10:11 puyuan1996