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

增加训练层数 #10

Open
Sh3lock opened this issue Jul 3, 2024 · 1 comment
Open

增加训练层数 #10

Sh3lock opened this issue Jul 3, 2024 · 1 comment

Comments

@Sh3lock
Copy link

Sh3lock commented Jul 3, 2024

嗨,我想提高代码中的训练层数,于是我将class RetinexMamba(nn.Module):中的level = 2 改为了level =3,修改后的代码如下:
`class RetinexMamba(nn.Module):
"""
多阶段 Retinex 图像处理网络,每个阶段都通过 RetinexMamba_Single_Stage 来实现,
进行图像的照明估计和增强。
"""
def init(self, in_channels=3, out_channels=3, n_feat=48, stage=1, num_blocks=[2, 4, 4,4], d_state=16):
"""
初始化 Retinex 图像处理网络。

    参数:
        in_channels (int): 输入图像的通道数,通常为3(RGB图像)。
        out_channels (int): 输出图像的通道数,通常为3(RGB图像)。
        n_feat (int): 特征层数,表示中间特征的深度。
        stage (int): 网络包含的阶段数,每个阶段都使用一个 RetinexMamba_Single_Stage 模块。
        num_blocks (list): 每个阶段的块数,指定每个单阶段中的块数量。
    """
    super(RetinexMamba, self).__init__()
    self.stage = stage  # 网络的阶段数

    # 创建多个 RetinexMamba_Single_Stage 实例,每个实例都作为网络的一个阶段
    modules_body = [RetinexMamba_Single_Stage(in_channels=in_channels, out_channels=out_channels, n_feat=n_feat, level=2, num_blocks=num_blocks, d_state=d_state)
                    for _ in range(stage)]
    
    # 将所有阶段模块封装成一个顺序模型
    self.body = nn.Sequential(*modules_body)`
@Sh3lock
Copy link
Author

Sh3lock commented Jul 3, 2024

可是我发现它并没有正常工作,我看了好多遍代码也没发现问题,你可以提示我一下如果需要增加level还需要修改哪些地方吗?
QQ截图20240703195157

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

1 participant