From: Francois Fleuret Date: Sun, 25 Jun 2017 07:57:29 +0000 (+0200) Subject: Added DeepNet3. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=349b55a2d9ca213718df8941058d42689ba68163;p=pysvrt.git Added DeepNet3. --- diff --git a/cnn-svrt.py b/cnn-svrt.py index cb94184..8baaacb 100755 --- a/cnn-svrt.py +++ b/cnn-svrt.py @@ -268,17 +268,17 @@ class DeepNet3(nn.Module): name = 'deepnet3' def __init__(self): - super(DeepNet2, self).__init__() + super(DeepNet3, self).__init__() self.conv1 = nn.Conv2d( 1, 32, kernel_size=7, stride=4, padding=3) - self.conv2 = nn.Conv2d( 32, 256, kernel_size=5, padding=2) - self.conv3 = nn.Conv2d(256, 256, kernel_size=3, padding=1) - self.conv4 = nn.Conv2d(256, 256, kernel_size=3, padding=1) - self.conv5 = nn.Conv2d(256, 256, kernel_size=3, padding=1) - self.conv6 = nn.Conv2d(256, 256, kernel_size=3, padding=1) - self.conv7 = nn.Conv2d(256, 256, kernel_size=3, padding=1) - self.fc1 = nn.Linear(4096, 512) - self.fc2 = nn.Linear(512, 512) - self.fc3 = nn.Linear(512, 2) + self.conv2 = nn.Conv2d( 32, 128, kernel_size=5, padding=2) + self.conv3 = nn.Conv2d(128, 128, kernel_size=3, padding=1) + self.conv4 = nn.Conv2d(128, 128, kernel_size=3, padding=1) + self.conv5 = nn.Conv2d(128, 128, kernel_size=3, padding=1) + self.conv6 = nn.Conv2d(128, 128, kernel_size=3, padding=1) + self.conv7 = nn.Conv2d(128, 128, kernel_size=3, padding=1) + self.fc1 = nn.Linear(2048, 256) + self.fc2 = nn.Linear(256, 256) + self.fc3 = nn.Linear(256, 2) def forward(self, x): x = self.conv1(x) @@ -305,7 +305,7 @@ class DeepNet3(nn.Module): x = self.conv7(x) x = fn.relu(x) - x = x.view(-1, 4096) + x = x.view(-1, 2048) x = self.fc1(x) x = fn.relu(x)