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

transformer tgt? #77

Open
a1wj1 opened this issue Oct 25, 2023 · 1 comment
Open

transformer tgt? #77

a1wj1 opened this issue Oct 25, 2023 · 1 comment

Comments

@a1wj1
Copy link

a1wj1 commented Oct 25, 2023

Hello, I don't understand the following code

` if self.end2end:
tgt = self.query_pos_embed.repeat(bs, 1, 1)
else:
tgt = self.position_encoding(
torch.ones((bs, 1, 20, 20), device=x["rgb"].device)
)
tgt = tgt.flatten(2)
tgt = torch.cat([tgt, self.query_pos_embed.repeat(bs, 1, 1)], 2)
tgt = tgt.permute(2, 0, 1)

    memory = self.encoder(features, mask=self.attn_mask)
    hs = self.decoder(self.query_embed.repeat(1, bs, 1), memory, query_pos=tgt)[0]

`

From the flowchart of the paper, the input decoder is either waypoints or the current image, but why is the target sequence here a learnable parameter torch.ones((bs, 1, 20, 20)?

@deepcs233
Copy link
Collaborator

Hi!
The (bs, 1, 20, 20) is used as the queries fot the traffic map.

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