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

Is there a mistake in computing the topk_maxmum ? #11

Open
wuzhenyubuaa opened this issue Feb 7, 2021 · 1 comment
Open

Is there a mistake in computing the topk_maxmum ? #11

wuzhenyubuaa opened this issue Feb 7, 2021 · 1 comment

Comments

@wuzhenyubuaa
Copy link

wuzhenyubuaa commented Feb 7, 2021

Hi, topk_maxmum, _ = mask_d.topk(inactive_channels, dim=1, largest=False, sorted=False), (in 120 lines, layers.py)

the author wants to obtain the top k values, however, the above code is not. if there are any errors?

@hellozhuo
Copy link
Owner

https://github.com/zhuogege1943/dgc/blob/86befbd7f7b685ab3bbfafcd027ca3551dda48e9/layers.py#L118-L123

In the original code, we use topk to find the k smallest values in line 120, and mask out those values (assign them to 0) in lines 121-123.

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