Beispiel #1
0
    def forward(self, x):
        # 21 1 240 240
        x = self.maxpool(x)  # 21 1 120 120
        x = self.conv1(x)  # 21 8 30 30
        x = nn.ReLU()(x)

        x = self.maxpool(x)  # 21 8 15 15
        x = self.conv2(x)  # 21 16 8 8
        x = nn.ReLU()(x)

        x = self.maxpool(x)  # 21 16 4 4
        x = self.conv3(x)  # 21 32 2 2
        x = nn.ReLU()(x)

        x = Flatten()(x.contiguous())  # 21 128

        x = self.fc(x)  # 21 256

        return x
Beispiel #2
0
    def forward(self, x):
        # print("x: ", x.shape) # 1 23 480 480
        # x = self.maxpool(x) # 1 23 240 240
        x = self.conv1(x)
        x = nn.ReLU()(x)
        # print("x: ", x.shape) # 1 32 240 240

        x = self.maxpool(x)
        x = self.conv2(x)
        x = nn.ReLU()(x)
        # print("x: ", x.shape) # 1 64 120 120

        x = self.maxpool(x)
        x = self.conv3(x)
        x = nn.ReLU()(x)
        # print("x: ", x.shape) # 1 128 60 60

        x = self.maxpool(x)
        x = self.conv4(x)
        x = nn.ReLU()(x)
        # print("x: ", x.shape) # 1 64 30 30

        x = self.maxpool(x)
        x = self.conv5(x)
        x = nn.ReLU()(x)
        # print("x: ", x.shape) # 1 32 15 15
        # print("x: ", x.shape) # 1 32 7 7

        x = Flatten()(x.contiguous())

        # print("x: ", x.shape) # 1*7200

        x = self.fc(x)  # 1*512
        x = nn.ReLU()(x)

        return x