This code uses tensor.sign() to binarize the activations and weights.
The desired behavior is to always return -1 or 1, but sign() returns 0 for values that are 0.
Batch normalization makes 0 less probable, but it can still happen. The code should probably force every activation to be either -1 or 1.
This code uses
tensor.sign()to binarize the activations and weights.BinaryNet.pytorch/models/binarized_modules.py
Line 13 in f5c3672
The desired behavior is to always return -1 or 1, but
sign()returns 0 for values that are 0.Batch normalization makes 0 less probable, but it can still happen. The code should probably force every activation to be either -1 or 1.