Questions tagged [lasagne]

Lasagne provides a high-level API for creating neural networks using Theano on the backend. Questions about lasagne do not need to also utilize the "theano" tag, unless the question is specifically about Lasagne-Theano integration or the Theano backend.

Lasagne is a Python package build around expressions for neural networks training. was designed as a high-level API on top of , with the intention of making rapid prototyping of neural network architectures easier. It is similar in spirit to , which is built as a high-level API on top of //, although the main difference is that Lasagne implements only one backend, allowing it to integrate more deeply with Theano features.

Resources

Resources and Teaching

Implementations of Network Architectures

204 questions
83
votes
3 answers

How to calculate the number of parameters for convolutional neural network?

I'm using Lasagne to create a CNN for the MNIST dataset. I'm following closely to this example: Convolutional Neural Networks and Feature Extraction with Python. The CNN architecture I have at the moment, which doesn't include any dropout layers,…
Waddas
  • 1,353
  • 2
  • 16
  • 28
16
votes
3 answers

Why is the convolutional filter flipped in convolutional neural networks?

I don't understand why there is the need to flip filters when using convolutional neural networks. According to the lasagne documentation, flip_filters : bool (default: True) Whether to flip the filters before sliding them over the input, …
11
votes
1 answer

Trying to find object coordinates (x,y) in image, my neural network seems to optimize error without learning

I generate images of a single coin pasted over a white background of size 200x200. The coin is randomly chosen among 8 euro coin images (one for each coin) and has : random rotation ; random size (bewteen fixed bounds) ; random position (so that…
Silicium14
  • 726
  • 7
  • 12
10
votes
2 answers

Select GPU during execution in Theano

I am training neural nets with theano and lasagne on a 4 GPU machine. My .theanorc contains the following lines: [global] device = gpu0 So when in python I execute import theano, I get Using gpu device 0: GRID K520 What if, after importing theano,…
P. Camilleri
  • 12,664
  • 7
  • 41
  • 76
9
votes
1 answer

Can I (selectively) invert Theano gradients during backpropagation?

I'm keen to make use of the architecture proposed in the recent paper "Unsupervised Domain Adaptation by Backpropagation" in the Lasagne/Theano framework. The thing about this paper that makes it a bit unusual is that it incorporates a 'gradient…
Bill Cheatham
  • 11,396
  • 17
  • 69
  • 104
8
votes
2 answers

How to implement Weighted Binary CrossEntropy on theano?

How to implement Weighted Binary CrossEntropy on theano? My Convolutional neural network only predict 0 ~~ 1 (sigmoid). I want to penalize my predictions in this way : Basically, i want to penalize MORE when the model predicts 0 but the truth was…
KenobiBastila
  • 539
  • 4
  • 16
  • 52
8
votes
3 answers

Pickle python lasagne model

I have trained a simple long short-term memory (lstm) model in lasagne following the recipie here:https://github.com/Lasagne/Recipes/blob/master/examples/lstm_text_generation.py Here is the architecture: l_in = lasagne.layers.InputLayer(shape=(None,…
user2726995
  • 2,064
  • 2
  • 21
  • 26
7
votes
1 answer

Simple MLP time series training yields unexpeced mean line results

I'm trying to play around with simple time series predictions. Given number of inputs (1Min ticks) Net should attempt to predict next one. I've trained 3 nets with different settings to illustrate my problem: On the right you can see 3 trainer…
Max Yari
  • 3,617
  • 5
  • 32
  • 56
7
votes
1 answer

Add bias to Lasagne neural network layers

I am wondering if there is a way to add bias node to each layer in Lasagne neural network toolkit? I have been trying to find related information in documentation. This is the network I built but i don't know how to add a bias node to each…
Negative Zero
  • 1,224
  • 3
  • 10
  • 19
6
votes
2 answers

Lasagne/nolearn autoencoder - how to get hidden layer output?

I've trained an autoencoder using lasagne/nolearn. Suppose the network layers are [500, 100, 100, 500]. I've trained the neural net like so: net.fit(X, X) I want to do something like the following: net.predict(X, layer=2) so I'll get the…
Stergios
  • 3,126
  • 6
  • 33
  • 55
6
votes
1 answer

numpy array from csv file for lasagne

I started learning how to use theano with lasagne, and started with the mnist example. Now, I want to try my own example: I have a train.csv file, in which every row starts with 0 or 1 which represents the correct answer, followed by 773 0s and 1s…
5
votes
1 answer

from . import nonlinearities cannot import name nonlinearities

there is some really strange problem. Traceback (most recent call last): File "mnist.py", line 17, in import lasagne.nonlinearities as nonlinearities File "/usr/local/lib/python2.7/dist-packages/lasagne/init.py", line 17, in …
cxy
  • 156
  • 1
  • 7
5
votes
1 answer

Is there hope for using Lasagne's Adam implementation for Probabilistic Matrix Factorization?

I am implementing Probabilistic Matrix Factorization models in theano and would like to make use of Adam gradient descent rules. My goal is to have a code that is as uncluttered as possible, which means that I do not want to keep explicitly track of…
fstab
  • 4,801
  • 8
  • 34
  • 66
5
votes
0 answers

How to export ConvNet trained using Python's Theano/Lasagne to iOS?

I trained a convolutional neural net with Lasagne and Theano frameworks on Python. I am satisfied with the architecture and the performance of the net on test data and I want to use it on an iPad application. I was wondering if there is any simple…
guyov
  • 93
  • 1
  • 7
5
votes
1 answer

Keras - Text Classification - LSTM - How to input text?

Im trying to understand how to use LSTM to classify a certain dataset that i have. I researched and found this example of keras and imdb : https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py However, im confused about how the data…
KenobiBastila
  • 539
  • 4
  • 16
  • 52
1
2 3
13 14