From 7be16b726adbca8c51c360979e9cdd5f0ad98bbb Mon Sep 17 00:00:00 2001 From: ICLR Author Date: Wed, 6 Oct 2021 11:20:22 -0400 Subject: [PATCH] update readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index bef1ff1..aceb44b 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,11 @@ We also included a ConvMixer-768/32 in timm/models/convmixer.py (though it is si In the near future, we will upload weights. +The tweetable version of ConvMixer, which requires `from torch.nn import *`: + +``` +def ConvMixr(h,d,k,p,n): + S,C,A=Sequential,Conv2d,lambda x:S(x,GELU(),BatchNorm2d(h)) + R=type('',(S,),{'forward':lambda s,x:s[0](x)+x}) + return S(A(C(3,h,p,p)),*[S(R(A(C(h,h,k,groups=h,padding=k//2))),A(C(h,h,1))) for i in range(d)],AdaptiveAvgPool2d((1,1)),Flatten(),Linear(h,n)) +```