Ejemplo n.º 1
0
 def forward(self, x):
     x = F.relu(F.max_pool2d(self.conv1(x), 2))
     x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
     x = x.view(-1, 320)
     x = F.relu(self.fc1(x))
     x = F.dropout(x, training=self.training)
     x = self.fc2(x)
     return F.log_softmax(x)
Ejemplo n.º 2
0
 def forward(self, x):
     x = F.relu(self.conv1(x))
     x = F.max_pool2d(x, 2, 2)
     x = F.relu(self.conv2(x))
     x = F.max_pool2d(x, 2, 2)
     x = x.view(-1, 4 * 4 * 50)
     x = F.relu(self.fc1(x))
     x = self.fc2(x)
     return F.log_softmax(x, dim=1)
Ejemplo n.º 3
0
    def forward(self, x):
        x = F.relu(self.conv1(x))
        x = F.max_pool2d(x, 2, 2)
        x = F.relu(self.conv2(x))
        x = F.relu(self.conv3(x))
        x = F.max_pool2d(x, 2, 2)

        x = x.view(-1, 7 * 7 * 70)
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        return x
Ejemplo n.º 4
0
 def forward(self, x):
     out = F.relu(self.conv1(x))
     out = F.max_pool2d(out, 2)
     out = F.relu(self.conv2(out))
     out = F.max_pool2d(out, 2)
     out = out.view(out.size(0), -1)
     # print(out.data.size())
     out = F.relu(self.fc1(out))
     out = F.relu(self.fc2(out))
     out = out.view(out.size(0), -1)
     # print(out.data.size())
     out = self.fc3(out)
     # out = self.sig(out)
     return out
Ejemplo n.º 5
0
 def forward(self, x: Tensor) -> Tensor:
     x = self.conv1(x)
     x = F.relu(x)
     x = self.conv2(x)
     x = F.relu(x)
     x = F.max_pool2d(x, 2)
     x = self.dropout1(x)
     x = torch.flatten(x, 1)
     x = self.fc1(x)
     x = F.relu(x)
     x = self.dropout2(x)
     x = self.fc2(x)
     output = F.log_softmax(x, dim=1)
     return x