Code Monkey home page Code Monkey logo

distributionloss's People

Contributors

ruizhoud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

distributionloss's Issues

Question about the last layer

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.

Request commit model for cifar10

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.

Question About Gradient mismatch

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,

  1. Degeneration Loss makes mean of activation to zero.
  2. Saturation Loss reduces the number of activation with A>1 and A<-1

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.

First activation function without quantization?

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?

Question about distribution loss

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!

Implementation of [distrloss_layer.py]

[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:

  • Gradient Mismatch Loss: torch.min(2 - mean - std, 2 + mean - std).clamp(min=0) ** 2).mean()
  • Saturation Loss: (std - 4).clamp(min=0) ** 2

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.