GithubHelp home page GithubHelp logo

junjue-wang / lovecs Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 3.0 39 KB

[RSE 2022] Cross-sensor domain adaptation for high-spatial resolution urban land-cover mapping: from airborne to spaceborne imagery

Python 99.36% Shell 0.64%
domain-adaptation land-cover-mapping remote-sensing

lovecs's People

Contributors

junjue-wang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lovecs's Issues

Poor F1 score and precision

I run
#!/usr/bin/env bash
config_path='st.lovecs.2CZ.lovecs'
python LoveCS_train.py --config_path=${config_path}

But after that, i got poor f1 score. precision, and recall.
What should I fix. Is there anything that I should setting? Why I do not have f1 score. precision, and recall like in the paper?

For replace the batch normalizations with cross-sensor normalizations, I thing it has been on LoveCS_train.py in your github, so I do not modification anything.

Question about "replace_bn_with_csn"

Hi, @Junjue-Wang. Your work is great. I have a question about replace_bn_with_csn.
For replace_bn_with_csn in the file csn.py, I find that the term .data.clone().detach() should be commented as follows to successfully work when I tested:

def replace_bn_with_csn(module:nn.Module, affine_tar=False):
    '''
    Args:
        module: the original model with BNs

    Returns:
        module: the model with the CSNs
    '''
    module_output = module
    if isinstance(module, torch.nn.modules.batchnorm._BatchNorm):
        module_output = CSNorm2d(module.num_features, module.eps, module.momentum, module.affine, affine_tar=affine_tar)
        if module.affine:
            with torch.no_grad():
                module_output.weight_source = module.weight#.data.clone().detach()
                module_output.bias_source = module.bias#.data.clone().detach()
        if affine_tar:
            with torch.no_grad():
                module_output.weight_target.data = module.weight#.data.clone().detach()
                module_output.bias_target.data = module.bias#.data.clone().detach()
        module_output.running_mean_source = module.running_mean#.data.clone()
        module_output.running_var_source = module.running_var#.data.clone()
        module_output.running_mean_target = module.running_mean#.data.clone()
        module_output.running_var_target = module.running_var#.data.clone()
        module_output.num_batches_tracked = module.num_batches_tracked#.data.clone()

    for name, child in module.named_children():
        module_output.add_module(name, replace_bn_with_csn(child))
    del module
    return module_output

Besides, I want to know whether it is necessary to change the batchnorm layer in the decoder to csn, in addition to that in the encoder? Have you ever tested it?
Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.