Created
October 7, 2021 10:17
-
-
Save shawwn/5ce14c8f95953c02ee997d39cd31eed2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ConvMixr(h,d,k,p,n): | |
def A(x): | |
return Sequential(x, GELU(), BatchNorm2d(h)) | |
class R(Sequential): | |
def forward(self, x): | |
return self[0](x) + x | |
return Sequential( | |
A(Conv2d(3,h,p,p)), | |
*[ | |
Sequential( | |
R(A(Conv2d(h,h,k,groups=h,padding=k//2))), | |
A(Conv2d(h,h,1))) | |
for i in range(d)], | |
AdaptiveAvgPool2d((1,1)), | |
Flatten(), | |
Linear(h,n)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment