Git Product home page Git Product logo

Comments (5)

BenjaminBossan avatar BenjaminBossan commented on July 21, 2024

nolearn uses whatever Lasagne layers you throw at it. I have trained with layers using the pad parameter, so I believe that it should work. If you encounter an error when using these parameters, post the exact code here and we may help. Remember that those are Lasagne parameters, not nolearn parameters.

from nolearn.

algila avatar algila commented on July 21, 2024

In effect 'pad is working just not documented in nolearn not so important.
It is the 'flip_filters' that is not working. hereafter the portion of the code where I define the layer.

`cnn = NeuralNet(
layers=[
('input', layers.InputLayer),
('conv1', layers.Conv2DLayer), #Convolutional layer. Params defined below
('pool1', layers.MaxPool2DLayer), # Like downsampling, for execution speed
('conv2', layers.Conv2DLayer),
('pool2', layers.MaxPool2DLayer),
('conv3', layers.Conv2DLayer),
('dropout1', layers.DropoutLayer),
('dense', layers.DenseLayer),
('dropout2', layers.DropoutLayer),
#('dense2', layers.DenseLayer),
#('dropout3', layers.DropoutLayer),
('output', layers.DenseLayer),
],

input_shape=(None, 1, 28, 28),

conv1_num_filters=96, 
conv1_pad=1,
conv1_flip_filters=False,
conv1_filter_size=(3, 3), 
conv1_nonlinearity=lasagne.nonlinearities.rectify,
conv1_W=lasagne.init.GlorotUniform(),` 

The received error message is:
TypeError: Failed to instantiate <class 'lasagne.layers.conv.Conv2DLayer'> with args {'W': <lasagne.init.GlorotUniform object at 0x7f57d78cd890>, 'flip_filters': False, 'pad': 1, 'name': 'conv1', 'nonlinearity': <function rectify at 0x7f57dc0d29b0>, 'filter_size': (3, 3), 'incoming': <lasagne.layers.input.InputLayer object at 0x7f57d78cda50>, 'num_filters': 96}. Maybe parameter names have changed?
everything is working just commenting the line #conv1_flip_filters=False,

from nolearn.

BenjaminBossan avatar BenjaminBossan commented on July 21, 2024

This looks more like the Lasagne version installed with nolearn not supporting that parameter. Is it possible to instantiate a conv layer with that parameter at all?

layer = layers.ConvLayer(..., conv1_flip_filters=False)

If not, maybe installing the latest Lasagne version will help.

In general, the nolearn documentation will not repeat all the parameters from Lasagne. That does not mean that nolearn does not support them.

from nolearn.

algila avatar algila commented on July 21, 2024

I have
nolearn 0.6.1
Theano 0.8.2
Lasagne 0.1 but in my version the file into the package folder lasagne/layers/conv.py has not into the class BaseConvLayer the 'flip_filter'. It is mentioned into lasagne folder available in github website.

I should immagine that I do not have the last version but if I try the command
'Sudo apt-get update lasagne' the response is that I just have the last release.

I should imagine that my version is corrupted so I try to delete using the command
'sudo apt-get --purge remove Lasagne' but the response is that lasagne is not found

No other idea to fix this issue

from nolearn.

algila avatar algila commented on July 21, 2024

I solved, the reason was exactly the old lasagne version. Using:

pip install --upgrade https://github.com/Theano/Theano/archive/master.zip
pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip

I installed lasagne 0.2dev2 with also Theano 0.9dev4 and now it is working
1 billion of thanks

BR
Alberto

from nolearn.

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.