Alterna · learning material
11.6 Channels and reuse of coefficients
For one output canal, all input deposits are built up. The same factors are used in different window positions.
What this material covers
- Locality and general parameters
Content and key concepts
On the previous page, a two-dimensional image window.
For one output canal, all input deposits are built up. The same factors are used in different window positions.
A small window passes through a signal or image. Each exit consists of the numbers of the window and the overall coefficients. The frequency record describes the same data differently.
Для изменения рисунка включитеJavaScript; расчёт и теория доступны далее.
Locality and general parameters
CNN's entry into our agreement has shape[B,C_in,H,W], weights[C_out,C _in,k_h,k _w], bias[C _out]. Local deposits are consolidated for each output cannel.
all input channels
and after which the bis is added once:
Y
b
,
o
,
i
,
j
=
b
o
+
∑
c
∑
r
∑
s
K
o
,
c
,
r
,
s
X
b
,
c
,
i
s
h
−
p
+
r
,
j
s
w
−
p
+
s
.
Y_{b,o,i,j}=b_o+\sum_c\sum_r\sum_s K_{o,c,r,s}X_{b,c,is_h-p+r,js_w-p+s}.
Y
b
,
o
,
i
,
j
=
b
o
+
c
∑
r
∑
s
∑
K
o
,
c
,
r
,
s
X
b
,
c
,
i
s
h
−
p
+
r
,
j
s
w
−
p
+
s
.
In indices i,j is the output line and column, s_h,s_w is the string; the sum index s does not indicate string. The number of parameters C_out(C_in·k_h·k _w+1) does not depend on the number of spatial entries.
Feature explorer uses clearly assigned kernels and synthetic cannels, and does not give them as trained CNN. Receptive field one 3×3 operations -3×3; two such layers of stride1 -5×5 and not 6×6; in general r_l=r_(l-1)+(k_l-1)j_(L-1), j_l =j_ (l-1)s_l, wherej steps of adjacent exits relative to the input would require an additional multiplier.
Separate learning.
The second lab teaches 1×2filter on strip[1,0.0,1.1] starget[0,0, - 1.0]. Initial notes[0.0], loss=5mean(e2)=2. Gradients[-2,2], plr.5, new kernel[.1 - 1],loss=162.
Research.
Increase the number of cannels in the foeature explorer and explain the count and the amount, then go separately to train trade. The change in the lightning rate should not secretly change kernels of the first lab. Now you can move from signals to signals.
encoding text
the next program node.
cin,cout,kh,kw=3,2,3,3
assert cout*(cin*kh*kw+1)==56
x=[1,1,0,0,1,1]; target=[0,1,0,-1,0]
g=[sum((-target[i])*x[i+j] for i in range(5))/5 for j in range(2)]
w=[-.5*v for v in g]
assert g==[-.2,.2] and w==[.1,-.1]
The code repeats the operations just taken care of.
Completely checked Python-example Chapter
Available with a separate file; the short piece shown does not replace its implementation.
Each input channel matches the kernel cut, then deposits are added.
How do you process a line that doesn't yet consist of the right model of units?
Python examples of Chapter 11
Academic base