Skip to content

Question about positional embeddings #7

@luzhoulz

Description

@luzhoulz

if image_rotary_emb is not None: # for self attn, extend the sequence length according to the cross_view_attn param
query = apply_rotary_emb(query, image_rotary_emb)
key = apply_rotary_emb(key, image_rotary_emb)
if cross_view_attn:
query = rearrange(query, '(b v) l c -> b (v l) c', v=n_view)
key = rearrange(key, '(b v) l c -> b (v l) c', v=n_view)
value = rearrange(value, '(b v) l c -> b (v l) c', v=n_view)
else: # for cross attn, extend the sequence length
query = rearrange(query, '(b v) l c -> b (v l) c', v=n_view)

I noticed that you used positional embeddings in self-attention, but not in cross-attention. Is this a mistake, or did you do it intentionally?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions