MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / forward

Method forward

models/resnet.py:143–158  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

141 return nn.Sequential(*layers)
142
143 def forward(self, x):
144 x = self.relu1(self.bn1(self.conv1(x)))
145 x = self.relu2(self.bn2(self.conv2(x)))
146 x = self.relu3(self.bn3(self.conv3(x)))
147 x = self.maxpool(x)
148
149 x = self.layer1(x)
150 x = self.layer2(x)
151 x = self.layer3(x)
152 x = self.layer4(x)
153
154 x = self.avgpool(x)
155 x = x.view(x.size(0), -1)
156 x = self.fc(x)
157
158 return x
159
160def resnet18(pretrained=False, **kwargs):
161 """Constructs a ResNet-18 model.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected