|
@@ -178,19 +178,19 @@ |
|
|
" \n", |
|
|
" \n", |
|
|
" self.block1 = nn.Sequential(\n", |
|
|
" self.block1 = nn.Sequential(\n", |
|
|
" Conv_ReLU(in_channel, out_channel=64, kernel=7, stride=2, padding=3),\n", |
|
|
" Conv_ReLU(in_channel, out_channel=64, kernel=7, stride=2, padding=3),\n", |
|
|
" nn.MaxPool2d(3, 2)\n", |
|
|
|
|
|
|
|
|
" nn.MaxPool2d(kernel_size=3, stride=2)\n", |
|
|
" )\n", |
|
|
" )\n", |
|
|
" \n", |
|
|
" \n", |
|
|
" self.block2 = nn.Sequential(\n", |
|
|
" self.block2 = nn.Sequential(\n", |
|
|
" Conv_ReLU(64, 64, kernel=1),\n", |
|
|
" Conv_ReLU(64, 64, kernel=1),\n", |
|
|
" Conv_ReLU(64, 192, kernel=3, padding=1),\n", |
|
|
" Conv_ReLU(64, 192, kernel=3, padding=1),\n", |
|
|
" nn.MaxPool2d(3, 2)\n", |
|
|
|
|
|
|
|
|
" nn.MaxPool2d(kernel_size=3, stride=2)\n", |
|
|
" )\n", |
|
|
" )\n", |
|
|
" \n", |
|
|
" \n", |
|
|
" self.block3 = nn.Sequential(\n", |
|
|
" self.block3 = nn.Sequential(\n", |
|
|
" Inception(192, 64, 96, 128, 16, 32, 32),\n", |
|
|
" Inception(192, 64, 96, 128, 16, 32, 32),\n", |
|
|
" Inception(256, 128, 128, 192, 32, 96, 64),\n", |
|
|
" Inception(256, 128, 128, 192, 32, 96, 64),\n", |
|
|
" nn.MaxPool2d(3, 2)\n", |
|
|
|
|
|
|
|
|
" nn.MaxPool2d(kernel_size=3, stride=2)\n", |
|
|
" )\n", |
|
|
" )\n", |
|
|
" \n", |
|
|
" \n", |
|
|
" self.block4 = nn.Sequential(\n", |
|
|
" self.block4 = nn.Sequential(\n", |
|
@@ -199,13 +199,13 @@ |
|
|
" Inception(512, 128, 128, 256, 24, 64, 64),\n", |
|
|
" Inception(512, 128, 128, 256, 24, 64, 64),\n", |
|
|
" Inception(512, 112, 144, 288, 32, 64, 64),\n", |
|
|
" Inception(512, 112, 144, 288, 32, 64, 64),\n", |
|
|
" Inception(528, 256, 160, 320, 32, 128, 128),\n", |
|
|
" Inception(528, 256, 160, 320, 32, 128, 128),\n", |
|
|
" nn.MaxPool2d(3, 2)\n", |
|
|
|
|
|
|
|
|
" nn.MaxPool2d(kernel_size=3, stride=2)\n", |
|
|
" )\n", |
|
|
" )\n", |
|
|
" \n", |
|
|
" \n", |
|
|
" self.block5 = nn.Sequential(\n", |
|
|
" self.block5 = nn.Sequential(\n", |
|
|
" Inception(832, 256, 160, 320, 32, 128, 128),\n", |
|
|
" Inception(832, 256, 160, 320, 32, 128, 128),\n", |
|
|
" Inception(832, 384, 182, 384, 48, 128, 128),\n", |
|
|
" Inception(832, 384, 182, 384, 48, 128, 128),\n", |
|
|
" nn.AvgPool2d(2)\n", |
|
|
|
|
|
|
|
|
" nn.AvgPool2d(kernel_size=2)\n", |
|
|
" )\n", |
|
|
" )\n", |
|
|
" \n", |
|
|
" \n", |
|
|
" self.classifier = nn.Linear(1024, num_classes)\n", |
|
|
" self.classifier = nn.Linear(1024, num_classes)\n", |
|
@@ -214,18 +214,23 @@ |
|
|
" x = self.block1(x)\n", |
|
|
" x = self.block1(x)\n", |
|
|
" if self.verbose:\n", |
|
|
" if self.verbose:\n", |
|
|
" print('block 1 output: {}'.format(x.shape))\n", |
|
|
" print('block 1 output: {}'.format(x.shape))\n", |
|
|
|
|
|
" \n", |
|
|
" x = self.block2(x)\n", |
|
|
" x = self.block2(x)\n", |
|
|
" if self.verbose:\n", |
|
|
" if self.verbose:\n", |
|
|
" print('block 2 output: {}'.format(x.shape))\n", |
|
|
" print('block 2 output: {}'.format(x.shape))\n", |
|
|
|
|
|
" \n", |
|
|
" x = self.block3(x)\n", |
|
|
" x = self.block3(x)\n", |
|
|
" if self.verbose:\n", |
|
|
" if self.verbose:\n", |
|
|
" print('block 3 output: {}'.format(x.shape))\n", |
|
|
" print('block 3 output: {}'.format(x.shape))\n", |
|
|
|
|
|
" \n", |
|
|
" x = self.block4(x)\n", |
|
|
" x = self.block4(x)\n", |
|
|
" if self.verbose:\n", |
|
|
" if self.verbose:\n", |
|
|
" print('block 4 output: {}'.format(x.shape))\n", |
|
|
" print('block 4 output: {}'.format(x.shape))\n", |
|
|
|
|
|
" \n", |
|
|
" x = self.block5(x)\n", |
|
|
" x = self.block5(x)\n", |
|
|
" if self.verbose:\n", |
|
|
" if self.verbose:\n", |
|
|
" print('block 5 output: {}'.format(x.shape))\n", |
|
|
" print('block 5 output: {}'.format(x.shape))\n", |
|
|
|
|
|
" \n", |
|
|
" x = x.view(x.shape[0], -1)\n", |
|
|
" x = x.view(x.shape[0], -1)\n", |
|
|
" x = self.classifier(x)\n", |
|
|
" x = self.classifier(x)\n", |
|
|
" return x" |
|
|
" return x" |
|
@@ -442,7 +447,7 @@ |
|
|
"name": "python", |
|
|
"name": "python", |
|
|
"nbconvert_exporter": "python", |
|
|
"nbconvert_exporter": "python", |
|
|
"pygments_lexer": "ipython3", |
|
|
"pygments_lexer": "ipython3", |
|
|
"version": "3.8.12" |
|
|
|
|
|
|
|
|
"version": "3.7.9" |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
"nbformat": 4, |
|
|
"nbformat": 4, |
|
|