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

maxpool layer #7

Closed
HonestyBrave opened this issue Jan 16, 2021 · 3 comments
Closed

maxpool layer #7

HonestyBrave opened this issue Jan 16, 2021 · 3 comments

Comments

@HonestyBrave
Copy link

Hi, motokimura,
I'm sorry, I have to ask you again, the question is about Maxpool Layer in darknet.py file of "_make_conv_layers", is about "nn.MaxPool2d(2)", the function nn.MaxPool2d(2), you didn't use the "stride" parameter, but the author paper has to stride, so i have confusion, could you give a more explain?

Uploading image.png…

thank you very much!

@HonestyBrave
Copy link
Author

image

@motokimura
Copy link
Owner

According to the PyTorch docs, stride default value is kernel_size.
This means, if stride is not given, stride is set to the same value as kernel_size.

https://pytorch.org/docs/1.0.0/nn.html?highlight=maxpool2d#torch.nn.MaxPool2d

So nn.MaxPool2d(2) is equivalent to nn.MaxPool2d(kernel_size=2, stride=2).

@HonestyBrave
Copy link
Author

Very very thank you!

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