You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I faced the same issue and in my case weights and activations with a value of 0 appear quite often.
Replacing the tensor.sign() with torch.where(tensor >= 0, 1., -1.) does the trick
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.
The text was updated successfully, but these errors were encountered: