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

Fix an error in calculating SIFID #157

Closed
wants to merge 2 commits into from
Closed

Fix an error in calculating SIFID #157

wants to merge 2 commits into from

Conversation

DonghweeYoon
Copy link

@DonghweeYoon DonghweeYoon commented Nov 13, 2021

I got the same issue with #155.

In the current code, the SIFID is calculated from the activation before the first pooling layer.
To calculate the SIFID as described in the paper, the following modifications are required.

self.last_needed_block = max(output_blocks)

If 'dims' is set to 64, 'self.last_needed_block' is set to 0.

# Block 0: input to maxpool1
block0 = [
inception.Conv2d_1a_3x3,
inception.Conv2d_2a_3x3,
inception.Conv2d_2b_3x3,
]
self.blocks.append(nn.Sequential(*block0))
# Block 1: maxpool1 to maxpool2
if self.last_needed_block >= 1:
block1 = [
nn.MaxPool2d(kernel_size=3, stride=2),
inception.Conv2d_3b_1x1,
inception.Conv2d_4a_3x3,
]
self.blocks.append(nn.Sequential(*block1))

Then the input feature map only passed through 'block0'.
It doesn't go through the first max-pooling layer.

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

Successfully merging this pull request may close these issues.

1 participant