Skip to content

Commit

Permalink
Merge pull request #3 from lucidrains/modulate-feature-dimension
Browse files Browse the repository at this point in the history
different attention map for each element of feature dimension
  • Loading branch information
lucidrains authored Jan 18, 2021
2 parents 7860b28 + a0a56d8 commit b8fcbc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions point_transformer_pytorch/point_transformer_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
self.attn_mlp = nn.Sequential(
nn.Linear(dim, dim * attn_mlp_hidden_mult),
nn.ReLU(),
nn.Linear(dim * attn_mlp_hidden_mult, 1),
nn.Linear(dim * attn_mlp_hidden_mult, dim),
)

def forward(self, x, pos):
Expand All @@ -47,8 +47,8 @@ def forward(self, x, pos):
v = v + rel_pos_emb

# attention
attn = sim.softmax(dim = -1)
attn = sim.softmax(dim = -2)

# aggregate
agg = einsum('b i j, b i j d -> b i d', attn, v)
agg = einsum('b i j d, b i j d -> b i d', attn, v)
return agg
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 = 'point-transformer-pytorch',
packages = find_packages(),
version = '0.0.1',
version = '0.0.2',
license='MIT',
description = 'Point Transformer - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit b8fcbc2

Please sign in to comment.