ruizhoud / distributionloss Goto Github PK
View Code? Open in Web Editor NEWSource code for paper "Regularizing Activation Distribution for Training Binarized Deep Networks"
Source code for paper "Regularizing Activation Distribution for Training Binarized Deep Networks"
Hi Ruizhou,
Thanks for sharing your code.
I'm very impressed of your excellent work because it makes network tolerant of various types of optimizers and values of hyperparameters. I have a question about after the last layer whether there is Distrloss_layer or not.
In Cifar10 experiment, you use 7 Convolution layers(written as xC-xC-MP-2xC-2xC-MP-4xC-4xC-10C-GP) and I think the first layer is full precision convolution, whereas, the others are all binary convolutions including the last layer (10C). Is there a Distrloss_layer after the last binary convolution layer? I assume 10C-GP part as 10C-BN-Distrloss_layer-GP.
Can you commit model for cifar10 described in the paper xC-xC-MP-2xC-2xC-MP-4xC-4xC-10C-GP?
I have some difficulties to reproduce result of the papers.
Hello! The link of checkpoint is missed, could you upload it again? Thanks very much!
Hi Ruizhou,
This paper on weight regularization is quite interesting!
I have a question about the code here. After this line executed, all the weights are forced to be in [-1, 1]. If so, how could gradient mismatch be mitigated/solved?
Haichao
Hi,
BNN_DL is very nice paper, solving the fundamental problem of BNN.
However, I have some ploblem understanding Degeneration, Saturation and Gradient mismatch.
According to what I understand,
Intuitively,
Then, What is the role of Gradient Mismatch Loss?
It is difficult to understand the meaning of formula [ReLU(1-|u|-k*sigma)]^2.
I think the only way avoiding gradient missmatch problem is changing activation function. (BNN+, Self-binarizing network)
Could you explain in more detail?
Thanks.
Hi Ruizhou,
Thanks for sharing your code!
While going through your code, I found you used LeakyReLU for the first activation function and didn't quantize its output. Therefore it seems the second convolution layer takes full precision input instead of binary input. Previous works (i.e. XNOR-Net, DoReFa-Net) quantize the first activation as well.
Have you tried to quantize the first activation layer too?
Hi Ruizhou,
Thanks for sharing your code!
When I read your code, there are some problems that bother me. I cannot understand the codes for distribution loss, because they are inconsistent with the description in the paper. In addition, the hyper-parameter is also inconsistent with that in the paper.
Cloud you help me and make some explanations about the distribution loss in the code?
Thanks!
[distrloss_layer.py]
distrloss1 = (torch.min(2 - mean - std, 2 + mean - std).clamp(min=0) ** 2).mean() + ((std - 4).clamp(min=0) ** 2).mean()
distrloss2 = (mean ** 2 - std ** 2).clamp(min=0).mean()
According to the paper, it seems to be
distrloss1:
Q1. Why 2 & 4 instead of 1 which is described in the paper?
distrloss2:
Degeneration Loss: (mean ** 2 - std ** 2).clamp(min=0)
Q2. Why not (torch.abs(mean) - std).clamp(min=0) ** 2?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.