Update metaformers.py

This commit is contained in:
Fredo Guan 2023-01-17 12:18:20 -08:00
parent 4ed934e000
commit 32bede4e27

View File

@ -809,12 +809,12 @@ class MetaFormer(nn.Module):
if pre_logits: if pre_logits:
return x return x
#x = self.global_pool(x) x = self.global_pool(x)
#x = x.squeeze() x = x.squeeze()
#x = self.norm(x) x = self.norm(x)
# (B, H, W, C) -> (B, C) # (B, H, W, C) -> (B, C)
#x = self.head(x) x = self.head(x)
x=self.head(self.norm(x.mean([2, 3]))) #x=self.head(self.norm(x.mean([2, 3])))
return x return x
def forward_features(self, x): def forward_features(self, x):