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

问题 #3

Open
jujujujuz opened this issue Nov 7, 2024 · 1 comment
Open

问题 #3

jujujujuz opened this issue Nov 7, 2024 · 1 comment

Comments

@jujujujuz
Copy link

你好作者,有一些问题希望你能帮我解答
30a4b3d6cec5deb2c8961f6fb29ddff
在你的论文中,损失函数是这样定义的。
而在你的代码中损失函数是这样的
content_loss = L1loss(restored, target) ssim_loss = 1 - ssim(restored, target, data_range=1.0).to("cuda:0") content_loss = content_loss+ssim_loss tv_loss = TVLoss() TV_loss = tv_loss(restored) loss = 0.95*content_loss + 0.05*TV_loss

我并没有找到在你论文中提到的,有关小波变换和傅里叶变换的损失函数。是并没有用到,还是在哪里我没有找到,希望你能帮我解答。

还有一个问题就是关于WMB模块的问题
b7d61caab5d972500513ae2cb44091a
在你的论文模块是这样的
而在代码里面模块是这样
`class WMB(nn.Module):
def init(self, dim, num_heads=1, ffn_expansion_factor=2.66, bias=True, LayerNorm_type='WithBias'):
super(WMB, self).init()
self.DWT = blocks.DWT()
self.IWT = blocks.IWT()
self.norm1 = LayerNorm(dim, LayerNorm_type)
self.illu = Illumination_Estimator(dim, n_fea_in=dim+1, n_fea_out=dim)
self.norm2 = LayerNorm(dim, LayerNorm_type)
self.ffn = FeedForward(dim, ffn_expansion_factor, bias)
self.mb = WM(dim)

def forward(self, input_):
    global m
    x = input_
    n, c, h, w = x.shape
    x = self.norm1(x)
    x = data_transform(x)
    input_dwt = self.DWT(x)
    # input_LL=A [B,C,H/2,W/2]   input_high0={V,H,D} [3B,C,H/2,W/2]
    input_LL, input_high = input_dwt[:n, ...], input_dwt[n:, ...]
    input_LL, input_image = self.illu(input_LL)
    input_high = self.mb(input_high)

    output = self.IWT(torch.cat((input_LL, input_high), dim=0))
    output = inverse_data_transform(output)

    x = x + output
    x = x + self.ffn(self.norm2(x))
    return x`

按在论文中图的解释,低频信息要经过mamba,高频信息只用过卷积就可以了。而在代码中则反了过来。希望你能帮我解释。

@mcpaulgeorge
Copy link
Owner

Loss函数我们还是选用的L1和SSIM的结合加上TVLoss平衡预测后的过曝噪声,常规的小波和傅里叶的loss会出现振荡,所以没有选取,而TVloss是对原预测图而言的,不会因gt影响。
我们在训练时做了很多的消融,但模型训练时归档有点问题,目前模型文件和预训练模型应该是上传了另一个版本,原模型的WMB的模块逻辑应为 input_high, input_image = self.illu(input_high) input_LL = self.mb(input_LL)。 由于毕业季临近,在忙完这阵子后会把预训练模型重新上传。

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