junjue-wang / lovecs Goto Github PK
View Code? Open in Web Editor NEW[RSE 2022] Cross-sensor domain adaptation for high-spatial resolution urban land-cover mapping: from airborne to spaceborne imagery
[RSE 2022] Cross-sensor domain adaptation for high-spatial resolution urban land-cover mapping: from airborne to spaceborne imagery
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.
我想跑一下代码,但是不知道该怎么写设置文件,请问示例里的设置文件能提供吗?
How to deal with the label shift and class difference between domains in your paper? I can not find it
Thanks!
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.