MCPcopy Create free account
hub / github.com/Sin3DM/Sin3DM / AlexNet

Class AlexNet

evaluation/lpips.py:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class AlexNet(nn.Module):
24 def __init__(self):
25 super().__init__()
26 self.layers = models.alexnet(weights=models.AlexNet_Weights.IMAGENET1K_V1).features
27 self.channels = []
28 for layer in self.layers:
29 if isinstance(layer, nn.Conv2d):
30 self.channels.append(layer.out_channels)
31
32 def forward(self, x):
33 fmaps = []
34 for layer in self.layers:
35 x = layer(x)
36 if isinstance(layer, nn.ReLU):
37 fmaps.append(x)
38 return fmaps
39
40
41class Conv1x1(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected