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

MSE loss calculation in adaquant optimize layer seems off for ResNet #4

Open
hy-chen opened this issue Apr 27, 2021 · 1 comment
Open

Comments

@hy-chen
Copy link

hy-chen commented Apr 27, 2021

This implies to calculate MSE between relu(conv_out) for conv1 and conv2 layers

relu_condition = lambda layer_name: 'conv1' in layer_name or 'conv2' in layer_name

But in ResNet architecture, conv2 is not followed by a direct Relu. Instead it follows by a residual addition, then Relu.

out = self.conv2(out)

out += residual

out = self.relu2(out)

How was this difference justified?

@itayhubara
Copy link
Owner

Depend on the ResNet model for R18 you are right (basic block) for R50 you are wrong. We aim to give an example here. A better implementation would run on the model's graph and check what is the next 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

No branches or pull requests

2 participants