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
44
votes
4 answers

What is the definition of a non-trainable parameter?

What is the definition of non-trainable parameter in a model? For example, while you are building your own model, its value is 0 as a default, but when you want to use an inception model, it is becoming something else rather than 0. What would be…
TheWho
  • 829
  • 3
  • 9
  • 19
44
votes
3 answers

Keras: How to get layer shapes in a Sequential model

I would like to access the layer size of all the layers in a Sequential Keras model. My code: model = Sequential() model.add(Conv2D(filters=32, kernel_size=(3,3), input_shape=(64,64,3) …
Toke Faurby
  • 5,788
  • 9
  • 41
  • 62
41
votes
1 answer

Keras not using multiple cores

Based on the famous check_blas.py script, I wrote this one to check that theano can in fact use multiple cores: import os os.environ['MKL_NUM_THREADS'] = '8' os.environ['GOTO_NUM_THREADS'] = '8' os.environ['OMP_NUM_THREADS'] =…
Herbert
  • 5,279
  • 5
  • 44
  • 69
41
votes
3 answers

Activation function after pooling layer or convolutional layer?

The theory from these links show that the order of Convolutional Network is: Convolutional Layer - Non-linear Activation - Pooling Layer. Neural networks and deep learning (equation (125) Deep learning book (page 304, 1st paragraph) Lenet (the…
malioboro
  • 3,097
  • 4
  • 35
  • 55
41
votes
5 answers

theano - print value of TensorVariable

How can I print the numerical value of a theano TensorVariable? I'm new to theano, so please be patient :) I have a function where I get y as a parameter. Now I want to debug-print the shape of this y to the console. Using print y.shape results in…
Stefan Profanter
  • 6,458
  • 6
  • 41
  • 73
40
votes
3 answers

Keras uses way too much GPU memory when calling train_on_batch, fit, etc

I've been messing with Keras, and like it so far. There's one big issue I have been having, when working with fairly deep networks: When calling model.train_on_batch, or model.fit etc., Keras allocates significantly more GPU memory than what the…
Martin
  • 401
  • 1
  • 4
  • 6
38
votes
5 answers

How to set up theano config

I'm new to Theano. Trying to set up a config file. First of all, I notice that I have no .theanorc file: locate .theanorc - returns nothing echo $THEANORC - returns nothing theano.test() - passes ok I'm guessing some default configuration was…
eran
  • 14,496
  • 34
  • 98
  • 144
37
votes
1 answer

Unsupervised pre-training for convolutional neural network in theano

I would like to design a deep net with one (or more) convolutional layers (CNN) and one or more fully connected hidden layers on top. For deep network with fully connected layers there are methods in theano for unsupervised pre-training, e.g., using…
Shai
  • 111,146
  • 38
  • 238
  • 371
36
votes
12 answers

How to change Keras backend (where's the json file)?

I have installed Keras, and wanted to switch the backend to Theano. I checked out this post, but still have no idea where to put the created json file. Also, below is the error I got when running import keras in Python Shell: Using TensorFlow…
George Liu
  • 3,601
  • 10
  • 43
  • 69
31
votes
9 answers

Keras verbose training progress bar writing a new line on each batch issue

running a Dense feed-forward neural net in Keras. there are class_weights for two outputs, and sample_weights for a third output. fore some reason it prints the progress verbose display for each batch calculated, and not updating the print on the…
Natanel Davidovits
  • 331
  • 1
  • 3
  • 6
31
votes
2 answers

Use of None in Array indexing in Python

I am using the LSTM tutorial for Theano (http://deeplearning.net/tutorial/lstm.html). In the lstm.py (http://deeplearning.net/tutorial/code/lstm.py) file, I don't understand the following line: c = m_[:, None] * c + (1. - m_)[:, None] * c_ What…
nisace
  • 463
  • 1
  • 4
  • 11
30
votes
13 answers

Keras: "RuntimeError: Failed to import pydot." after installing graphviz and pydot

I'm using Anaconda Python 2.7 on windows 10 I was planning on doing Keras visualization so (whilst spyder was open) I opened the Anaconda command prompt and pip installed graphviz and pydot. Now when I try run the following: from keras.models import…
ishido
  • 4,065
  • 9
  • 32
  • 42
28
votes
3 answers

Theano with Keras on Raspberry Pi

I am trying to get Theano to run with Keras on a Raspberry Pi 3 (B) without success. I tried Ubuntu MATE and Raspbian as operating systems, without success. To install Theano and Keras, I have taken following steps: Install miniconda (armv7…
peschn
  • 305
  • 3
  • 8
27
votes
4 answers

How to install Theano on Anaconda Python 2.7 x64 on Windows?

I wonder how to install Theano on Anaconda Python 2.7 x64 on Windows 7 x64. The Theano website provides some instructions but is not clear as to what is specific to Anaconda.
Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
26
votes
5 answers

Python: rewrite a looping numpy math function to run on GPU

Can someone help me rewrite this one function (the doTheMath function) to do the calculations on the GPU? I used a few good days now trying to get my head around it but to no result. I wonder maybe somebody can help me rewrite this function in…
RaduS
  • 2,465
  • 9
  • 44
  • 65