In this page the filter param calculations are not explained:
This page explains the filter param calculations:
0
1
|
I'm dumb but still trying to understand the code provided from this e-book on deep learning, but it doesn't explain where the
n_in=40*4*4 comes from. 40 is from the 40 previous feature maps, but what about the 4*4 ?
For instance, what if I do a similar analysis in 1D as shown below, which should that
n_in term be?
Thanks!
| |||
add a comment
|
0
|
In the given example from the e-book, the number 4 comes from (12-5+1)/2, where 12 is the input image size (12*12) of the second constitutional layer; 5 is the filter size (5*5) used in that layer; and 2 is the poolsize.
This is similar to how you get the number 12 from the first constitutional layer: 12=(28-5+1)/2. It's well explained in your linked chapter.
Regarding your "For instance" code, your 6th line is not correct:
The number 12 should be replaced by (81-5+1)/2 which unfortunately is not an integer. You may want to change the filter_shape in the first layer to (6,1) to make it work. In that case, your 6th line should be:
and your 11th line should be:
|