Skip to content

Commit

Permalink
fix linear head in simple vit, thanks to @atkos
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Aug 10, 2023
1 parent 3e5d1be commit 950c901
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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 = 'vit-pytorch',
packages = find_packages(exclude=['examples']),
version = '1.4.0',
version = '1.4.1',
license='MIT',
description = 'Vision Transformer (ViT) - Pytorch',
long_description_content_type = 'text/markdown',
Expand Down
2 changes: 1 addition & 1 deletion vit_pytorch/simple_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(self, *, image_size, patch_size, num_classes, dim, depth, heads, ml
self.pool = "mean"
self.to_latent = nn.Identity()

self.linear_head = nn.LayerNorm(dim)
self.linear_head = nn.Linear(dim, num_classes)

def forward(self, img):
device = img.device
Expand Down

0 comments on commit 950c901

Please sign in to comment.