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

Don't understand VIN last step #11

Closed
QiXuanWang opened this issue Oct 24, 2019 · 1 comment
Closed

Don't understand VIN last step #11

QiXuanWang opened this issue Oct 24, 2019 · 1 comment

Comments

@QiXuanWang
Copy link

    slice_s1 = S1.long().expand(config.imsize, 1, config.l_q, q.size(0))
    slice_s1 = slice_s1.permute(3, 2, 1, 0)
    q_out = q.gather(2, slice_s1).squeeze(2)

What does this 3 lines do?

@kentsommer
Copy link
Owner

Hi @QiXuanWang this is to achieve the following which is described in the author's original implementation: https://github.com/avivt/VIN/blob/master/vin.py#L242

# Select the conv-net channels at the state position (S1,S2).
# This intuitively corresponds to each channel representing an action, and the convnet the Q function.
# The tricky thing is we want to select the same (S1,S2) position *for each* channel and for each sample

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