Skip to content

Commit

Permalink
add extra feedforward to perceiver io
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Aug 29, 2021
1 parent 3b70ebe commit 858aab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions perceiver_pytorch/perceiver_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def __init__(
]))

self.decoder_cross_attn = PreNorm(queries_dim, Attention(queries_dim, latent_dim, heads = cross_heads, dim_head = cross_dim_head), context_dim = latent_dim)
self.decoder_ff = PreNorm(queries_dim, FeedForward(queries_dim))

self.to_logits = nn.Linear(queries_dim, logits_dim) if exists(logits_dim) else nn.Identity()

def forward(
Expand Down Expand Up @@ -177,6 +179,7 @@ def forward(
# cross attend from decoder queries to latents

latents = self.decoder_cross_attn(queries, context = x)
latents = self.decoder_ff(latents)

# final linear out

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'perceiver-pytorch',
packages = find_packages(),
version = '0.5.1',
version = '0.6.0',
license='MIT',
description = 'Perceiver - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit 858aab3

Please sign in to comment.