Questions tagged [theano]

Theano is a numerical computation library for Python. Computations are expressed using a Numpy-like syntax and compiled to run efficiently on either CPU or GPU architectures. Theano uses a mathematical computational graph and optimized the graph to speed up the computations using optimized C code. As of release 1.0, Theano will no longer be actively developed.

Theano is a Python library for performing tensor calculations with a -like syntax. Theano can be used to define, optimize, and evaluate mathematical expressions involving tensors (also see ). Some of the principal features of Theano that set it apart from other libraries have become commonplace in neural network and tensor math libraries:

  • Integrates with Numpy and provides Numpy-like syntax to express models using mathematical syntax
  • Represents calculations as computation graphs and optimizes graphs for better performance and memory utilization
  • Utilizes GPU hardware for data-intensive calculations
  • Performs high-order differentiation automatically (symbolically)
  • Compiles computation graphs into C code for faster execution

Theano enables rapid building of large-scale computational codes with less cognitive overhead and more expressive syntax. However, it is easy enough to learn that it is used in several deep learning courses (including at the University of Montreal, where it was originally developed).

Several projects build on top of Theano, including and .

As of Theano 1.0, Theano will no longer be under active development. See announcement on mailing list.

Resources

Trivia

Theano is named after a high priestess of Athena in the city of Troy, from Homer's Iliad.

2447 questions
12
votes
1 answer

What is the difference between these two ways of adding Neural Network layers in Keras?

I'm using Keras with a Theano as a backend and I have Sequential neural network model. I wonder is there a difference between following? model.add(Convolution2D(32, 3, 3, activation='relu')) and model.add(Convolution2D(32, 3,…
angubenko
  • 264
  • 1
  • 3
  • 11
11
votes
0 answers

Getting Keras (with Theano) to work with Celery

I have some keras code which works synchronously to predict a given input, I have even made amendments so it can work with standard multi-threading (using locks in a seperate class from this) however when running via asynchronous celery (even with…
bmjrowe
  • 306
  • 1
  • 2
  • 15
11
votes
1 answer

Keras: convert pretrained weights between theano and tensorflow

I would like to use this pretrained model. It is in theano layout, my code depends on tensorflow image dimension ordering. There is a guide on converting weights between the formats. But this seems broken. In the section to convert theano to…
lhk
  • 27,458
  • 30
  • 122
  • 201
11
votes
4 answers

softmax and sigmoid function for the output layer

In the deep learning implementations related to object detection and semantic segmentation, I have seen the output layers using either sigmoid or softmax. I am not very clear when to use which? It seems to me both of them can support these tasks.…
user288609
  • 12,465
  • 26
  • 85
  • 127
11
votes
1 answer

Implement word2vec in Keras

I would like to implement word2vec algorithm in keras, Is this possible? How can I fit the model? Should I use custom loss function?
András
  • 3,395
  • 1
  • 21
  • 27
11
votes
2 answers

How to write an LSTM in Keras without an Embedding layer?

How do you write a simple sequence copy task in keras using the LSTM architecture without an Embedding layer? I already have the word vectors.
user2879934
  • 349
  • 3
  • 13
11
votes
1 answer

Saliency maps of neural networks (using Keras)

I have a fully connected multilayer perceptron trained in Keras. I feed it an N-dimensional feature vector and it predicts one out of M classes for the input vector. The training and prediction is working well. Now I want to analyze what part of the…
sanjeev mk
  • 4,276
  • 6
  • 44
  • 69
11
votes
3 answers

Keras IndexError: indices are out-of-bounds

I'm new to Keras and im trying to do Binary MLP on a dataset, and keep getting indices out of bounds with no idea why. from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import…
Wboy
  • 2,452
  • 2
  • 24
  • 45
11
votes
3 answers

Import keras.datasets not working

I have keras installed on my linux machine, but when I try to import a dataset from the keras.datasets I get an error that it cannot find it. So for example: from keras.datasets import mnist I get the error ImportError: No module named…
patapouf_ai
  • 17,605
  • 13
  • 92
  • 132
11
votes
2 answers

Using a GPU both as video card and GPGPU

Where I work, we do a lot of numerical computations and we are considering buying workstations with NVIDIA video cards because of CUDA (to work with TensorFlow and Theano). My question is: should these computers come with another video card to…
Ricardo Magalhães Cruz
  • 3,504
  • 6
  • 33
  • 57
11
votes
2 answers

"g++ not detected" while data set goes larger, is there any limit to matrix size in GPU?

I got this message in using Keras to train an RNN for language model with a big 3D tensor (generated from a text, one hot encoded, and results a shape of (165717, 25, 7631)): WARNING (theano.configdefaults): g++ not detected ! Theano will be unable…
seven7e
  • 798
  • 1
  • 8
  • 19
11
votes
1 answer

Keras load weights of a neural network / error when predicting

I'm using the Keras library to create a neural network. I have a iPython Notebook in order to load the training data, initializing the network and "fit" the weights of the neural network. Finally, I save the weights using the save_weights()…
Julian
  • 556
  • 1
  • 8
  • 27
11
votes
1 answer

dimshuffle equivalent function in Numpy

I often use theano.tensor.dimshuffle. Is there an equivalent function for Numpy? I guess I could do the same via several numpy.swapaxes and numpy.newaxis (for broadcast dimensions), numpy.reshape but is there some simpler or more direct way, just…
Albert
  • 65,406
  • 61
  • 242
  • 386
11
votes
2 answers

how does theano.scan's updates work?

theano.scan return two variables: values variable and updates variable. For example, a = theano.shared(1) values, updates = theano.scan(fn=lambda a:a+1, outputs_info=a, n_steps=10) However, I notice that in most of the examples I work with, the…
user5016984
  • 121
  • 1
  • 5
11
votes
1 answer

does nolearn/lasagne support python 3

I am working with Neural Net implementation in nolearn.lasagne as mentioned here However I get the following error: ImportError: No module named 'cPickle' I figure out that cPickle is pickle in python-3 Does nolearn/lasagne support python-3 ? If…
Vikas Raturi
  • 916
  • 2
  • 13
  • 23