BinaryNet.pytorch icon indicating copy to clipboard operation
BinaryNet.pytorch copied to clipboard

code question about details

Open appleleaves opened this issue 5 years ago • 1 comments

In the file main_binary.py line254, there is a attr as 'org' in p. What does it means and when is it assigned? I cannot find any clues from the whole project.

appleleaves avatar Jan 11 '19 09:01 appleleaves

The key idea here is to compute the grad on real weight value. So he uses an intern parameter .org to save the real weight value during the forward pass. When he needs to apply the grad computed with binarized weight on the real weight value, he replaces binarized weight by the real one store on .org parameter.

Enderdead avatar Mar 26 '19 13:03 Enderdead