zhysora / PGMAN

code for "PGMAN: An Unsupervised Generative Multi-adversarial Network for Pan-sharpening"
19 stars 7 forks source link

eval.py #4

Closed Dhr-Lqq closed 3 years ago

Dhr-Lqq commented 3 years ago

您好!请问下你评价指标eval.py中的Q_torch是计算两幅图像的哪部分?您的损失函数在求空间细节时用D_s(ps, l_ms, pan, l_pan),请问求空间细节部分时直接将四通道的融合图像平均池化成单通道直接与input_pan相减可以吗? 对于这个Q()的功能我不太懂,希望可以得到您的解答。谢谢! def Q(a, b): # N x H x W E_a = torch.mean(a, dim=(1,2)) E_a2 = torch.mean(a a, dim=(1,2)) E_b = torch.mean(b, dim=(1,2)) E_b2 = torch.mean(b b, dim=(1,2)) E_ab = torch.mean(a * b, dim=(1,2))

var_a = E_a2 - E_a * E_a
var_b = E_b2 - E_b * E_b
cov_ab = E_ab - E_a * E_b
return torch.mean(4 * cov_ab * E_a * E_b / (var_a + var_b) / (E_a**2 + E_b**2))
zhysora commented 3 years ago

对应QNR指标的计算公式,Q就是QIndex的计算