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

About the conv_index #13

Open
jianzhuwang opened this issue Nov 20, 2021 · 2 comments
Open

About the conv_index #13

jianzhuwang opened this issue Nov 20, 2021 · 2 comments

Comments

@jianzhuwang
Copy link

The crucial code are as follows:

if conv_index == '22':
self.vgg = nn.Sequential(*modules[:8])
elif conv_index == '54':
self.vgg = nn.Sequential(*modules[:35])

According to some explanations like in https://paperswithcode.com/method/vgg-loss, we usually use the feature maps activated by a function like 'ReLU' to compute the perceptual similarity. More specifically, the conv_index 'i,j' are regarded to take the j-th convolution (after activation) before the i-th maxpooling layer. If so, back to the code, '22' will correspond to (*modules[:9], which refers to the layer after ReLU activation), and similarly, '54' will correspond to (*modules[:36], which refers to the layer after ReLU activation).

I am not sure whether my understanding is correct or not. Your help would be highly appreciated.

Best.

@isaaccorley
Copy link
Owner

On a forward pass all ReLU does is clip negative values, so I'm not sure I've seen a true comparison of using the output of the conv layer vs the clipped output of the conv layer. Either way, feel free to submit a PR that updates this.

@jianzhuwang
Copy link
Author

On a forward pass all ReLU does is clip negative values, so I'm not sure I've seen a true comparison of using the output of the conv layer vs the clipped output of the conv layer. Either way, feel free to submit a PR that updates this.

Thanks for your reply.

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