GithubHelp home page GithubHelp logo

Comments (3)

benanne avatar benanne commented on June 2, 2024

The nonlinearities are added separately, try to search for NonlinearityLayer in the code.

Presumably this is because it is easier to reason about densenets if you consider a block to consist of (batchnorm -> nonlinearity -> linear layer), rather than the commonly used definition of (linear layer -> batchnorm -> nonlinearity), which is also the one that Lasagne assumes.

from recipes.

rongrongxiangxin avatar rongrongxiangxin commented on June 2, 2024

@benanne Thanks, I got what you mean. Just like in
image, the structure in the block is (batchnorm -> nonlinearity -> linear layer).

But, in the initial convolution,
image

and in the linear layer in the block, they are linear layers. So the linear layer is special in densenet? Because in other networks, the convolution layers are always nonlinear.

from recipes.

f0k avatar f0k commented on June 2, 2024

Sorry, I was working on a paper. The initial convolution has nonlinearity=None because it is followed by bn_relu_conv(), which adds batch normalization and a rectifier. If the initial convolution had a rectifier itself, the network would start with conv -> relu -> bn -> relu, which is not what we want. Feel free to print the layers after creating the network:

for layer in lasagne.layers.get_all_layers(network):
    print layer.name, layer.__class__.__name__

It may get confusing due to the merge layers, but at least the beginning should be clear.

Presumably this is because it is easier to reason about densenets if you consider a block to consist of (batchnorm -> nonlinearity -> linear layer)

Exactly, like in the pre-activation residual networks.

from recipes.

Related Issues (20)

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.