Coder Social home page Coder Social logo

Add deconvolution layer about mocha.jl HOT 3 OPEN

pluskid avatar pluskid commented on June 27, 2024
Add deconvolution layer

from mocha.jl.

Comments (3)

philtomson avatar philtomson commented on June 27, 2024

It was mentioned in an email exchange that it may be as simple as swapping the forward and backward functions of the ConvolutionLayer to make a DeconvolutionLayer. What happens with n_filters, however? A convolution with n_filters = N creates N feature maps - how do those map back in the deconvolution?

from mocha.jl.

pluskid avatar pluskid commented on June 27, 2024

@philtomson I have pushed an implementation in the deconv branch, which added de conv support in convolution layer. You can have a look at that. In de convolution, nfilter also mean the number of channels in the target image. There is also a brief convolution.md if that makes thing a bit clear.

So conceptually it is reverting convolution layer, but actually more complicated than that. I have not merged it into master because the implementation is for cpu backend only. I'm still thinking about how to implement it for gpu as we currently invoke cudnn for gpu convolution.

from mocha.jl.

philtomson avatar philtomson commented on June 27, 2024

@pluskid Thanks for adding this. We're wondering if there might be an error in backpropagation for the deconvolution layer (ConvolutionLayer with deconv=true). We keep seeing the Square loss go very rapidly towards Inf or NaN.

Network looks like this:


      NAME: ImageTrain
   BACKEND: CPUBackend

ARCHITECTURE: 5 layers
............................................................
*** MemoryDataLayer(data)
Outputs ---------------------------
data: Blob(750 x 750 x 3 x 10)
............................................................
*** MemoryDataLayer(label)
Outputs ---------------------------
label: Blob(750 x 750 x 10)
............................................................
*** ConvolutionLayer(conv1)
Inputs ----------------------------
data: Blob(750 x 750 x 3 x 10)
Outputs ---------------------------
conv: Blob(746 x 746 x 16 x 10)
............................................................
*** ConvolutionLayer(deconv)
Inputs ----------------------------
conv: Blob(746 x 746 x 16 x 10)
Outputs ---------------------------
deconv: Blob(750 x 750 x 1 x 10)
............................................................
*** SquareLossLayer(loss)
Inputs ----------------------------
deconv: Blob(750 x 750 x 1 x 10)
label: Blob(750 x 750 x 10)


23-Jan 16:06:05:INFO:root:
23-Jan 16:06:05:INFO:root:## Performance on Validation Set after 0 iterations
23-Jan 16:06:05:INFO:root:---------------------------------------------------------
23-Jan 16:06:05:INFO:root: Square-loss (avg over 10) = 77664.4219
23-Jan 16:06:05:INFO:root:---------------------------------------------------------
23-Jan 16:06:05:INFO:root:
23-Jan 16:07:54:INFO:root:000002 :: TRAIN obj-val = 1906052777742086025773056.00000000
23-Jan 16:10:16:INFO:root:
23-Jan 16:10:16:INFO:root:## Performance on Validation Set after 4 iterations
23-Jan 16:10:16:INFO:root:---------------------------------------------------------
23-Jan 16:10:16:INFO:root: Square-loss (avg over 10) = Inf
23-Jan 16:10:16:INFO:root:---------------------------------------------------------
23-Jan 16:10:16:INFO:root:

from mocha.jl.

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.