samleoqh / MSCG-Net

Multi-view Self-Constructing Graph Convolutional Networks with Adaptive Class Weighting Loss for Semantic Segmentation
MIT License
68 stars 28 forks source link

Aux large influence the training phase. #17

Open YLongJin opened 2 years ago

YLongJin commented 2 years ago

It is great job. when I traning my dataset, most of the time,the iou is satirfactory ,but sometimes the aux loss would be very large. I debug the coed I found the sgn input x which comput to gama would be abnormal. I want to know why it will happend and can you give me some advice. Thanks very much

samleoqh commented 2 years ago

it sounds like the the diagonal entries of A (adj matrix) are very small numbers in your case, then its mean value will be close to zero, thus the gama will be very large. A workaround is to use clamp to setup a maxum value to gama, e.g. adding code after # line #42 in scg_gcn.py

gama = torch.clamp(gama , min=1., max=5.0)

YLongJin commented 2 years ago

I got it and the problem was solved, the input of the sgn is just numbered, how can I comput and get the min=1 max=5?