-
Notifications
You must be signed in to change notification settings - Fork 44
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
Sparsity constraint in channel exchanging #17
Comments
Hi, for semantic segmentation, the sparsity constraint is implemented at: CEN/semantic_segmentation/main.py Lines 396 to 400 in 158e313
(2) adding the loss of the sparsity constraint, CEN/semantic_segmentation/main.py Lines 282 to 283 in 158e313
For image-to-image translation, the sparsity constraint is implemented at: CEN/image2image_translation/main.py Lines 112 to 119 in 158e313
(2) adding the loss of the sparsity constraint, CEN/image2image_translation/main.py Lines 208 to 213 in 158e313
|
Thank you for your reply! However I am still confused as to where the sparsity constraint in terms of channel exchanging is implemented, as the sections of code you referenced seem to be applying the sparsity constraint to the loss calculation. I am mainly confused about CEN/semantic_segmentation/models/modules.py Lines 12 to 15 in 158e313
which seems to exchange channels within all of x[0] and x[1] , instead of disjoint sub-parts of them.
|
Hi, take semantic segmentation as an example: CEN/semantic_segmentation/main.py Lines 396 to 400 in 158e313
In the case of two modalities, we divide channels into two disjoint sub-parts, which is implemented by adding param[:len(param) // 2 and param[len(param) // 2:] to slim_params. Followed up by the sparsity loss on slim_params, which means only the sub-parts in slim_params are constrained by L1.
We find if a channel is out of the sparsity constraints (L1), its BN scaling factor can be hardly lower than the small threshold during training. Therefore we check the criteria for channel exchanging directly on the whole channels, CEN/semantic_segmentation/models/modules.py Lines 12 to 15 in 158e313
Since constraining half (disjoint sub-parts) of the channels is already implemented in main.py , checking the exchanging criteria on the whole channels is almost equivalent to disjoint sub-parts.
|
That makes sense. Thank you for your detailed explanation! |
@yikaiw 你好 (1) 我不是特别理解用L1norm来惩罚 scale factor 在loss function 的意义,这一项在loss function里不就是让 scale factor 越来越小么 简单的来说。能不能稍微解释一下呢, 谢谢🙏 |
Hello,
Thank you for your very interesting work! I was planning on experimenting with CEN but I couldn't seem to find the implementation of the sparsity constraint in channel exchanging, as mentioned in Section 3.3, that channel exchanging is only performed in different (disjoint) sub-parts for different modalities. Would you be able to point me to where in the model is this implemented?
Thanks.
The text was updated successfully, but these errors were encountered: