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
The usage of gumbel softmax in DS-Net #10
Comments
I don't understand why slimming head is nondifferentiable, because I think the output of slimming head is not in the computation graph of latter network layers. |
Hi @sixzerotech The output of slimming head is used as a sub-network routing signal for subsequent layers. First, let we assume that the SGS training loss is not introduced. To optimize the gate by AutoGrad end-to-end, we need to include its output in the computation graph. This is achieved by masking the output of subsequent layers by the output of the gate. However, this hard (0 or 1) mask is not differentiable. We follow previous works that use tricks such as semihash, gumbel-softmax to tuckle this. Second, as we already introduced SGS loss, the end-to-end target loss with gumbel-softmax is not a necessity. However, as SGS loss will only encourage the network to choose the first or last gate (gate target is [1, 0, 0, 0] or [0, 0, 0, 1]), it is better to combine it with end-to-end target loss with gumbel-softmax. |
Thank you very much for your reply! |
hi, changlin, I have another question about the 02/20 10:47:40 AM blocks.3.first_block.gate: tensor([257., 12., 12., 7., 12., 10., 9., 18., 11., 13., 9., 18., 02/20 10:47:40 AM Current checkpoints: |
Hi, @sixzerotech This is an expected behavior as the gate is very difficult to tune. I suggest you limit the routing space to larger sub-networks (e.g., choice 4-8) if you want to select larger ones. Or, you could try disabling the complexity loss and lower the weight of SGS loss. |
Yes, I agree with you that the gate is really difficult to tune after my countless experiments. Thank you for your quick reply, looking forward to your future work to solve this thorny problem. |
Thank you for your understanding. I'm closing this for now. |
Thank you for your very nice work,I want to know that the effect of gumble softmax,because I think the network can be trained without gumble softmax.
Is the gumbel softmax just aimed to increase the randomness of channel choice?
The text was updated successfully, but these errors were encountered: