Skip to content

Commit 22fd7fc

Browse files
committed
Update activations.py
1 parent da431dd commit 22fd7fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/activations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(self, c1, k=1, s=1, r=16): # ch_in, kernel, stride, r
9292
def forward(self, x):
9393
y = x.mean(dim=2, keepdims=True).mean(dim=3, keepdims=True)
9494
# batch-size 1 bug/instabilities https://github.com/ultralytics/yolov5/issues/2891
95-
# beta = torch.sigmoid(self.bn2(self.fc2(self.bn1(self.fc1(y)))))
95+
# beta = torch.sigmoid(self.bn2(self.fc2(self.bn1(self.fc1(y))))) # bug/unstable
9696
beta = torch.sigmoid(self.fc2(self.fc1(y))) # bug patch BN layers removed
9797
dpx = (self.p1 - self.p2) * x
9898
return dpx * torch.sigmoid(beta * dpx) + self.p2 * x

0 commit comments

Comments
 (0)