Skip to content

Code architectures of Denoising and Super-resolution are different from Inpainting #3

@Ares960826

Description

@Ares960826

Dear Dr. Li.

Sorry for bothering you and hope you are doing well!

May I ask why Code architectures of Denoising and Super-resolution are different from Inpainting?

For example, there is no codebase like this in train_denoising.py:

# @train_ip.py
... ... ... ...
        optimizer_bn.step()
        epoch_loss.append(loss.item())

        ### after one update, we would like to change our network weight back to its initializaiton
        old_weight_dict_after_opt = net.state_dict()
        new_weight_dict_after_opt = {}
        for param_key in net.state_dict():
            # custom initialization in new_weight_dict,
            # You can initialize partially i.e only some of the variables and let others stay as it is
            #print(param_key)
            # we only want to add noise to the CNN layers; we do not want to change the BN paprameters
            if param_key in CNN_weight_name:  # it's a CNN layer, so we want to copy back the init weights
                old_weight = old_weight_dict[param_key]
                new_weight_dict_after_opt[param_key] = old_weight
            else: # it's a BN layer, so we want to update its weights
                old_weight = old_weight_dict_after_opt[param_key]
                new_weight_dict_after_opt[param_key] = old_weight
        net.load_state_dict(new_weight_dict_after_opt)
        # let's fix the weights of networks
        for name, param in net.named_parameters():
            ### here we do not want to fix the BN
            if name in CNN_weight_name:
                param.requires_grad = False

        ### let's update our learning rate
        #scheduler_net.step()
        #scheduler_noise.step()
        #scheduler_bn.step()

        # ------ after one epoch: end to measure the time in this iteration
        if epoch != 0:
            t_end = time.time()
            per_used_time = t_end - t_start
            all_used_time += per_used_time
... ... ... ...

Best regards,
Mingze
PhD Candidate
University of Strathclyde

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions