CNNNet_CifarClassifierNetwork.py 18.8 KB
Newer Older
Nicola Gatto's avatar
Nicola Gatto committed
1
2
3
4
import mxnet as mx
import numpy as np
from mxnet import gluon

Christian Fuß's avatar
Christian Fuß committed
5
6
7
8
9
10
11
12
13
14
class OneHot(gluon.HybridBlock):
    def __init__(self, size, **kwargs):
        super(OneHot, self).__init__(**kwargs)
        with self.name_scope():
            self.size = size

    def hybrid_forward(self, F, x):
        return F.one_hot(indices=F.argmax(data=x, axis=1), depth=self.size)


Nicola Gatto's avatar
Nicola Gatto committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class Softmax(gluon.HybridBlock):
    def __init__(self, **kwargs):
        super(Softmax, self).__init__(**kwargs)

    def hybrid_forward(self, F, x):
        return F.softmax(x)


class Split(gluon.HybridBlock):
    def __init__(self, num_outputs, axis=1, **kwargs):
        super(Split, self).__init__(**kwargs)
        with self.name_scope():
            self.axis = axis
            self.num_outputs = num_outputs

    def hybrid_forward(self, F, x):
        return F.split(data=x, axis=self.axis, num_outputs=self.num_outputs)


class Concatenate(gluon.HybridBlock):
    def __init__(self, dim=1, **kwargs):
        super(Concatenate, self).__init__(**kwargs)
        with self.name_scope():
            self.dim = dim

    def hybrid_forward(self, F, *x):
        return F.concat(*x, dim=self.dim)


class ZScoreNormalization(gluon.HybridBlock):
    def __init__(self, data_mean, data_std, **kwargs):
        super(ZScoreNormalization, self).__init__(**kwargs)
        with self.name_scope():
            self.data_mean = self.params.get('data_mean', shape=data_mean.shape,
49
                init=mx.init.Constant(data_mean.asnumpy().tolist()), differentiable=False)
Nicola Gatto's avatar
Nicola Gatto committed
50
            self.data_std = self.params.get('data_std', shape=data_mean.shape,
51
                init=mx.init.Constant(data_std.asnumpy().tolist()), differentiable=False)
Nicola Gatto's avatar
Nicola Gatto committed
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

    def hybrid_forward(self, F, x, data_mean, data_std):
        x = F.broadcast_sub(x, data_mean)
        x = F.broadcast_div(x, data_std)
        return x


class Padding(gluon.HybridBlock):
    def __init__(self, padding, **kwargs):
        super(Padding, self).__init__(**kwargs)
        with self.name_scope():
            self.pad_width = padding

    def hybrid_forward(self, F, x):
        x = F.pad(data=x,
67
68
69
            mode='constant',
            pad_width=self.pad_width,
            constant_value=0)
Nicola Gatto's avatar
Nicola Gatto committed
70
71
72
73
74
75
76
77
78
79
80
        return x


class NoNormalization(gluon.HybridBlock):
    def __init__(self, **kwargs):
        super(NoNormalization, self).__init__(**kwargs)

    def hybrid_forward(self, F, x):
        return x


81
class Net_0(gluon.HybridBlock):
Nicola Gatto's avatar
Nicola Gatto committed
82
    def __init__(self, data_mean=None, data_std=None, **kwargs):
83
        super(Net_0, self).__init__(**kwargs)
84
        self.last_layers = {}
Nicola Gatto's avatar
Nicola Gatto committed
85
        with self.name_scope():
86
87
            if data_mean:
                assert(data_std)
88
89
                self.input_normalization_data_ = ZScoreNormalization(data_mean=data_mean['data_'],
                                                                               data_std=data_std['data_'])
Nicola Gatto's avatar
Nicola Gatto committed
90
            else:
91
                self.input_normalization_data_ = NoNormalization()
Nicola Gatto's avatar
Nicola Gatto committed
92
93
94

            self.conv2_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv2_1_ = gluon.nn.Conv2D(channels=8,
95
96
97
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
98
99
100
101
102
103
104
105
            # conv2_1_, output shape: {[8,32,32]}

            self.batchnorm2_1_ = gluon.nn.BatchNorm()
            # batchnorm2_1_, output shape: {[8,32,32]}

            self.relu2_1_ = gluon.nn.Activation(activation='relu')
            self.conv3_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv3_1_ = gluon.nn.Conv2D(channels=8,
106
107
108
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
109
110
111
112
113
114
            # conv3_1_, output shape: {[8,32,32]}

            self.batchnorm3_1_ = gluon.nn.BatchNorm()
            # batchnorm3_1_, output shape: {[8,32,32]}

            self.conv2_2_ = gluon.nn.Conv2D(channels=8,
115
116
117
                kernel_size=(1,1),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
118
119
120
121
122
123
124
125
            # conv2_2_, output shape: {[8,32,32]}

            self.batchnorm2_2_ = gluon.nn.BatchNorm()
            # batchnorm2_2_, output shape: {[8,32,32]}

            self.relu4_ = gluon.nn.Activation(activation='relu')
            self.conv5_1_padding = Padding(padding=(0,0,0,0,1,0,1,0))
            self.conv5_1_ = gluon.nn.Conv2D(channels=16,
126
127
128
                kernel_size=(3,3),
                strides=(2,2),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
129
130
131
132
133
134
135
136
            # conv5_1_, output shape: {[16,16,16]}

            self.batchnorm5_1_ = gluon.nn.BatchNorm()
            # batchnorm5_1_, output shape: {[16,16,16]}

            self.relu5_1_ = gluon.nn.Activation(activation='relu')
            self.conv6_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv6_1_ = gluon.nn.Conv2D(channels=16,
137
138
139
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
140
141
142
143
144
145
            # conv6_1_, output shape: {[16,16,16]}

            self.batchnorm6_1_ = gluon.nn.BatchNorm()
            # batchnorm6_1_, output shape: {[16,16,16]}

            self.conv5_2_ = gluon.nn.Conv2D(channels=16,
146
147
148
                kernel_size=(1,1),
                strides=(2,2),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
149
150
151
152
153
154
155
156
            # conv5_2_, output shape: {[16,16,16]}

            self.batchnorm5_2_ = gluon.nn.BatchNorm()
            # batchnorm5_2_, output shape: {[16,16,16]}

            self.relu7_ = gluon.nn.Activation(activation='relu')
            self.conv8_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv8_1_ = gluon.nn.Conv2D(channels=16,
157
158
159
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
160
161
162
163
164
165
166
167
            # conv8_1_, output shape: {[16,16,16]}

            self.batchnorm8_1_ = gluon.nn.BatchNorm()
            # batchnorm8_1_, output shape: {[16,16,16]}

            self.relu8_1_ = gluon.nn.Activation(activation='relu')
            self.conv9_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv9_1_ = gluon.nn.Conv2D(channels=16,
168
169
170
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
171
172
173
174
175
176
177
178
            # conv9_1_, output shape: {[16,16,16]}

            self.batchnorm9_1_ = gluon.nn.BatchNorm()
            # batchnorm9_1_, output shape: {[16,16,16]}

            self.relu10_ = gluon.nn.Activation(activation='relu')
            self.conv11_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv11_1_ = gluon.nn.Conv2D(channels=16,
179
180
181
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
182
183
184
185
186
187
188
189
            # conv11_1_, output shape: {[16,16,16]}

            self.batchnorm11_1_ = gluon.nn.BatchNorm()
            # batchnorm11_1_, output shape: {[16,16,16]}

            self.relu11_1_ = gluon.nn.Activation(activation='relu')
            self.conv12_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv12_1_ = gluon.nn.Conv2D(channels=16,
190
191
192
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
193
194
195
196
197
198
199
200
            # conv12_1_, output shape: {[16,16,16]}

            self.batchnorm12_1_ = gluon.nn.BatchNorm()
            # batchnorm12_1_, output shape: {[16,16,16]}

            self.relu13_ = gluon.nn.Activation(activation='relu')
            self.conv14_1_padding = Padding(padding=(0,0,0,0,1,0,1,0))
            self.conv14_1_ = gluon.nn.Conv2D(channels=32,
201
202
203
                kernel_size=(3,3),
                strides=(2,2),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
204
205
206
207
208
209
210
211
            # conv14_1_, output shape: {[32,8,8]}

            self.batchnorm14_1_ = gluon.nn.BatchNorm()
            # batchnorm14_1_, output shape: {[32,8,8]}

            self.relu14_1_ = gluon.nn.Activation(activation='relu')
            self.conv15_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv15_1_ = gluon.nn.Conv2D(channels=32,
212
213
214
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
215
216
217
218
219
220
            # conv15_1_, output shape: {[32,8,8]}

            self.batchnorm15_1_ = gluon.nn.BatchNorm()
            # batchnorm15_1_, output shape: {[32,8,8]}

            self.conv14_2_ = gluon.nn.Conv2D(channels=32,
221
222
223
                kernel_size=(1,1),
                strides=(2,2),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
224
225
226
227
228
229
230
231
            # conv14_2_, output shape: {[32,8,8]}

            self.batchnorm14_2_ = gluon.nn.BatchNorm()
            # batchnorm14_2_, output shape: {[32,8,8]}

            self.relu16_ = gluon.nn.Activation(activation='relu')
            self.conv17_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv17_1_ = gluon.nn.Conv2D(channels=32,
232
233
234
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
235
236
237
238
239
240
241
242
            # conv17_1_, output shape: {[32,8,8]}

            self.batchnorm17_1_ = gluon.nn.BatchNorm()
            # batchnorm17_1_, output shape: {[32,8,8]}

            self.relu17_1_ = gluon.nn.Activation(activation='relu')
            self.conv18_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv18_1_ = gluon.nn.Conv2D(channels=32,
243
244
245
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
246
247
248
249
250
251
252
253
            # conv18_1_, output shape: {[32,8,8]}

            self.batchnorm18_1_ = gluon.nn.BatchNorm()
            # batchnorm18_1_, output shape: {[32,8,8]}

            self.relu19_ = gluon.nn.Activation(activation='relu')
            self.conv20_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv20_1_ = gluon.nn.Conv2D(channels=32,
254
255
256
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
257
258
259
260
261
262
263
264
            # conv20_1_, output shape: {[32,8,8]}

            self.batchnorm20_1_ = gluon.nn.BatchNorm()
            # batchnorm20_1_, output shape: {[32,8,8]}

            self.relu20_1_ = gluon.nn.Activation(activation='relu')
            self.conv21_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv21_1_ = gluon.nn.Conv2D(channels=32,
265
266
267
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
268
269
270
271
272
273
274
275
            # conv21_1_, output shape: {[32,8,8]}

            self.batchnorm21_1_ = gluon.nn.BatchNorm()
            # batchnorm21_1_, output shape: {[32,8,8]}

            self.relu22_ = gluon.nn.Activation(activation='relu')
            self.conv23_1_padding = Padding(padding=(0,0,0,0,1,0,1,0))
            self.conv23_1_ = gluon.nn.Conv2D(channels=64,
276
277
278
                kernel_size=(3,3),
                strides=(2,2),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
279
280
281
282
283
284
285
286
            # conv23_1_, output shape: {[64,4,4]}

            self.batchnorm23_1_ = gluon.nn.BatchNorm()
            # batchnorm23_1_, output shape: {[64,4,4]}

            self.relu23_1_ = gluon.nn.Activation(activation='relu')
            self.conv24_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv24_1_ = gluon.nn.Conv2D(channels=64,
287
288
289
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
290
291
292
293
294
295
            # conv24_1_, output shape: {[64,4,4]}

            self.batchnorm24_1_ = gluon.nn.BatchNorm()
            # batchnorm24_1_, output shape: {[64,4,4]}

            self.conv23_2_ = gluon.nn.Conv2D(channels=64,
296
297
298
                kernel_size=(1,1),
                strides=(2,2),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
299
300
301
302
303
304
305
306
            # conv23_2_, output shape: {[64,4,4]}

            self.batchnorm23_2_ = gluon.nn.BatchNorm()
            # batchnorm23_2_, output shape: {[64,4,4]}

            self.relu25_ = gluon.nn.Activation(activation='relu')
            self.conv26_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv26_1_ = gluon.nn.Conv2D(channels=64,
307
308
309
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
310
311
312
313
314
315
316
317
            # conv26_1_, output shape: {[64,4,4]}

            self.batchnorm26_1_ = gluon.nn.BatchNorm()
            # batchnorm26_1_, output shape: {[64,4,4]}

            self.relu26_1_ = gluon.nn.Activation(activation='relu')
            self.conv27_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv27_1_ = gluon.nn.Conv2D(channels=64,
318
319
320
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
321
322
323
324
325
326
327
328
            # conv27_1_, output shape: {[64,4,4]}

            self.batchnorm27_1_ = gluon.nn.BatchNorm()
            # batchnorm27_1_, output shape: {[64,4,4]}

            self.relu28_ = gluon.nn.Activation(activation='relu')
            self.conv29_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv29_1_ = gluon.nn.Conv2D(channels=64,
329
330
331
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
332
333
334
335
336
337
338
339
            # conv29_1_, output shape: {[64,4,4]}

            self.batchnorm29_1_ = gluon.nn.BatchNorm()
            # batchnorm29_1_, output shape: {[64,4,4]}

            self.relu29_1_ = gluon.nn.Activation(activation='relu')
            self.conv30_1_padding = Padding(padding=(0,0,0,0,1,1,1,1))
            self.conv30_1_ = gluon.nn.Conv2D(channels=64,
340
341
342
                kernel_size=(3,3),
                strides=(1,1),
                use_bias=True)
Nicola Gatto's avatar
Nicola Gatto committed
343
344
345
346
347
348
349
350
351
            # conv30_1_, output shape: {[64,4,4]}

            self.batchnorm30_1_ = gluon.nn.BatchNorm()
            # batchnorm30_1_, output shape: {[64,4,4]}

            self.relu31_ = gluon.nn.Activation(activation='relu')
            self.globalpooling31_ = gluon.nn.GlobalAvgPool2D()
            # globalpooling31_, output shape: {[64,1,1]}

352
            self.fc31_ = gluon.nn.Dense(units=128, use_bias=True, flatten=True)
Nicola Gatto's avatar
Nicola Gatto committed
353
354
355
            # fc31_, output shape: {[128,1,1]}

            self.dropout31_ = gluon.nn.Dropout(rate=0.5)
356
            self.fc32_ = gluon.nn.Dense(units=10, use_bias=True, flatten=True)
Nicola Gatto's avatar
Nicola Gatto committed
357
358
            # fc32_, output shape: {[10,1,1]}

Eyüp Harputlu's avatar
Eyüp Harputlu committed
359
            self.softmax32_ = Softmax()
Nicola Gatto's avatar
Nicola Gatto committed
360
361


362
363
364
    def hybrid_forward(self, F, data_):
        data_ = self.input_normalization_data_(data_)
        conv2_1_padding = self.conv2_1_padding(data_)
Nicola Gatto's avatar
Nicola Gatto committed
365
366
367
368
369
370
        conv2_1_ = self.conv2_1_(conv2_1_padding)
        batchnorm2_1_ = self.batchnorm2_1_(conv2_1_)
        relu2_1_ = self.relu2_1_(batchnorm2_1_)
        conv3_1_padding = self.conv3_1_padding(relu2_1_)
        conv3_1_ = self.conv3_1_(conv3_1_padding)
        batchnorm3_1_ = self.batchnorm3_1_(conv3_1_)
371
        conv2_2_ = self.conv2_2_(data_)
Nicola Gatto's avatar
Nicola Gatto committed
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
        batchnorm2_2_ = self.batchnorm2_2_(conv2_2_)
        add4_ = batchnorm3_1_ + batchnorm2_2_
        relu4_ = self.relu4_(add4_)
        conv5_1_padding = self.conv5_1_padding(relu4_)
        conv5_1_ = self.conv5_1_(conv5_1_padding)
        batchnorm5_1_ = self.batchnorm5_1_(conv5_1_)
        relu5_1_ = self.relu5_1_(batchnorm5_1_)
        conv6_1_padding = self.conv6_1_padding(relu5_1_)
        conv6_1_ = self.conv6_1_(conv6_1_padding)
        batchnorm6_1_ = self.batchnorm6_1_(conv6_1_)
        conv5_2_ = self.conv5_2_(relu4_)
        batchnorm5_2_ = self.batchnorm5_2_(conv5_2_)
        add7_ = batchnorm6_1_ + batchnorm5_2_
        relu7_ = self.relu7_(add7_)
        conv8_1_padding = self.conv8_1_padding(relu7_)
        conv8_1_ = self.conv8_1_(conv8_1_padding)
        batchnorm8_1_ = self.batchnorm8_1_(conv8_1_)
        relu8_1_ = self.relu8_1_(batchnorm8_1_)
        conv9_1_padding = self.conv9_1_padding(relu8_1_)
        conv9_1_ = self.conv9_1_(conv9_1_padding)
        batchnorm9_1_ = self.batchnorm9_1_(conv9_1_)
        add10_ = batchnorm9_1_ + relu7_
        relu10_ = self.relu10_(add10_)
        conv11_1_padding = self.conv11_1_padding(relu10_)
        conv11_1_ = self.conv11_1_(conv11_1_padding)
        batchnorm11_1_ = self.batchnorm11_1_(conv11_1_)
        relu11_1_ = self.relu11_1_(batchnorm11_1_)
        conv12_1_padding = self.conv12_1_padding(relu11_1_)
        conv12_1_ = self.conv12_1_(conv12_1_padding)
        batchnorm12_1_ = self.batchnorm12_1_(conv12_1_)
        add13_ = batchnorm12_1_ + relu10_
        relu13_ = self.relu13_(add13_)
        conv14_1_padding = self.conv14_1_padding(relu13_)
        conv14_1_ = self.conv14_1_(conv14_1_padding)
        batchnorm14_1_ = self.batchnorm14_1_(conv14_1_)
        relu14_1_ = self.relu14_1_(batchnorm14_1_)
        conv15_1_padding = self.conv15_1_padding(relu14_1_)
        conv15_1_ = self.conv15_1_(conv15_1_padding)
        batchnorm15_1_ = self.batchnorm15_1_(conv15_1_)
        conv14_2_ = self.conv14_2_(relu13_)
        batchnorm14_2_ = self.batchnorm14_2_(conv14_2_)
        add16_ = batchnorm15_1_ + batchnorm14_2_
        relu16_ = self.relu16_(add16_)
        conv17_1_padding = self.conv17_1_padding(relu16_)
        conv17_1_ = self.conv17_1_(conv17_1_padding)
        batchnorm17_1_ = self.batchnorm17_1_(conv17_1_)
        relu17_1_ = self.relu17_1_(batchnorm17_1_)
        conv18_1_padding = self.conv18_1_padding(relu17_1_)
        conv18_1_ = self.conv18_1_(conv18_1_padding)
        batchnorm18_1_ = self.batchnorm18_1_(conv18_1_)
        add19_ = batchnorm18_1_ + relu16_
        relu19_ = self.relu19_(add19_)
        conv20_1_padding = self.conv20_1_padding(relu19_)
        conv20_1_ = self.conv20_1_(conv20_1_padding)
        batchnorm20_1_ = self.batchnorm20_1_(conv20_1_)
        relu20_1_ = self.relu20_1_(batchnorm20_1_)
        conv21_1_padding = self.conv21_1_padding(relu20_1_)
        conv21_1_ = self.conv21_1_(conv21_1_padding)
        batchnorm21_1_ = self.batchnorm21_1_(conv21_1_)
        add22_ = batchnorm21_1_ + relu19_
        relu22_ = self.relu22_(add22_)
        conv23_1_padding = self.conv23_1_padding(relu22_)
        conv23_1_ = self.conv23_1_(conv23_1_padding)
        batchnorm23_1_ = self.batchnorm23_1_(conv23_1_)
        relu23_1_ = self.relu23_1_(batchnorm23_1_)
        conv24_1_padding = self.conv24_1_padding(relu23_1_)
        conv24_1_ = self.conv24_1_(conv24_1_padding)
        batchnorm24_1_ = self.batchnorm24_1_(conv24_1_)
        conv23_2_ = self.conv23_2_(relu22_)
        batchnorm23_2_ = self.batchnorm23_2_(conv23_2_)
        add25_ = batchnorm24_1_ + batchnorm23_2_
        relu25_ = self.relu25_(add25_)
        conv26_1_padding = self.conv26_1_padding(relu25_)
        conv26_1_ = self.conv26_1_(conv26_1_padding)
        batchnorm26_1_ = self.batchnorm26_1_(conv26_1_)
        relu26_1_ = self.relu26_1_(batchnorm26_1_)
        conv27_1_padding = self.conv27_1_padding(relu26_1_)
        conv27_1_ = self.conv27_1_(conv27_1_padding)
        batchnorm27_1_ = self.batchnorm27_1_(conv27_1_)
        add28_ = batchnorm27_1_ + relu25_
        relu28_ = self.relu28_(add28_)
        conv29_1_padding = self.conv29_1_padding(relu28_)
        conv29_1_ = self.conv29_1_(conv29_1_padding)
        batchnorm29_1_ = self.batchnorm29_1_(conv29_1_)
        relu29_1_ = self.relu29_1_(batchnorm29_1_)
        conv30_1_padding = self.conv30_1_padding(relu29_1_)
        conv30_1_ = self.conv30_1_(conv30_1_padding)
        batchnorm30_1_ = self.batchnorm30_1_(conv30_1_)
        add31_ = batchnorm30_1_ + relu28_
        relu31_ = self.relu31_(add31_)
        globalpooling31_ = self.globalpooling31_(relu31_)
        fc31_ = self.fc31_(globalpooling31_)
        dropout31_ = self.dropout31_(fc31_)
        fc32_ = self.fc32_(dropout31_)
Eyüp Harputlu's avatar
Eyüp Harputlu committed
466
        softmax32_ = self.softmax32_(fc32_)
467
468
469
        softmax_ = softmax32_

        return softmax_
470