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.

2444 questions
1
vote
1 answer

Theano cost function

I am trying to learn how to use Theano. I work very frequently with survival analysis and I wanted therefore to try to implement a standard survival model using Theano's automatic differentiation and gradient descent. The model that I am trying to…
user1936768
  • 639
  • 1
  • 8
  • 12
1
vote
1 answer

something wrong about T.gt()

In order to obtain the usage of T.gt(), i wrote a toy code. def f(data): # return T.gt(data, 0) if T.gt(data, 0): print "1" return -data else: print "2" return data a = T.scalar() t = f(a) print…
danieljf24
  • 43
  • 5
1
vote
1 answer

Theano ImportError and process Warning when compiling function

I am running Theano with Anaconda on Windows. Ihave pretty much followed the steps in the comments here. I can import theano with no problems: import theano from theano import tensor as T x = T.vector('x') W = T.matrix('W') dot = T.dot(x, W) This…
theQman
  • 1,423
  • 4
  • 24
  • 38
1
vote
1 answer

theano vector matrix product along third dimension

I've got w = T.matrix('w') and X = T.tensor3('X'). Assume w is 1xd and X is 3 x 10 x d. I want as a result a matrix of size 3 x 10 where the i-th row is w.dot(X[i,:,:].T). Is there a way to do this in theano?
nuju
  • 33
  • 3
1
vote
0 answers

How can the numerical values of Theano hidden layers be accessed efficiently, i.e. not eval()?

Excuse me, is there any efficient way of extracting the numerical values of hidden layer in theano? I can do this work with .eval(), which is super slow. The code is (based on modification of dA.py) y =…
user864128
  • 137
  • 3
  • 9
1
vote
1 answer

theano: row-wise outer product between two matrices

I'm trying to compute the row-wise outer-product between two matrices in theano, without using scan. I can do this in numpy by using einsum, which isn't available in theano. A = np.array([[1,1,1],[2,2,2]]) B = np.array([[3,3,3,3],[4,4,4,4]]) print…
krasnaya
  • 2,684
  • 3
  • 19
  • 18
1
vote
0 answers

Importing theano - nvcc : fatal error : nvcc cannot find a supported version of Microsoft Visual Studio

I got this warning/error message whenever I try importing theano-based packages for the first time (it disappear the second time...). I'm wondering how to get rid of it or disable it since it seems not to affect anything except for being ugly...…
Yue
  • 111
  • 1
  • 8
1
vote
1 answer

theano function not updating parameters during gradient optimization in feed forward neural net

Trying to get my hands wet with theano and deep nets by starting with a very simple implementation of a three layer feed forward neural network and testing it on the mnist data set. I am using a rudimentary implementation of stochastic gradient…
Shaayaan Sayed
  • 231
  • 2
  • 4
  • 13
1
vote
1 answer

White spaces in Theano arrays

I just started playing around with Theano and I got surprised by the result of this code. from theano import * import theano.tensor as T a = T.vector() out = a + a ** 10 f = function([a], out) print(f([0, 1, 2])) Using python3 I get: array([ 0.,…
alec_djinn
  • 7,288
  • 8
  • 29
  • 58
1
vote
2 answers

Printing expressions of variables in Theano

If I want to print some variable for debugging in theano, it is easy, just write x2 = printing.Print('x is: ')(x), and then use x2 instead of x in the following computations. But what if I want to print some expression of x, for example x+y. How can…
Sunny88
  • 2,490
  • 3
  • 20
  • 25
1
vote
1 answer

Why do the environment variables set in command prompt have no effect when I start Spyder

I am using the Spyder Anaconda IDE for Python. I am writing a code in the Spyder IDE that requires few environment variables to be set ($CPATH, $LIBRARY_PATH and $LD_LIBRARY_PATH) for the Theano library. I am starting Spyder using the command sudo…
London guy
  • 24,942
  • 40
  • 110
  • 169
1
vote
2 answers

Theano gradient calculation creates float64

I have some standard NN code on Theano with two separate compiled functions. One that calculates the cost and one that calculates the cost with AdaGrad updates. For GPU speed, I'm trying to keep everything float32. Problem is that I'm getting a…
AsianYayaToure
  • 153
  • 1
  • 2
  • 11
1
vote
1 answer

Keras / Theano: How to add Convolution2D Layers?

Im having issues on how to understand how Convolution Layers are added. Im trying to add Convolution Layers but i get this error : ValueError: GpuCorrMM shape inconsistency: bottom shape: 128 32 30 30 weight shape: 3 32 3 3 top shape: 128 1…
user2136049
1
vote
2 answers

python.exe crashes when importing `theano`

I am using Anaconda(2.2 64bit) on a Windows 7 64-bit machine. When I try to import theano Python crashes without infomation. I installed theano using Anaconda. Does anyone know where this problem comes from?
1
vote
1 answer

Theano set_value for casted shared variable

In the Theano deep learning tutorial, y is a shared variable that is casted: y = theano.shared(numpy.asarray(data, dtype=theano.config.floatX)) y = theano.tensor.cast(y, 'int32') I later want to set a new value for y. For GPU this works: …
eyaler
  • 1,864
  • 5
  • 23
  • 41
1 2 3
99
100