Views
No views yet

1ResNet.regnetx_002()
2ResNet.regnetx_004()
3ResNet.regnetx_006()
4ResNet.regnetx_008()
5ResNet.regnetx_016()
6ResNet.regnetx_040()
7ResNet.regnetx_064()
8ResNet.regnetx_080()
9ResNet.regnetx_120()
10ResNet.regnetx_160()
11ResNet.regnetx_320()
12# Y variants (with SE)
13ResNet.regnety_002()
14# ...
15ResNet.regnetx_320()
16
17You can easily customize your model1# change activation
2RegNet.regnetx_004(activation = nn.SELU)
3# change number of classes (default is 1000 )
4RegNet.regnetx_004(n_classes=100)
5# pass a different block
6RegNet.regnetx_004(block=RegNetYBotteneckBlock)
7# change the steam
8model = RegNet.regnetx_004(stem=ResNetStemC)
9change shortcut
10model = RegNet.regnetx_004(block=partial(RegNetYBotteneckBlock, shortcut=ResNetShorcutD))
11# store each feature
12x = torch.rand((1, 3, 224, 224))
13# get features
14model = RegNet.regnetx_004()
15# first call .features, this will activate the forward hooks and tells the model you'll like to get the features
16model.encoder.features
17model(torch.randn((1,3,224,224)))
18# get the features from the encoder
19features = model.encoder.features
20print([x.shape for x in features])
21#[torch.Size([1, 32, 112, 112]), torch.Size([1, 32, 56, 56]), torch.Size([1, 64, 28, 28]), torch.Size([1, 160, 14, 14])]