forked from alibaba/TinyNeuralNetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rexnetv1.py
487 lines (476 loc) · 37.2 KB
/
rexnetv1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
import torch
import torch.nn
import torch.functional
import torch.nn.functional
class rexnetv1(torch.nn.Module):
def __init__(self):
super().__init__()
self.features_0 = torch.nn.modules.conv.Conv2d(3, 32, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), bias=False)
self.features_1 = torch.nn.modules.batchnorm.BatchNorm2d(32)
self.features_3_out_0 = torch.nn.modules.conv.Conv2d(32, 32, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=32, bias=False)
self.features_3_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(32)
self.features_3_out_2 = torch.nn.modules.activation.ReLU6()
self.features_3_out_3 = torch.nn.modules.conv.Conv2d(32, 16, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_3_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(16)
self.features_4_out_0 = torch.nn.modules.conv.Conv2d(16, 96, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_4_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(96)
self.features_4_out_3 = torch.nn.modules.conv.Conv2d(96, 96, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=96, bias=False)
self.features_4_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(96)
self.features_4_out_5 = torch.nn.modules.activation.ReLU6()
self.features_4_out_6 = torch.nn.modules.conv.Conv2d(96, 27, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_4_out_7 = torch.nn.modules.batchnorm.BatchNorm2d(27)
self.features_5_out_0 = torch.nn.modules.conv.Conv2d(27, 162, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_5_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(162)
self.features_5_out_3 = torch.nn.modules.conv.Conv2d(162, 162, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=162, bias=False)
self.features_5_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(162)
self.features_5_out_5 = torch.nn.modules.activation.ReLU6()
self.features_5_out_6 = torch.nn.modules.conv.Conv2d(162, 38, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_5_out_7 = torch.nn.modules.batchnorm.BatchNorm2d(38)
self.features_6_out_0 = torch.nn.modules.conv.Conv2d(38, 228, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_6_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(228)
self.features_6_out_3 = torch.nn.modules.conv.Conv2d(228, 228, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=228, bias=False)
self.features_6_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(228)
self.features_6_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_6_out_5_fc_0 = torch.nn.modules.conv.Conv2d(228, 19, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_6_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(19)
self.features_6_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_6_out_5_fc_3 = torch.nn.modules.conv.Conv2d(19, 228, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_6_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_6_out_6 = torch.nn.modules.activation.ReLU6()
self.features_6_out_7 = torch.nn.modules.conv.Conv2d(228, 50, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_6_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(50)
self.features_7_out_0 = torch.nn.modules.conv.Conv2d(50, 300, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_7_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(300)
self.features_7_out_3 = torch.nn.modules.conv.Conv2d(300, 300, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=300, bias=False)
self.features_7_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(300)
self.features_7_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_7_out_5_fc_0 = torch.nn.modules.conv.Conv2d(300, 25, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_7_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(25)
self.features_7_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_7_out_5_fc_3 = torch.nn.modules.conv.Conv2d(25, 300, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_7_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_7_out_6 = torch.nn.modules.activation.ReLU6()
self.features_7_out_7 = torch.nn.modules.conv.Conv2d(300, 61, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_7_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(61)
self.features_8_out_0 = torch.nn.modules.conv.Conv2d(61, 366, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_8_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(366)
self.features_8_out_3 = torch.nn.modules.conv.Conv2d(366, 366, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=366, bias=False)
self.features_8_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(366)
self.features_8_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_8_out_5_fc_0 = torch.nn.modules.conv.Conv2d(366, 30, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_8_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(30)
self.features_8_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_8_out_5_fc_3 = torch.nn.modules.conv.Conv2d(30, 366, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_8_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_8_out_6 = torch.nn.modules.activation.ReLU6()
self.features_8_out_7 = torch.nn.modules.conv.Conv2d(366, 72, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_8_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(72)
self.features_9_out_0 = torch.nn.modules.conv.Conv2d(72, 432, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_9_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(432)
self.features_9_out_3 = torch.nn.modules.conv.Conv2d(432, 432, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=432, bias=False)
self.features_9_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(432)
self.features_9_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_9_out_5_fc_0 = torch.nn.modules.conv.Conv2d(432, 36, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_9_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(36)
self.features_9_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_9_out_5_fc_3 = torch.nn.modules.conv.Conv2d(36, 432, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_9_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_9_out_6 = torch.nn.modules.activation.ReLU6()
self.features_9_out_7 = torch.nn.modules.conv.Conv2d(432, 84, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_9_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(84)
self.features_10_out_0 = torch.nn.modules.conv.Conv2d(84, 504, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_10_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(504)
self.features_10_out_3 = torch.nn.modules.conv.Conv2d(504, 504, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=504, bias=False)
self.features_10_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(504)
self.features_10_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_10_out_5_fc_0 = torch.nn.modules.conv.Conv2d(504, 42, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_10_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(42)
self.features_10_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_10_out_5_fc_3 = torch.nn.modules.conv.Conv2d(42, 504, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_10_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_10_out_6 = torch.nn.modules.activation.ReLU6()
self.features_10_out_7 = torch.nn.modules.conv.Conv2d(504, 95, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_10_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(95)
self.features_11_out_0 = torch.nn.modules.conv.Conv2d(95, 570, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_11_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(570)
self.features_11_out_3 = torch.nn.modules.conv.Conv2d(570, 570, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=570, bias=False)
self.features_11_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(570)
self.features_11_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_11_out_5_fc_0 = torch.nn.modules.conv.Conv2d(570, 47, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_11_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(47)
self.features_11_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_11_out_5_fc_3 = torch.nn.modules.conv.Conv2d(47, 570, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_11_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_11_out_6 = torch.nn.modules.activation.ReLU6()
self.features_11_out_7 = torch.nn.modules.conv.Conv2d(570, 106, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_11_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(106)
self.features_12_out_0 = torch.nn.modules.conv.Conv2d(106, 636, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_12_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(636)
self.features_12_out_3 = torch.nn.modules.conv.Conv2d(636, 636, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=636, bias=False)
self.features_12_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(636)
self.features_12_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_12_out_5_fc_0 = torch.nn.modules.conv.Conv2d(636, 53, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_12_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(53)
self.features_12_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_12_out_5_fc_3 = torch.nn.modules.conv.Conv2d(53, 636, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_12_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_12_out_6 = torch.nn.modules.activation.ReLU6()
self.features_12_out_7 = torch.nn.modules.conv.Conv2d(636, 117, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_12_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(117)
self.features_13_out_0 = torch.nn.modules.conv.Conv2d(117, 702, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_13_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(702)
self.features_13_out_3 = torch.nn.modules.conv.Conv2d(702, 702, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=702, bias=False)
self.features_13_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(702)
self.features_13_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_13_out_5_fc_0 = torch.nn.modules.conv.Conv2d(702, 58, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_13_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(58)
self.features_13_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_13_out_5_fc_3 = torch.nn.modules.conv.Conv2d(58, 702, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_13_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_13_out_6 = torch.nn.modules.activation.ReLU6()
self.features_13_out_7 = torch.nn.modules.conv.Conv2d(702, 128, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_13_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(128)
self.features_14_out_0 = torch.nn.modules.conv.Conv2d(128, 768, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_14_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(768)
self.features_14_out_3 = torch.nn.modules.conv.Conv2d(768, 768, (3, 3), stride=(2, 2), padding=(1, 1), dilation=(1, 1), groups=768, bias=False)
self.features_14_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(768)
self.features_14_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_14_out_5_fc_0 = torch.nn.modules.conv.Conv2d(768, 64, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_14_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(64)
self.features_14_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_14_out_5_fc_3 = torch.nn.modules.conv.Conv2d(64, 768, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_14_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_14_out_6 = torch.nn.modules.activation.ReLU6()
self.features_14_out_7 = torch.nn.modules.conv.Conv2d(768, 140, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_14_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(140)
self.features_15_out_0 = torch.nn.modules.conv.Conv2d(140, 840, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_15_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(840)
self.features_15_out_3 = torch.nn.modules.conv.Conv2d(840, 840, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=840, bias=False)
self.features_15_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(840)
self.features_15_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_15_out_5_fc_0 = torch.nn.modules.conv.Conv2d(840, 70, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_15_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(70)
self.features_15_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_15_out_5_fc_3 = torch.nn.modules.conv.Conv2d(70, 840, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_15_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_15_out_6 = torch.nn.modules.activation.ReLU6()
self.features_15_out_7 = torch.nn.modules.conv.Conv2d(840, 151, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_15_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(151)
self.features_16_out_0 = torch.nn.modules.conv.Conv2d(151, 906, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_16_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(906)
self.features_16_out_3 = torch.nn.modules.conv.Conv2d(906, 906, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=906, bias=False)
self.features_16_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(906)
self.features_16_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_16_out_5_fc_0 = torch.nn.modules.conv.Conv2d(906, 75, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_16_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(75)
self.features_16_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_16_out_5_fc_3 = torch.nn.modules.conv.Conv2d(75, 906, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_16_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_16_out_6 = torch.nn.modules.activation.ReLU6()
self.features_16_out_7 = torch.nn.modules.conv.Conv2d(906, 162, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_16_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(162)
self.features_17_out_0 = torch.nn.modules.conv.Conv2d(162, 972, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_17_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(972)
self.features_17_out_3 = torch.nn.modules.conv.Conv2d(972, 972, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=972, bias=False)
self.features_17_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(972)
self.features_17_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_17_out_5_fc_0 = torch.nn.modules.conv.Conv2d(972, 81, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_17_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(81)
self.features_17_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_17_out_5_fc_3 = torch.nn.modules.conv.Conv2d(81, 972, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_17_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_17_out_6 = torch.nn.modules.activation.ReLU6()
self.features_17_out_7 = torch.nn.modules.conv.Conv2d(972, 174, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_17_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(174)
self.features_18_out_0 = torch.nn.modules.conv.Conv2d(174, 1044, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_18_out_1 = torch.nn.modules.batchnorm.BatchNorm2d(1044)
self.features_18_out_3 = torch.nn.modules.conv.Conv2d(1044, 1044, (3, 3), stride=(1, 1), padding=(1, 1), dilation=(1, 1), groups=1044, bias=False)
self.features_18_out_4 = torch.nn.modules.batchnorm.BatchNorm2d(1044)
self.features_18_out_5_avg_pool = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.features_18_out_5_fc_0 = torch.nn.modules.conv.Conv2d(1044, 87, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_18_out_5_fc_1 = torch.nn.modules.batchnorm.BatchNorm2d(87)
self.features_18_out_5_fc_2 = torch.nn.modules.activation.ReLU(inplace=True)
self.features_18_out_5_fc_3 = torch.nn.modules.conv.Conv2d(87, 1044, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
self.features_18_out_5_fc_4 = torch.nn.modules.activation.Sigmoid()
self.features_18_out_6 = torch.nn.modules.activation.ReLU6()
self.features_18_out_7 = torch.nn.modules.conv.Conv2d(1044, 185, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_18_out_8 = torch.nn.modules.batchnorm.BatchNorm2d(185)
self.features_19 = torch.nn.modules.conv.Conv2d(185, 1280, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1), bias=False)
self.features_20 = torch.nn.modules.batchnorm.BatchNorm2d(1280)
self.features_22 = torch.nn.modules.pooling.AdaptiveAvgPool2d(1)
self.output_0 = torch.nn.modules.dropout.Dropout(p=0.2)
self.output_1 = torch.nn.modules.conv.Conv2d(1280, 1000, (1, 1), stride=(1, 1), padding=(0, 0), dilation=(1, 1))
def forward(self, input_1):
features_0 = self.features_0(input_1)
features_1 = self.features_1(features_0)
sigmoid_1 = features_1.sigmoid()
mul_1 = features_1.mul_(sigmoid_1)
features_3_out_0 = self.features_3_out_0(mul_1)
features_3_out_1 = self.features_3_out_1(features_3_out_0)
features_3_out_2 = self.features_3_out_2(features_3_out_1)
features_3_out_3 = self.features_3_out_3(features_3_out_2)
features_3_out_4 = self.features_3_out_4(features_3_out_3)
features_4_out_0 = self.features_4_out_0(features_3_out_4)
features_4_out_1 = self.features_4_out_1(features_4_out_0)
sigmoid_2 = features_4_out_1.sigmoid()
mul_2 = features_4_out_1.mul_(sigmoid_2)
features_4_out_3 = self.features_4_out_3(mul_2)
features_4_out_4 = self.features_4_out_4(features_4_out_3)
features_4_out_5 = self.features_4_out_5(features_4_out_4)
features_4_out_6 = self.features_4_out_6(features_4_out_5)
features_4_out_7 = self.features_4_out_7(features_4_out_6)
features_5_out_0 = self.features_5_out_0(features_4_out_7)
features_5_out_1 = self.features_5_out_1(features_5_out_0)
sigmoid_3 = features_5_out_1.sigmoid()
mul_3 = features_5_out_1.mul_(sigmoid_3)
features_5_out_3 = self.features_5_out_3(mul_3)
features_5_out_4 = self.features_5_out_4(features_5_out_3)
features_5_out_5 = self.features_5_out_5(features_5_out_4)
features_5_out_6 = self.features_5_out_6(features_5_out_5)
features_5_out_7 = self.features_5_out_7(features_5_out_6)
getitem_1 = features_5_out_7[:, 0:27]
add_1 = getitem_1.__iadd__(features_4_out_7)
features_6_out_0 = self.features_6_out_0(features_5_out_7)
features_6_out_1 = self.features_6_out_1(features_6_out_0)
sigmoid_4 = features_6_out_1.sigmoid()
mul_4 = features_6_out_1.mul_(sigmoid_4)
features_6_out_3 = self.features_6_out_3(mul_4)
features_6_out_4 = self.features_6_out_4(features_6_out_3)
features_6_out_5_avg_pool = self.features_6_out_5_avg_pool(features_6_out_4)
features_6_out_5_fc_0 = self.features_6_out_5_fc_0(features_6_out_5_avg_pool)
features_6_out_5_fc_1 = self.features_6_out_5_fc_1(features_6_out_5_fc_0)
features_6_out_5_fc_2 = self.features_6_out_5_fc_2(features_6_out_5_fc_1)
features_6_out_5_fc_3 = self.features_6_out_5_fc_3(features_6_out_5_fc_2)
features_6_out_5_fc_4 = self.features_6_out_5_fc_4(features_6_out_5_fc_3)
mul_5 = features_6_out_4.__mul__(features_6_out_5_fc_4)
features_6_out_6 = self.features_6_out_6(mul_5)
features_6_out_7 = self.features_6_out_7(features_6_out_6)
features_6_out_8 = self.features_6_out_8(features_6_out_7)
features_7_out_0 = self.features_7_out_0(features_6_out_8)
features_7_out_1 = self.features_7_out_1(features_7_out_0)
sigmoid_5 = features_7_out_1.sigmoid()
mul_6 = features_7_out_1.mul_(sigmoid_5)
features_7_out_3 = self.features_7_out_3(mul_6)
features_7_out_4 = self.features_7_out_4(features_7_out_3)
features_7_out_5_avg_pool = self.features_7_out_5_avg_pool(features_7_out_4)
features_7_out_5_fc_0 = self.features_7_out_5_fc_0(features_7_out_5_avg_pool)
features_7_out_5_fc_1 = self.features_7_out_5_fc_1(features_7_out_5_fc_0)
features_7_out_5_fc_2 = self.features_7_out_5_fc_2(features_7_out_5_fc_1)
features_7_out_5_fc_3 = self.features_7_out_5_fc_3(features_7_out_5_fc_2)
features_7_out_5_fc_4 = self.features_7_out_5_fc_4(features_7_out_5_fc_3)
mul_7 = features_7_out_4.__mul__(features_7_out_5_fc_4)
features_7_out_6 = self.features_7_out_6(mul_7)
features_7_out_7 = self.features_7_out_7(features_7_out_6)
features_7_out_8 = self.features_7_out_8(features_7_out_7)
getitem_2 = features_7_out_8[:, 0:50]
add_2 = getitem_2.__iadd__(features_6_out_8)
features_8_out_0 = self.features_8_out_0(features_7_out_8)
features_8_out_1 = self.features_8_out_1(features_8_out_0)
sigmoid_6 = features_8_out_1.sigmoid()
mul_8 = features_8_out_1.mul_(sigmoid_6)
features_8_out_3 = self.features_8_out_3(mul_8)
features_8_out_4 = self.features_8_out_4(features_8_out_3)
features_8_out_5_avg_pool = self.features_8_out_5_avg_pool(features_8_out_4)
features_8_out_5_fc_0 = self.features_8_out_5_fc_0(features_8_out_5_avg_pool)
features_8_out_5_fc_1 = self.features_8_out_5_fc_1(features_8_out_5_fc_0)
features_8_out_5_fc_2 = self.features_8_out_5_fc_2(features_8_out_5_fc_1)
features_8_out_5_fc_3 = self.features_8_out_5_fc_3(features_8_out_5_fc_2)
features_8_out_5_fc_4 = self.features_8_out_5_fc_4(features_8_out_5_fc_3)
mul_9 = features_8_out_4.__mul__(features_8_out_5_fc_4)
features_8_out_6 = self.features_8_out_6(mul_9)
features_8_out_7 = self.features_8_out_7(features_8_out_6)
features_8_out_8 = self.features_8_out_8(features_8_out_7)
features_9_out_0 = self.features_9_out_0(features_8_out_8)
features_9_out_1 = self.features_9_out_1(features_9_out_0)
sigmoid_7 = features_9_out_1.sigmoid()
mul_10 = features_9_out_1.mul_(sigmoid_7)
features_9_out_3 = self.features_9_out_3(mul_10)
features_9_out_4 = self.features_9_out_4(features_9_out_3)
features_9_out_5_avg_pool = self.features_9_out_5_avg_pool(features_9_out_4)
features_9_out_5_fc_0 = self.features_9_out_5_fc_0(features_9_out_5_avg_pool)
features_9_out_5_fc_1 = self.features_9_out_5_fc_1(features_9_out_5_fc_0)
features_9_out_5_fc_2 = self.features_9_out_5_fc_2(features_9_out_5_fc_1)
features_9_out_5_fc_3 = self.features_9_out_5_fc_3(features_9_out_5_fc_2)
features_9_out_5_fc_4 = self.features_9_out_5_fc_4(features_9_out_5_fc_3)
mul_11 = features_9_out_4.__mul__(features_9_out_5_fc_4)
features_9_out_6 = self.features_9_out_6(mul_11)
features_9_out_7 = self.features_9_out_7(features_9_out_6)
features_9_out_8 = self.features_9_out_8(features_9_out_7)
getitem_3 = features_9_out_8[:, 0:72]
add_3 = getitem_3.__iadd__(features_8_out_8)
features_10_out_0 = self.features_10_out_0(features_9_out_8)
features_10_out_1 = self.features_10_out_1(features_10_out_0)
sigmoid_8 = features_10_out_1.sigmoid()
mul_12 = features_10_out_1.mul_(sigmoid_8)
features_10_out_3 = self.features_10_out_3(mul_12)
features_10_out_4 = self.features_10_out_4(features_10_out_3)
features_10_out_5_avg_pool = self.features_10_out_5_avg_pool(features_10_out_4)
features_10_out_5_fc_0 = self.features_10_out_5_fc_0(features_10_out_5_avg_pool)
features_10_out_5_fc_1 = self.features_10_out_5_fc_1(features_10_out_5_fc_0)
features_10_out_5_fc_2 = self.features_10_out_5_fc_2(features_10_out_5_fc_1)
features_10_out_5_fc_3 = self.features_10_out_5_fc_3(features_10_out_5_fc_2)
features_10_out_5_fc_4 = self.features_10_out_5_fc_4(features_10_out_5_fc_3)
mul_13 = features_10_out_4.__mul__(features_10_out_5_fc_4)
features_10_out_6 = self.features_10_out_6(mul_13)
features_10_out_7 = self.features_10_out_7(features_10_out_6)
features_10_out_8 = self.features_10_out_8(features_10_out_7)
getitem_4 = features_10_out_8[:, 0:84]
add_4 = getitem_4.__iadd__(features_9_out_8)
features_11_out_0 = self.features_11_out_0(features_10_out_8)
features_11_out_1 = self.features_11_out_1(features_11_out_0)
sigmoid_9 = features_11_out_1.sigmoid()
mul_14 = features_11_out_1.mul_(sigmoid_9)
features_11_out_3 = self.features_11_out_3(mul_14)
features_11_out_4 = self.features_11_out_4(features_11_out_3)
features_11_out_5_avg_pool = self.features_11_out_5_avg_pool(features_11_out_4)
features_11_out_5_fc_0 = self.features_11_out_5_fc_0(features_11_out_5_avg_pool)
features_11_out_5_fc_1 = self.features_11_out_5_fc_1(features_11_out_5_fc_0)
features_11_out_5_fc_2 = self.features_11_out_5_fc_2(features_11_out_5_fc_1)
features_11_out_5_fc_3 = self.features_11_out_5_fc_3(features_11_out_5_fc_2)
features_11_out_5_fc_4 = self.features_11_out_5_fc_4(features_11_out_5_fc_3)
mul_15 = features_11_out_4.__mul__(features_11_out_5_fc_4)
features_11_out_6 = self.features_11_out_6(mul_15)
features_11_out_7 = self.features_11_out_7(features_11_out_6)
features_11_out_8 = self.features_11_out_8(features_11_out_7)
getitem_5 = features_11_out_8[:, 0:95]
add_5 = getitem_5.__iadd__(features_10_out_8)
features_12_out_0 = self.features_12_out_0(features_11_out_8)
features_12_out_1 = self.features_12_out_1(features_12_out_0)
sigmoid_10 = features_12_out_1.sigmoid()
mul_16 = features_12_out_1.mul_(sigmoid_10)
features_12_out_3 = self.features_12_out_3(mul_16)
features_12_out_4 = self.features_12_out_4(features_12_out_3)
features_12_out_5_avg_pool = self.features_12_out_5_avg_pool(features_12_out_4)
features_12_out_5_fc_0 = self.features_12_out_5_fc_0(features_12_out_5_avg_pool)
features_12_out_5_fc_1 = self.features_12_out_5_fc_1(features_12_out_5_fc_0)
features_12_out_5_fc_2 = self.features_12_out_5_fc_2(features_12_out_5_fc_1)
features_12_out_5_fc_3 = self.features_12_out_5_fc_3(features_12_out_5_fc_2)
features_12_out_5_fc_4 = self.features_12_out_5_fc_4(features_12_out_5_fc_3)
mul_17 = features_12_out_4.__mul__(features_12_out_5_fc_4)
features_12_out_6 = self.features_12_out_6(mul_17)
features_12_out_7 = self.features_12_out_7(features_12_out_6)
features_12_out_8 = self.features_12_out_8(features_12_out_7)
getitem_6 = features_12_out_8[:, 0:106]
add_6 = getitem_6.__iadd__(features_11_out_8)
features_13_out_0 = self.features_13_out_0(features_12_out_8)
features_13_out_1 = self.features_13_out_1(features_13_out_0)
sigmoid_11 = features_13_out_1.sigmoid()
mul_18 = features_13_out_1.mul_(sigmoid_11)
features_13_out_3 = self.features_13_out_3(mul_18)
features_13_out_4 = self.features_13_out_4(features_13_out_3)
features_13_out_5_avg_pool = self.features_13_out_5_avg_pool(features_13_out_4)
features_13_out_5_fc_0 = self.features_13_out_5_fc_0(features_13_out_5_avg_pool)
features_13_out_5_fc_1 = self.features_13_out_5_fc_1(features_13_out_5_fc_0)
features_13_out_5_fc_2 = self.features_13_out_5_fc_2(features_13_out_5_fc_1)
features_13_out_5_fc_3 = self.features_13_out_5_fc_3(features_13_out_5_fc_2)
features_13_out_5_fc_4 = self.features_13_out_5_fc_4(features_13_out_5_fc_3)
mul_19 = features_13_out_4.__mul__(features_13_out_5_fc_4)
features_13_out_6 = self.features_13_out_6(mul_19)
features_13_out_7 = self.features_13_out_7(features_13_out_6)
features_13_out_8 = self.features_13_out_8(features_13_out_7)
getitem_7 = features_13_out_8[:, 0:117]
add_7 = getitem_7.__iadd__(features_12_out_8)
features_14_out_0 = self.features_14_out_0(features_13_out_8)
features_14_out_1 = self.features_14_out_1(features_14_out_0)
sigmoid_12 = features_14_out_1.sigmoid()
mul_20 = features_14_out_1.mul_(sigmoid_12)
features_14_out_3 = self.features_14_out_3(mul_20)
features_14_out_4 = self.features_14_out_4(features_14_out_3)
features_14_out_5_avg_pool = self.features_14_out_5_avg_pool(features_14_out_4)
features_14_out_5_fc_0 = self.features_14_out_5_fc_0(features_14_out_5_avg_pool)
features_14_out_5_fc_1 = self.features_14_out_5_fc_1(features_14_out_5_fc_0)
features_14_out_5_fc_2 = self.features_14_out_5_fc_2(features_14_out_5_fc_1)
features_14_out_5_fc_3 = self.features_14_out_5_fc_3(features_14_out_5_fc_2)
features_14_out_5_fc_4 = self.features_14_out_5_fc_4(features_14_out_5_fc_3)
mul_21 = features_14_out_4.__mul__(features_14_out_5_fc_4)
features_14_out_6 = self.features_14_out_6(mul_21)
features_14_out_7 = self.features_14_out_7(features_14_out_6)
features_14_out_8 = self.features_14_out_8(features_14_out_7)
features_15_out_0 = self.features_15_out_0(features_14_out_8)
features_15_out_1 = self.features_15_out_1(features_15_out_0)
sigmoid_13 = features_15_out_1.sigmoid()
mul_22 = features_15_out_1.mul_(sigmoid_13)
features_15_out_3 = self.features_15_out_3(mul_22)
features_15_out_4 = self.features_15_out_4(features_15_out_3)
features_15_out_5_avg_pool = self.features_15_out_5_avg_pool(features_15_out_4)
features_15_out_5_fc_0 = self.features_15_out_5_fc_0(features_15_out_5_avg_pool)
features_15_out_5_fc_1 = self.features_15_out_5_fc_1(features_15_out_5_fc_0)
features_15_out_5_fc_2 = self.features_15_out_5_fc_2(features_15_out_5_fc_1)
features_15_out_5_fc_3 = self.features_15_out_5_fc_3(features_15_out_5_fc_2)
features_15_out_5_fc_4 = self.features_15_out_5_fc_4(features_15_out_5_fc_3)
mul_23 = features_15_out_4.__mul__(features_15_out_5_fc_4)
features_15_out_6 = self.features_15_out_6(mul_23)
features_15_out_7 = self.features_15_out_7(features_15_out_6)
features_15_out_8 = self.features_15_out_8(features_15_out_7)
getitem_8 = features_15_out_8[:, 0:140]
add_8 = getitem_8.__iadd__(features_14_out_8)
features_16_out_0 = self.features_16_out_0(features_15_out_8)
features_16_out_1 = self.features_16_out_1(features_16_out_0)
sigmoid_14 = features_16_out_1.sigmoid()
mul_24 = features_16_out_1.mul_(sigmoid_14)
features_16_out_3 = self.features_16_out_3(mul_24)
features_16_out_4 = self.features_16_out_4(features_16_out_3)
features_16_out_5_avg_pool = self.features_16_out_5_avg_pool(features_16_out_4)
features_16_out_5_fc_0 = self.features_16_out_5_fc_0(features_16_out_5_avg_pool)
features_16_out_5_fc_1 = self.features_16_out_5_fc_1(features_16_out_5_fc_0)
features_16_out_5_fc_2 = self.features_16_out_5_fc_2(features_16_out_5_fc_1)
features_16_out_5_fc_3 = self.features_16_out_5_fc_3(features_16_out_5_fc_2)
features_16_out_5_fc_4 = self.features_16_out_5_fc_4(features_16_out_5_fc_3)
mul_25 = features_16_out_4.__mul__(features_16_out_5_fc_4)
features_16_out_6 = self.features_16_out_6(mul_25)
features_16_out_7 = self.features_16_out_7(features_16_out_6)
features_16_out_8 = self.features_16_out_8(features_16_out_7)
getitem_9 = features_16_out_8[:, 0:151]
add_9 = getitem_9.__iadd__(features_15_out_8)
features_17_out_0 = self.features_17_out_0(features_16_out_8)
features_17_out_1 = self.features_17_out_1(features_17_out_0)
sigmoid_15 = features_17_out_1.sigmoid()
mul_26 = features_17_out_1.mul_(sigmoid_15)
features_17_out_3 = self.features_17_out_3(mul_26)
features_17_out_4 = self.features_17_out_4(features_17_out_3)
features_17_out_5_avg_pool = self.features_17_out_5_avg_pool(features_17_out_4)
features_17_out_5_fc_0 = self.features_17_out_5_fc_0(features_17_out_5_avg_pool)
features_17_out_5_fc_1 = self.features_17_out_5_fc_1(features_17_out_5_fc_0)
features_17_out_5_fc_2 = self.features_17_out_5_fc_2(features_17_out_5_fc_1)
features_17_out_5_fc_3 = self.features_17_out_5_fc_3(features_17_out_5_fc_2)
features_17_out_5_fc_4 = self.features_17_out_5_fc_4(features_17_out_5_fc_3)
mul_27 = features_17_out_4.__mul__(features_17_out_5_fc_4)
features_17_out_6 = self.features_17_out_6(mul_27)
features_17_out_7 = self.features_17_out_7(features_17_out_6)
features_17_out_8 = self.features_17_out_8(features_17_out_7)
getitem_10 = features_17_out_8[:, 0:162]
add_10 = getitem_10.__iadd__(features_16_out_8)
features_18_out_0 = self.features_18_out_0(features_17_out_8)
features_18_out_1 = self.features_18_out_1(features_18_out_0)
sigmoid_16 = features_18_out_1.sigmoid()
mul_28 = features_18_out_1.mul_(sigmoid_16)
features_18_out_3 = self.features_18_out_3(mul_28)
features_18_out_4 = self.features_18_out_4(features_18_out_3)
features_18_out_5_avg_pool = self.features_18_out_5_avg_pool(features_18_out_4)
features_18_out_5_fc_0 = self.features_18_out_5_fc_0(features_18_out_5_avg_pool)
features_18_out_5_fc_1 = self.features_18_out_5_fc_1(features_18_out_5_fc_0)
features_18_out_5_fc_2 = self.features_18_out_5_fc_2(features_18_out_5_fc_1)
features_18_out_5_fc_3 = self.features_18_out_5_fc_3(features_18_out_5_fc_2)
features_18_out_5_fc_4 = self.features_18_out_5_fc_4(features_18_out_5_fc_3)
mul_29 = features_18_out_4.__mul__(features_18_out_5_fc_4)
features_18_out_6 = self.features_18_out_6(mul_29)
features_18_out_7 = self.features_18_out_7(features_18_out_6)
features_18_out_8 = self.features_18_out_8(features_18_out_7)
getitem_11 = features_18_out_8[:, 0:174]
add_11 = getitem_11.__iadd__(features_17_out_8)
features_19 = self.features_19(features_18_out_8)
features_20 = self.features_20(features_19)
sigmoid_17 = features_20.sigmoid()
mul_30 = features_20.mul_(sigmoid_17)
features_22 = self.features_22(mul_30)
output_0 = self.output_0(features_22)
output_1 = self.output_1(output_0)
flatten_1 = output_1.flatten(1)
return flatten_1
if __name__ == "__main__":
model = rexnetv1()
model.eval()
model.cpu()
dummy_input_0 = torch.ones((2, 3, 224, 224), dtype=torch.float32)
output = model(dummy_input_0)
print(output)