Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class model(nn.Module):
- def __init__(self, num_classes=10):
- # ------------ConvNet Model
- # Definition-------------------------------------------
- super(model, self).__init__()
- self.layer1 = nn.Sequential(
- nn.Conv2d(in_channels=1, out_channels=16, kernel_size=3, stride=1,
- padding=0),
- nn.ReLU(),
- nn.BatchNorm2d(num_features=16),
- nn.MaxPool2d(kernel_size=2, stride=1),
- Downsample(channels=16, filt_size=5, stride=2))
- self.layer2 = nn.Sequential(
- nn.Conv2d(in_channels=16, out_channels=32, kernel_size=4, stride=1,
- padding=0),
- nn.ReLU(),
- nn.BatchNorm2d(num_features=32),
- nn.MaxPool2d(kernel_size=2, stride=1),
- Downsample(channels=32, filt_size=5, stride=2))
- self.fc1 = nn.Linear(2048, 100)
- self.fc2 = nn.Linear(100, num_classes)
- self.softmax = nn.Softmax(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement