MCPcopy Create free account
hub / github.com/pytorch/tutorials / __init__

Method __init__

beginner_source/introyt/modelsyt_tutorial.py:152–161  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

150class LeNet(torch.nn.Module):
151
152 def __init__(self):
153 super().__init__()
154 # 1 input image channel (black & white), 6 output channels, 5x5 square convolution
155 # kernel
156 self.conv1 = torch.nn.Conv2d(1, 6, 5)
157 self.conv2 = torch.nn.Conv2d(6, 16, 3)
158 # an affine operation: y = Wx + b
159 self.fc1 = torch.nn.Linear(16 * 6 * 6, 120) # 6*6 from image dimension
160 self.fc2 = torch.nn.Linear(120, 84)
161 self.fc3 = torch.nn.Linear(84, 10)
162
163 def forward(self, x):
164 # Max pooling over a (2, 2) window

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected