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

您好,请问为什么这里的srs要截取在0,16383/65535之间呢,16383是怎么得到的呢 #6

Open
cvkaiming opened this issue Feb 12, 2023 · 1 comment

Comments

@cvkaiming
Copy link

image

compute ESA score

            srs = srs[0].detach().cpu().numpy() #detach(): 返回一个新的Tensor,但返回的结果是没有梯度的。cpu():把gpu上的数据转到cpu上 numpy():将tensor格式转为numpy。
            for i in range(srs.shape[0]):
                if baseline_cpsnrs is None:
                    if config["training"]["truncate values"]:
                        val_score -= shift_cPSNR(np.clip((srs[i] - np.min(srs[i])), 0, 16383/65535), hrs[i], hr_maps[i])
                    else:
                        val_score -= shift_cPSNR(srs[i], hrs[i], hr_maps[i])
                else:
                    ESA = baseline_cpsnrs[names[i]]
                    # val_score += ESA / shift_cPSNR(srs[i], hrs[i], hr_maps[i])
                    if config["training"]["truncate values"]:
                        val_score -= shift_cPSNR(np.clip((srs[i] - np.min(srs[i])), 0, 16383/65535), hrs[i], hr_maps[i])
                    else:
                        val_score -= shift_cPSNR(srs[i], hrs[i], hr_maps[i])
@Suanmd
Copy link
Owner

Suanmd commented Feb 15, 2023

2^16-1 = 65535
2^14-1 = 16383

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