-
Notifications
You must be signed in to change notification settings - Fork 1
/
Untitled Diagram.drawio
183 lines (183 loc) · 74.5 KB
/
Untitled Diagram.drawio
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
<mxfile host="app.diagrams.net" modified="2021-08-16T12:43:54.460Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36" etag="Y3-E_fHiCl6e5sEH4PGc" version="14.9.6" type="github" pages="2">
<diagram id="mIDMZpxKwtR33cvpWDUD" name="Page-1">
<mxGraphModel dx="4168" dy="555" grid="1" gridSize="7" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="3300" pageHeight="4681" background="none" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="5TeKzXtCSBQQUykrGEJ6-19" value="forward(self, x)<br><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-v" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">F</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">relu</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">bn1</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">conv1</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">x</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">)), </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">inplace</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">True</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">)<br></span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">bn2</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">conv2</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">))<br></span><table class="highlight tab-size js-file-line-container" style="border-collapse: collapse ; border-spacing: 0px ; color: rgb(36 , 41 , 47) ; font-family: , &#34;blinkmacsystemfont&#34; , &#34;segoe ui&#34; , &#34;helvetica&#34; , &#34;arial&#34; , sans-serif , &#34;apple color emoji&#34; , &#34;segoe ui emoji&#34; ; font-size: 14px ; background-color: rgb(255 , 255 , 255)"><tbody style="box-sizing: border-box"><tr style="box-sizing: border-box ; background-color: transparent"></tr><tr style="box-sizing: border-box"><td id="LC61" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"> <span class="pl-s1" style="box-sizing: border-box">res</span> <span class="pl-c1" style="box-sizing: border-box">=</span> <span class="pl-s1" style="box-sizing: border-box">self</span>.<span class="pl-en" style="box-sizing: border-box">bn_res</span>(<span class="pl-s1" style="box-sizing: border-box">self</span>.<span class="pl-en" style="box-sizing: border-box">conv_res</span>(<span class="pl-s1" style="box-sizing: border-box">x</span>)) <span class="pl-k" style="box-sizing: border-box">if</span> <span class="pl-s1" style="box-sizing: border-box">self</span>.<span class="pl-s1" style="box-sizing: border-box">needs_conv_res</span> <span class="pl-k" style="box-sizing: border-box">else</span> <span class="pl-s1" style="box-sizing: border-box">x<br>return<span style="font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace"> </span><span class="pl-s1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace">y</span><span style="font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace">+</span><span style="font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace"> </span><span class="pl-s1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace">res</span><br></span></td></tr><tr style="box-sizing: border-box ; background-color: transparent"><td id="L62" class="blob-num js-line-number" style="box-sizing: border-box ; padding: 0px 10px ; cursor: pointer ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; line-height: 20px ; min-width: 50px ; text-align: right ; vertical-align: top ; width: 50px"></td></tr></tbody></table><br>&nbsp;" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="402" width="490" height="102" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-12" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="8cmXExLqv_iDycsSzqJl-5" target="8cmXExLqv_iDycsSzqJl-3" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-147" y="609" />
<mxPoint x="-147" y="260" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="8cmXExLqv_iDycsSzqJl-5" value="<span style="line-height: 80%"><span style="background-color: rgb(255 , 255 , 255)"><span class="pl-en" style="box-sizing: border-box"><br>conv3x3</span>(<span class="pl-s1" style="box-sizing: border-box">in_planes</span>, <span class="pl-s1" style="box-sizing: border-box">out_planes</span>, <span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">1</span>, <span class="pl-s1" style="box-sizing: border-box">use_bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">True</span>)<br></span><table class="highlight tab-size js-file-line-container" style="border-collapse: collapse ; border-spacing: 0px ; font-size: 14px"><tbody style="box-sizing: border-box"><tr style="box-sizing: border-box"></tr><tr style="box-sizing: border-box"><td id="LC33" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"><span style="background-color: rgb(255 , 255 , 255)"><span class="pl-en" style="box-sizing: border-box">return conv</span>(<span class="pl-s1" style="box-sizing: border-box">in_planes</span>,<span class="pl-s1" style="box-sizing: border-box">out_planes</span>,<span class="pl-c1" style="box-sizing: border-box">3</span>,<span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">stride,</span>&nbsp;<span class="pl-s1" style="box-sizing: border-box">padding</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">1</span>,<span class="pl-s1" style="box-sizing: border-box">use_bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">use_bias</span>)</span></td></tr><tr style="box-sizing: border-box"><td id="L34" class="blob-num js-line-number" style="box-sizing: border-box ; padding: 0px 10px ; cursor: pointer ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; line-height: 20px ; min-width: 50px ; text-align: right ; vertical-align: top ; width: 50px"></td></tr></tbody></table><br></span>" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#fff2cc;strokeColor=#d6b656;rounded=0;" parent="1" vertex="1">
<mxGeometry x="-100" y="560" width="560" height="60" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-14" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.25;exitDx=0;exitDy=0;" parent="1" source="8cmXExLqv_iDycsSzqJl-4" target="8cmXExLqv_iDycsSzqJl-3" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="-126" y="414" />
<mxPoint x="-126" y="399" />
<mxPoint x="-120" y="399" />
<mxPoint x="-120" y="260" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="8cmXExLqv_iDycsSzqJl-4" value="<span style="line-height: 60%"><span style="background-color: rgb(255 , 255 , 255)"><span class="pl-en" style="box-sizing: border-box"><br><br><br><br>conv1x1</span>(<span class="pl-s1" style="box-sizing: border-box">in_planes</span>, <span class="pl-s1" style="box-sizing: border-box">out_planes</span>, <span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">1</span>, <span class="pl-s1" style="box-sizing: border-box">use_bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">True</span>)<br></span><span style="background-color: rgb(255 , 255 , 255)"><span class="pl-en" style="box-sizing: border-box">return conv</span>(<span class="pl-s1" style="box-sizing: border-box">in_planes</span>,<span class="pl-s1" style="box-sizing: border-box">out_planes</span>,<span class="pl-c1" style="box-sizing: border-box">3</span>,<span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">stride,</span>&nbsp;<span class="pl-s1" style="box-sizing: border-box">padding</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">1</span>,<span class="pl-s1" style="box-sizing: border-box">use_bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">use_bias</span>)<br></span><span style="background-color: rgb(255 , 255 , 255)"><br><br><br></span><table class="highlight tab-size js-file-line-container" style="border-collapse: collapse ; border-spacing: 0px ; font-size: 14px"><tbody style="box-sizing: border-box"><tr style="box-sizing: border-box"></tr><tr style="box-sizing: border-box"><td id="LC29" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"><br></td></tr><tr style="box-sizing: border-box"><td id="L30" class="blob-num js-line-number" style="box-sizing: border-box ; padding: 0px 10px ; cursor: pointer ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; line-height: 20px ; min-width: 50px ; text-align: right ; vertical-align: top ; width: 50px"></td></tr></tbody></table><br></span>" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="-119" y="392" width="560" height="60" as="geometry" />
</mxCell>
<mxCell id="8cmXExLqv_iDycsSzqJl-3" value="<span style="line-height: 60%"><span class="pl-en" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">conv</span><span style="background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">in_planes</span><span style="background-color: rgb(255 , 255 , 255)">, </span><span class="pl-s1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">out_planes</span><span style="background-color: rgb(255 , 255 , 255)">, </span><span class="pl-s1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">kernel_size</span><span style="background-color: rgb(255 , 255 , 255)">, </span><span class="pl-s1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">stride</span><span class="pl-c1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">=</span><span class="pl-c1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">1</span><span style="background-color: rgb(255 , 255 , 255)">, </span><span class="pl-s1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">padding</span><span class="pl-c1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">=</span><span class="pl-c1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">0</span><span style="background-color: rgb(255 , 255 , 255)">, </span><span class="pl-s1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">use_bias</span><span class="pl-c1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">=</span><span class="pl-c1" style="background-color: rgb(255 , 255 , 255) ; box-sizing: border-box">True</span><span style="background-color: rgb(255 , 255 , 255)">)<br><br><span class="pl-k" style="box-sizing: border-box">return</span> <span class="pl-s1" style="box-sizing: border-box">nn</span>.<span class="pl-v" style="box-sizing: border-box">Conv2d</span>(<span class="pl-s1" style="box-sizing: border-box">in_planes</span>, <span class="pl-s1" style="box-sizing: border-box">out_planes</span>, <span class="pl-s1" style="box-sizing: border-box">kernel_size</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">kernel_size</span>, <span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">stride</span>, <span class="pl-s1" style="box-sizing: border-box">padding</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">padding</span>, <span class="pl-s1" style="box-sizing: border-box">bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">use_bias</span>)<br></span></span>" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="-100" y="230" width="560" height="60" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-1" value="BasicResBlock<br>Inheriting nn.Module" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#ffe6cc;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;strokeColor=#d79b00;html=1;" parent="1" vertex="1">
<mxGeometry x="868" y="140" width="140" height="467" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-2" value="+ expansion :1" style="text;fillColor=#f8cecc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=#b85450;gradientColor=#ea6b66;" parent="5TeKzXtCSBQQUykrGEJ6-1" vertex="1">
<mxGeometry y="26" width="140" height="441" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-11" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.25;entryDx=0;entryDy=0;exitX=0.996;exitY=0.359;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="5TeKzXtCSBQQUykrGEJ6-5" target="8cmXExLqv_iDycsSzqJl-5" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1274" y="469" as="sourcePoint" />
<Array as="points">
<mxPoint x="1554" y="251" />
<mxPoint x="1554" y="63" />
<mxPoint x="511" y="63" />
<mxPoint x="511" y="575" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-17" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="5TeKzXtCSBQQUykrGEJ6-5" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1487" y="280" as="sourcePoint" />
<mxPoint x="460" y="575" as="targetPoint" />
<Array as="points">
<mxPoint x="1491" y="280" />
<mxPoint x="1554" y="280" />
<mxPoint x="1554" y="63" />
<mxPoint x="511" y="63" />
<mxPoint x="511" y="575" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-18" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.75;exitDx=0;exitDy=0;" parent="1" source="5TeKzXtCSBQQUykrGEJ6-5" target="8cmXExLqv_iDycsSzqJl-4" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1491" y="336" />
<mxPoint x="1519" y="336" />
<mxPoint x="1519" y="91" />
<mxPoint x="490" y="91" />
<mxPoint x="490" y="422" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-5" value="__init__(self,in_channel, out_channel, stride =1)<br><br>self.stride = stride<br>self.in_channels = in_channels<br>self.out_channels = out_channels<br>self.conv1 = conv3x3(in_channels, out_channels. stride=stride, use_bias = False)<br>self.bn1 = nn.BatchNorm2d(out_channels)<br>self.conv2 = conv3x3(out_channels, out_channels, use_bias= False)<br>self.bn2 = nn.BatchNorm2d(out_channels)<br><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">needs_conv_res</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">stride</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">&gt;</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">1</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">or</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">in_channels</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">!=</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">out_channels<br>if self.need_conv_res:<br><div><span style="white-space: pre"> </span>self.conv_res =&nbsp;<span class="pl-en" style="box-sizing: border-box">conv1x1</span>(<span class="pl-s1" style="box-sizing: border-box">in_channels</span>, <span class="pl-s1" style="box-sizing: border-box">out_channels</span>, <span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">stride</span>, <span class="pl-s1" style="box-sizing: border-box">use_bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">False</span>)</div><div><span style="white-space: pre"> </span>sel.bn_res =nn.BatchNorm2d(out_channels)<br></div><table class="highlight tab-size js-file-line-container" style="border-collapse: collapse ; border-spacing: 0px ; font-family: , &#34;blinkmacsystemfont&#34; , &#34;segoe ui&#34; , &#34;helvetica&#34; , &#34;arial&#34; , sans-serif , &#34;apple color emoji&#34; , &#34;segoe ui emoji&#34; ; font-size: 14px"><tbody style="box-sizing: border-box"><tr style="box-sizing: border-box ; background-color: transparent"><td id="LC54" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"></td></tr><tr style="box-sizing: border-box ; background-color: transparent"><td id="L56" class="blob-num js-line-number" style="box-sizing: border-box ; padding: 0px 10px ; cursor: pointer ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; line-height: 20px ; min-width: 50px ; vertical-align: top ; width: 50px"></td><td id="LC56" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"><br><br></td></tr></tbody></table></span>" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="168" width="490" height="231" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-22" value="num_params()<br>return num of parameters" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="510" width="490" height="50" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-25" value="BottleneckResBlock<br>Inheriting nn.Module" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#ffe6cc;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;strokeColor=#d79b00;html=1;" parent="1" vertex="1">
<mxGeometry x="868" y="679" width="140" height="483" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-26" value="+ expansion :4" style="text;fillColor=#f8cecc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=#b85450;gradientColor=#ea6b66;" parent="5TeKzXtCSBQQUykrGEJ6-25" vertex="1">
<mxGeometry y="26" width="140" height="457" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-24" value="Flops()<br>Calculate and retrns Flop<br>" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="1113" width="490" height="50" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-28" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0.998;exitY=0.359;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="5TeKzXtCSBQQUykrGEJ6-27" target="8cmXExLqv_iDycsSzqJl-4" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1533" y="315" as="targetPoint" />
<Array as="points">
<mxPoint x="1519" y="783" />
<mxPoint x="1519" y="91" />
<mxPoint x="490" y="91" />
<mxPoint x="490" y="422" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-30" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.25;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="5TeKzXtCSBQQUykrGEJ6-27" target="8cmXExLqv_iDycsSzqJl-5" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1554" y="816" />
<mxPoint x="1554" y="63" />
<mxPoint x="511" y="63" />
<mxPoint x="511" y="575" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-32" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.597;exitDx=0;exitDy=0;exitPerimeter=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="5TeKzXtCSBQQUykrGEJ6-27" target="8cmXExLqv_iDycsSzqJl-4" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1673" y="938" as="targetPoint" />
<Array as="points">
<mxPoint x="1519" y="838" />
<mxPoint x="1519" y="91" />
<mxPoint x="490" y="91" />
<mxPoint x="490" y="422" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-33" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.835;exitDx=0;exitDy=0;exitPerimeter=0;" parent="1" source="5TeKzXtCSBQQUykrGEJ6-27" target="8cmXExLqv_iDycsSzqJl-4" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1519" y="893" />
<mxPoint x="1519" y="91" />
<mxPoint x="490" y="91" />
<mxPoint x="490" y="422" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-27" value="__init__(self,in_channel, out_channel, stride =1)<br><br>self.stride = stride<br>self.in_channels = in_channels<br>self.out_channels = out_channels<br>self.conv1= conv1x1(in_channels, out_channel , use_bias+False)<br>self.bn2 = nn.BatchNorm2d(out_channels)<br>self.conv2= conv3x3(out_channels, out_channels. stride=stride, use_bias = False)<br>self.bn1 = nn.BatchNorm2d(out_channels)<br>self.conv3 = conv1x1(out_channels, out_channels*self.expnsion, use_bias= False)<br>self.bn3 = nn.BatchNorm2d(out_channels)<br><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">needs_conv_res</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">stride</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">&gt;</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">1</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">or</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">in_channels</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">!=</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">out_channels*self.expansion<br>if self.need_conv_res:<br><div><span style="white-space: pre"> </span>self.conv_res =&nbsp;<span class="pl-en" style="box-sizing: border-box">conv1x1</span>(<span class="pl-s1" style="box-sizing: border-box">in_channels</span>, <span class="pl-s1" style="box-sizing: border-box">out_channels*self.expansion</span>, <span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">stride</span>, <span class="pl-s1" style="box-sizing: border-box">use_bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">False</span>)</div><div><span style="white-space: pre"> </span>sel.bn_res =nn.BatchNorm2d(out_channels)<br></div><table class="highlight tab-size js-file-line-container" style="border-collapse: collapse ; border-spacing: 0px ; font-family: , &#34;blinkmacsystemfont&#34; , &#34;segoe ui&#34; , &#34;helvetica&#34; , &#34;arial&#34; , sans-serif , &#34;apple color emoji&#34; , &#34;segoe ui emoji&#34; ; font-size: 14px"><tbody style="box-sizing: border-box"><tr style="box-sizing: border-box ; background-color: transparent"><td id="LC54" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"></td></tr><tr style="box-sizing: border-box ; background-color: transparent"><td id="L56" class="blob-num js-line-number" style="box-sizing: border-box ; padding: 0px 10px ; cursor: pointer ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; line-height: 20px ; min-width: 50px ; vertical-align: top ; width: 50px"></td><td id="LC56" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"><br><br></td></tr></tbody></table></span>" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="700" width="490" height="231" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-34" value="forward(self, x)<br><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-v" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">F</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">relu</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">bn1</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">conv1</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">x</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">)), </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">inplace</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">True</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">)<br></span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">bn2</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">conv2</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">))<br></span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">=</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"> </span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">bn3</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">self</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">.</span><span class="pl-en" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">conv3</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">(</span><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">y</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)">))</span><span style="color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"><br></span><table class="highlight tab-size js-file-line-container" style="border-collapse: collapse ; border-spacing: 0px ; color: rgb(36 , 41 , 47) ; font-family: , &#34;blinkmacsystemfont&#34; , &#34;segoe ui&#34; , &#34;helvetica&#34; , &#34;arial&#34; , sans-serif , &#34;apple color emoji&#34; , &#34;segoe ui emoji&#34; ; font-size: 14px ; background-color: rgb(255 , 255 , 255)"><tbody style="box-sizing: border-box"><tr style="box-sizing: border-box ; background-color: transparent"></tr><tr style="box-sizing: border-box"><td id="LC61" class="blob-code blob-code-inner js-file-line" style="box-sizing: border-box ; padding: 0px 10px ; line-height: 20px ; position: relative ; vertical-align: top ; overflow-wrap: normal ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; overflow: visible"> <span class="pl-s1" style="box-sizing: border-box">res</span> <span class="pl-c1" style="box-sizing: border-box">=</span> <span class="pl-s1" style="box-sizing: border-box">self</span>.<span class="pl-en" style="box-sizing: border-box">bn_res</span>(<span class="pl-s1" style="box-sizing: border-box">self</span>.<span class="pl-en" style="box-sizing: border-box">conv_res</span>(<span class="pl-s1" style="box-sizing: border-box">x</span>)) <span class="pl-k" style="box-sizing: border-box">if</span> <span class="pl-s1" style="box-sizing: border-box">self</span>.<span class="pl-s1" style="box-sizing: border-box">needs_conv_res</span> <span class="pl-k" style="box-sizing: border-box">else</span> <span class="pl-s1" style="box-sizing: border-box">x<br>return<span style="font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace"> </span><span class="pl-s1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace">y</span><span style="font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace"> </span><span class="pl-c1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace">+</span><span style="font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace"> </span><span class="pl-s1" style="box-sizing: border-box ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace">res</span><br></span></td></tr><tr style="box-sizing: border-box ; background-color: transparent"><td id="L62" class="blob-num js-line-number" style="box-sizing: border-box ; padding: 0px 10px ; cursor: pointer ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; font-size: 12px ; line-height: 20px ; min-width: 50px ; text-align: right ; vertical-align: top ; width: 50px"></td></tr></tbody></table><br>&nbsp;" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="938" width="490" height="112" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-35" value="num_params()<br>return num of parameters" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="1057" width="490" height="50" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-36" value="BottleneckResBlock<br>Inheriting nn.Module" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#ffe6cc;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;strokeColor=#d79b00;html=1;" parent="1" vertex="1">
<mxGeometry x="868" y="1232" width="140" height="483" as="geometry" />
</mxCell>
<mxCell id="5TeKzXtCSBQQUykrGEJ6-37" value="" style="text;fillColor=#f8cecc;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;strokeColor=#b85450;gradientColor=#ea6b66;" parent="5TeKzXtCSBQQUykrGEJ6-36" vertex="1">
<mxGeometry y="26" width="140" height="457" as="geometry" />
</mxCell>
<mxCell id="8XfggVGOjsV1GavnQ5BD-5" style="edgeStyle=orthogonalEdgeStyle;rounded=1;sketch=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.75;exitDx=0;exitDy=0;" edge="1" parent="1" source="16C45QZN2lyrI173hi5t-1" target="8cmXExLqv_iDycsSzqJl-4">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1519" y="1376" />
<mxPoint x="1519" y="91" />
<mxPoint x="490" y="91" />
<mxPoint x="490" y="422" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="16C45QZN2lyrI173hi5t-1" value="__init__(self,in_channel, out_channel, stride =1)<br><br>self.stride = stride<br>self.in_channels = in_channels<br>self.out_channels = out_channels<br>if stride &gt;1:<br>self.maxpool = nn.MaxPool2d(kerenel_size = stride+1, stride= stride, paddong= stride//2)<br><span class="pl-s1" style="box-sizing: border-box ; color: rgb(36 , 41 , 47) ; font-family: , , &#34;sf mono&#34; , &#34;menlo&#34; , &#34;consolas&#34; , &#34;liberation mono&#34; , monospace ; background-color: rgb(255 , 255 , 255)"><br><div>self.conv=&nbsp;<span class="pl-en" style="box-sizing: border-box">conv1x1</span>(<span class="pl-s1" style="box-sizing: border-box">in_channels</span>,&nbsp;<span class="pl-s1" style="box-sizing: border-box">out_channels</span>,&nbsp;<span class="pl-s1" style="box-sizing: border-box">stride</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-s1" style="box-sizing: border-box">stride</span>,&nbsp;<span class="pl-s1" style="box-sizing: border-box">use_bias</span><span class="pl-c1" style="box-sizing: border-box">=</span><span class="pl-c1" style="box-sizing: border-box">False</span>)</div><div><span> </span>sel.bn =nn.BatchNorm2d(out_channels)</div></span>" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" parent="1" vertex="1">
<mxGeometry x="1001" y="1260" width="490" height="154" as="geometry" />
</mxCell>
<mxCell id="8XfggVGOjsV1GavnQ5BD-1" value="forward(self, x)<br>if self.stride &gt;1:<br>x= self.maxpool(x<br>return self.bn(self.conv(x))" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" vertex="1" parent="1">
<mxGeometry x="1001" y="1417.5" width="490" height="112" as="geometry" />
</mxCell>
<mxCell id="8XfggVGOjsV1GavnQ5BD-2" value="num_params()<br>return num of parameters" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" vertex="1" parent="1">
<mxGeometry x="1001" y="1533" width="490" height="50" as="geometry" />
</mxCell>
<mxCell id="8XfggVGOjsV1GavnQ5BD-3" value="Flops()<br>Calculate and retrns Flop<br>" style="shape=module;align=left;spacingLeft=20;align=center;verticalAlign=top;rounded=0;html=1;" vertex="1" parent="1">
<mxGeometry x="1001" y="1589" width="490" height="50" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="pSsk6tU87ZdI53kx-52e" name="Page-2">
<mxGraphModel dx="868" dy="555" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="1654" math="0" shadow="0">
<root>
<mxCell id="YD0y9ioqF3FHzDd9ohLl-0" />
<mxCell id="YD0y9ioqF3FHzDd9ohLl-1" parent="YD0y9ioqF3FHzDd9ohLl-0" />
</root>
</mxGraphModel>
</diagram>
</mxfile>