Skip to content

Commit

Permalink
even stronger
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Nov 23, 2024
1 parent 3d61134 commit 28b693d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 = 'x-transformers',
packages = find_packages(exclude=['examples']),
version = '1.42.15',
version = '1.42.16',
license='MIT',
description = 'X-Transformers - Pytorch',
author = 'Phil Wang',
Expand Down
4 changes: 2 additions & 2 deletions x_transformers/x_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,9 +1235,9 @@ def __init__(
# maybe learned value residual mixer per token

self.to_value_residual_mix = nn.Sequential(
nn.Linear(dim, 1),
nn.Linear(dim, heads),
nn.Sigmoid(),
Rearrange('b n 1 -> b 1 n 1')
Rearrange('b n h -> b h n 1')
) if learned_value_residual_mix else always(0.5)

# attention on attention
Expand Down

0 comments on commit 28b693d

Please sign in to comment.