new paper suggests image linear attention is more effective without query normalization

This commit is contained in:
Phil Wang
2020-10-04 21:53:53 -07:00
parent 9f95a03c07
commit ef2ca0b625
2 changed files with 1 additions and 2 deletions
@@ -169,7 +169,6 @@ class LinearAttention(nn.Module):
b, c, h, w = x.shape
qkv = self.to_qkv(x)
q, k, v = rearrange(qkv, 'b (qkv heads c) h w -> qkv b heads c (h w)', heads = self.heads, qkv=3)
q = q.softmax(dim=-2)
k = k.softmax(dim=-1)
context = torch.einsum('bhdn,bhen->bhde', k, v)
out = torch.einsum('bhde,bhdn->bhen', context, q)
+1 -1
View File
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name = 'denoising-diffusion-pytorch',
packages = find_packages(),
version = '0.3.2',
version = '0.4.0',
license='MIT',
description = 'Denoising Diffusion Probabilistic Models - Pytorch',
author = 'Phil Wang',