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

Method __init__

super_resolution/model.py:7–17  ·  view source on GitHub ↗
(self, upscale_factor)

Source from the content-addressed store, hash-verified

5
6class Net(nn.Module):
7 def __init__(self, upscale_factor):
8 super(Net, self).__init__()
9
10 self.relu = nn.ReLU()
11 self.conv1 = nn.Conv2d(1, 64, (5, 5), (1, 1), (2, 2))
12 self.conv2 = nn.Conv2d(64, 64, (3, 3), (1, 1), (1, 1))
13 self.conv3 = nn.Conv2d(64, 32, (3, 3), (1, 1), (1, 1))
14 self.conv4 = nn.Conv2d(32, upscale_factor ** 2, (3, 3), (1, 1), (1, 1))
15 self.pixel_shuffle = nn.PixelShuffle(upscale_factor)
16
17 self._initialize_weights()
18
19 def forward(self, x):
20 x = self.relu(self.conv1(x))

Callers

nothing calls this directly

Calls 1

_initialize_weightsMethod · 0.95

Tested by

no test coverage detected