Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New model.yaml activation: field #9371

Merged
merged 10 commits into from
Sep 15, 2022
Prev Previous commit
Next Next commit
update
  • Loading branch information
glenn-jocher committed Sep 15, 2022
commit 14a8d1bf39c88a1b84b409820d7bf5897e92dede
3 changes: 1 addition & 2 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def __init__(self, c1, c2, k=1, s=1, p=None, g=1, d=1, act=True):
super().__init__()
self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p, d), groups=g, dilation=d, bias=False)
self.bn = nn.BatchNorm2d(c2)
if act is not True:
self.act = act if isinstance(act, nn.Module) else nn.Identity()
self.act = self.act if act is True else act if isinstance(act, nn.Module) else nn.Identity()

def forward(self, x):
return self.act(self.bn(self.conv(x)))
Expand Down