Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question regarding _get_parallel_step_context #29

Open
jingweiz opened this issue Dec 4, 2020 · 1 comment
Open

question regarding _get_parallel_step_context #29

jingweiz opened this issue Dec 4, 2020 · 1 comment

Comments

@jingweiz
Copy link

jingweiz commented Dec 4, 2020

Hi, thanks for making the code public!
I have a question regarding the function _get_parallel_step_context:
Here,

batch_size, num_steps = current_node.size()
, num_steps would always be 1 as the current_node reads the prev_a of the tsp state, so then this means that
if num_steps == 1: # We need to special case if we have only 1 step, may be the first or not
will always be hit, and the lines from 436 to 449 will never be used, is this correct or am I missing sth here?
Thanks in advance and looking forward for your reply!
Jingwei

@wouterkool
Copy link
Owner

Hi!

This is correct. The reason that there is a steps dimension is that this can be used to evaluate the model on a given tour in a single forward pass, which is much more efficient than one step at the time. This could be useful for, e.g., supervised training (teacher forcing) or things like experience replay. This code is a leftover of some early experiments in that direction which I thought may still be useful to somebody.

Wouter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants