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

使用点积的热图可视化 #43

Open
55renchen opened this issue Jun 15, 2021 · 1 comment
Open

使用点积的热图可视化 #43

55renchen opened this issue Jun 15, 2021 · 1 comment

Comments

@55renchen
Copy link

您好,我用点积版本的non_local对f进行softmax之后,
f = torch.matmul(theta_x, phi_x)
N = f.size(-1)
f_div_C = f / N
sft = nn.Softmax(dim=2)
f_div_C = sft(f_div_C)
在可视化时还需要对NL_MAP进行normalize吗?如果需要,应该如何normalize呢?
现在我的热图结果只有一个box,看不到正常热图颜色的变化,这是什么原因呢?

@AlexHex7
Copy link
Owner

Hi @55renchen , NL_MAP需要归一化到[0, 1]. uint8类型范围是[0, 255],超出该范围则溢出

nl_map = np.uint8(nl_map * 255)

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