Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chapter 10, is the for row_start in range(layer_0.shape[1]-kernel_rows) correct? #43

Open
DawnEve opened this issue May 4, 2020 · 2 comments

Comments

@DawnEve
Copy link

DawnEve commented May 4, 2020

8x8 image with a 3x3 kernel, we get 6x6 output, which means 8-3+1=6.

when using
for row_start in range(layer_0.shape[1]-kernel_rows)
, it discards the last pixel in the row.

What do you think?

@DawnEve DawnEve closed this as completed May 4, 2020
@DawnEve DawnEve reopened this May 4, 2020
@DawnEve
Copy link
Author

DawnEve commented May 4, 2020

for i in range(6):
[i, i+3)
0 3
1 4
2 5
3 6
4 7
[5, 8) # this last slice shouldn't be neglected.

@chnwiki
Copy link

chnwiki commented Sep 22, 2024

hidden_size = ((input_rows - kernel_rows+1) *
(input_cols - kernel_cols+1)) * num_kernels

for row_start in range(layer_0.shape[1]-kernel_rows+1):
for col_start in range(layer_0.shape[2] - kernel_cols+1):
sect = get_image_section(layer_0,
row_start,
row_start+kernel_rows,
col_start,
col_start+kernel_cols)
it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants