How does the second convolutional layer in tensorflow keras work?Calculating size of output of a Conv layer in CNN modelImplement Character Convolution in KerasKeras Conv2D layer outputs array filled with NaNConvolutional layer output sizeOutput of conv2d in kerasHow to use Padding in conv2d layer of specific sizeConvolutional layer interpolation scaling in keras & tensorflowHow to mimic Caffe's max pooling behavior in Keras/Tensorflow?keras conv2d layers does not include second channel into trainingHow to compute the number of parameters in the second conversional layer?
Is expanding the research of a group into machine learning as a PhD student risky?
Where does the Z80 processor start executing from?
What Brexit proposals are on the table in the indicative votes on the 27th of March 2019?
How can I kill an app using Terminal?
Risk of infection at the gym?
What does the word "Atten" mean?
Is HostGator storing my password in plaintext?
Is there a good way to store credentials outside of a password manager?
Anatomically Correct Strange Women In Ponds Distributing Swords
Do all network devices need to make routing decisions, regardless of communication across networks or within a network?
Detecting if an element is found inside a container
Applicability of Single Responsibility Principle
Is `x >> pure y` equivalent to `liftM (const y) x`
Customer Requests (Sometimes) Drive Me Bonkers!
Purchasing a ticket for someone else in another country?
Hostile work environment after whistle-blowing on coworker and our boss. What do I do?
Is there a problem with hiding "forgot password" until it's needed?
How do I go from 300 unfinished/half written blog posts, to published posts?
How easy is it to start Magic from scratch?
How does it work when somebody invests in my business?
How did Arya survive the stabbing?
Why escape if the_content isnt?
Pole-zeros of a real-valued causal FIR system
Implement the Thanos sorting algorithm
How does the second convolutional layer in tensorflow keras work?
Calculating size of output of a Conv layer in CNN modelImplement Character Convolution in KerasKeras Conv2D layer outputs array filled with NaNConvolutional layer output sizeOutput of conv2d in kerasHow to use Padding in conv2d layer of specific sizeConvolutional layer interpolation scaling in keras & tensorflowHow to mimic Caffe's max pooling behavior in Keras/Tensorflow?keras conv2d layers does not include second channel into trainingHow to compute the number of parameters in the second conversional layer?
I have the fllowing model in keras.
model = Sequential()
model.add(Conv2D(4, (3, 3), input_shape=input_shape, name='Conv2D_0', padding = 'same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(8, (3, 3), name='Conv2D_1', padding='same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
input_shape is (32, 32). So, for the first layer, if I have a an image of size (32, 32), I get 4 images of size (32, 32). So the input image is convoluted with 4 diffrent kernels. After the pooling layer, I get 4 images of size (16, 16).
The second convolutional layer gives me 8 images of size (16, 16). This layer has
4*8 kernels. The kernels have the size (3, 3, 4, 8). But I don't get, how the 8 output images are computed.
I thought for example for the first image I can do sth like:
H_i : i-th output image of the first Pooling layer
Ker_i : i-th kernel. (:, :, i, 0)
So the first output image of the second convolutional layer could be:
conv(H_0, ker_0) + conv(H_1, ker_1) + conv(H_2, ker_2) + conv(H_3, ker_3)
But this seems to be wrong.
Can anyone explaine me, how the second conv-layer computes the output images?
Thank you for your help.
python tensorflow keras
add a comment |
I have the fllowing model in keras.
model = Sequential()
model.add(Conv2D(4, (3, 3), input_shape=input_shape, name='Conv2D_0', padding = 'same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(8, (3, 3), name='Conv2D_1', padding='same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
input_shape is (32, 32). So, for the first layer, if I have a an image of size (32, 32), I get 4 images of size (32, 32). So the input image is convoluted with 4 diffrent kernels. After the pooling layer, I get 4 images of size (16, 16).
The second convolutional layer gives me 8 images of size (16, 16). This layer has
4*8 kernels. The kernels have the size (3, 3, 4, 8). But I don't get, how the 8 output images are computed.
I thought for example for the first image I can do sth like:
H_i : i-th output image of the first Pooling layer
Ker_i : i-th kernel. (:, :, i, 0)
So the first output image of the second convolutional layer could be:
conv(H_0, ker_0) + conv(H_1, ker_1) + conv(H_2, ker_2) + conv(H_3, ker_3)
But this seems to be wrong.
Can anyone explaine me, how the second conv-layer computes the output images?
Thank you for your help.
python tensorflow keras
the same way as in first layer. number of filters becomes number of channels in the output. take a look cs231n.github.io/convolutional-networks
– Sharky
Mar 21 at 16:13
This layer has 4*8 kernels.
- How do you define kernel?
– Vlad
Mar 21 at 16:49
I mean convolutional kernel (en.wikipedia.org/wiki/Kernel_(image_processing)).
– 5yn4x
Mar 21 at 19:36
"the same way as in first layer. number of filters becomes number of channels in the output. take a look" But this time I have 4 input images. How are the filters applied on these 4 images.
– 5yn4x
Mar 21 at 19:37
I found the answer. The filter kernels are flipped!
– 5yn4x
Mar 22 at 15:49
add a comment |
I have the fllowing model in keras.
model = Sequential()
model.add(Conv2D(4, (3, 3), input_shape=input_shape, name='Conv2D_0', padding = 'same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(8, (3, 3), name='Conv2D_1', padding='same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
input_shape is (32, 32). So, for the first layer, if I have a an image of size (32, 32), I get 4 images of size (32, 32). So the input image is convoluted with 4 diffrent kernels. After the pooling layer, I get 4 images of size (16, 16).
The second convolutional layer gives me 8 images of size (16, 16). This layer has
4*8 kernels. The kernels have the size (3, 3, 4, 8). But I don't get, how the 8 output images are computed.
I thought for example for the first image I can do sth like:
H_i : i-th output image of the first Pooling layer
Ker_i : i-th kernel. (:, :, i, 0)
So the first output image of the second convolutional layer could be:
conv(H_0, ker_0) + conv(H_1, ker_1) + conv(H_2, ker_2) + conv(H_3, ker_3)
But this seems to be wrong.
Can anyone explaine me, how the second conv-layer computes the output images?
Thank you for your help.
python tensorflow keras
I have the fllowing model in keras.
model = Sequential()
model.add(Conv2D(4, (3, 3), input_shape=input_shape, name='Conv2D_0', padding = 'same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(8, (3, 3), name='Conv2D_1', padding='same', use_bias=False, activation=None))
model.add(MaxPooling2D(pool_size=(2, 2)))
input_shape is (32, 32). So, for the first layer, if I have a an image of size (32, 32), I get 4 images of size (32, 32). So the input image is convoluted with 4 diffrent kernels. After the pooling layer, I get 4 images of size (16, 16).
The second convolutional layer gives me 8 images of size (16, 16). This layer has
4*8 kernels. The kernels have the size (3, 3, 4, 8). But I don't get, how the 8 output images are computed.
I thought for example for the first image I can do sth like:
H_i : i-th output image of the first Pooling layer
Ker_i : i-th kernel. (:, :, i, 0)
So the first output image of the second convolutional layer could be:
conv(H_0, ker_0) + conv(H_1, ker_1) + conv(H_2, ker_2) + conv(H_3, ker_3)
But this seems to be wrong.
Can anyone explaine me, how the second conv-layer computes the output images?
Thank you for your help.
python tensorflow keras
python tensorflow keras
asked Mar 21 at 15:54
5yn4x5yn4x
62
62
the same way as in first layer. number of filters becomes number of channels in the output. take a look cs231n.github.io/convolutional-networks
– Sharky
Mar 21 at 16:13
This layer has 4*8 kernels.
- How do you define kernel?
– Vlad
Mar 21 at 16:49
I mean convolutional kernel (en.wikipedia.org/wiki/Kernel_(image_processing)).
– 5yn4x
Mar 21 at 19:36
"the same way as in first layer. number of filters becomes number of channels in the output. take a look" But this time I have 4 input images. How are the filters applied on these 4 images.
– 5yn4x
Mar 21 at 19:37
I found the answer. The filter kernels are flipped!
– 5yn4x
Mar 22 at 15:49
add a comment |
the same way as in first layer. number of filters becomes number of channels in the output. take a look cs231n.github.io/convolutional-networks
– Sharky
Mar 21 at 16:13
This layer has 4*8 kernels.
- How do you define kernel?
– Vlad
Mar 21 at 16:49
I mean convolutional kernel (en.wikipedia.org/wiki/Kernel_(image_processing)).
– 5yn4x
Mar 21 at 19:36
"the same way as in first layer. number of filters becomes number of channels in the output. take a look" But this time I have 4 input images. How are the filters applied on these 4 images.
– 5yn4x
Mar 21 at 19:37
I found the answer. The filter kernels are flipped!
– 5yn4x
Mar 22 at 15:49
the same way as in first layer. number of filters becomes number of channels in the output. take a look cs231n.github.io/convolutional-networks
– Sharky
Mar 21 at 16:13
the same way as in first layer. number of filters becomes number of channels in the output. take a look cs231n.github.io/convolutional-networks
– Sharky
Mar 21 at 16:13
This layer has 4*8 kernels.
- How do you define kernel?– Vlad
Mar 21 at 16:49
This layer has 4*8 kernels.
- How do you define kernel?– Vlad
Mar 21 at 16:49
I mean convolutional kernel (en.wikipedia.org/wiki/Kernel_(image_processing)).
– 5yn4x
Mar 21 at 19:36
I mean convolutional kernel (en.wikipedia.org/wiki/Kernel_(image_processing)).
– 5yn4x
Mar 21 at 19:36
"the same way as in first layer. number of filters becomes number of channels in the output. take a look" But this time I have 4 input images. How are the filters applied on these 4 images.
– 5yn4x
Mar 21 at 19:37
"the same way as in first layer. number of filters becomes number of channels in the output. take a look" But this time I have 4 input images. How are the filters applied on these 4 images.
– 5yn4x
Mar 21 at 19:37
I found the answer. The filter kernels are flipped!
– 5yn4x
Mar 22 at 15:49
I found the answer. The filter kernels are flipped!
– 5yn4x
Mar 22 at 15:49
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284425%2fhow-does-the-second-convolutional-layer-in-tensorflow-keras-work%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55284425%2fhow-does-the-second-convolutional-layer-in-tensorflow-keras-work%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
the same way as in first layer. number of filters becomes number of channels in the output. take a look cs231n.github.io/convolutional-networks
– Sharky
Mar 21 at 16:13
This layer has 4*8 kernels.
- How do you define kernel?– Vlad
Mar 21 at 16:49
I mean convolutional kernel (en.wikipedia.org/wiki/Kernel_(image_processing)).
– 5yn4x
Mar 21 at 19:36
"the same way as in first layer. number of filters becomes number of channels in the output. take a look" But this time I have 4 input images. How are the filters applied on these 4 images.
– 5yn4x
Mar 21 at 19:37
I found the answer. The filter kernels are flipped!
– 5yn4x
Mar 22 at 15:49