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
11
votes
5 answers

Theano HiddenLayer Activation Function

Is there anyway to use Rectified Linear Unit (ReLU) as the activation function of the hidden layer instead of tanh() or sigmoid() in Theano? The implementation of the hidden layer is as follows and as far as I have searched on the internet ReLU is…
A.M.
  • 1,757
  • 5
  • 22
  • 41
11
votes
3 answers

How to put my dataset in a .pkl file in the exact format and data structure used in "mnist.pkl.gz"?

I'm trying to use the Theano library in python to do some experiments with Deep Belief Networks. I use the code in this address: DBN full code. This code use the MNIST Handwritten database. This file is already in pickle format. It is unpicked in:…
John Krit
  • 544
  • 1
  • 6
  • 20
11
votes
2 answers

What exactly is a tensor in theano?

What exactly is a Tensor in Theano, and what is the precise connection with Tensors as they are typically understood in Physics or Math? I went through the Theano at Glance and the Basic Tensor functionality, but I could not find a clear connection.
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
10
votes
5 answers

ImportError: Version check of the existing lazylinker compiled file. Looking for version 0.211, but found None

C:\Users\meela\Anaconda3\python.exe E:/TTIGAN/test.py You can find the C code in this temporary file: C:\Users\meela\AppData\Local\Temp\theano_compilation_error_zncbj7_k Traceback (most recent call last): File…
Mlan604
  • 113
  • 1
  • 1
  • 4
10
votes
0 answers

Nonlinear convolution in Theano

I'm trying to make a "custom" convolutional layer in Theano, where instead of linear filters convoluted with an image, I'm applying sup- or inf- convolutions (essentially dilations and erosions). How would I go in writing such a convolution in an…
VHarisop
  • 2,816
  • 1
  • 14
  • 28
10
votes
1 answer

How to update weights in keras for reinforcement learning?

I am working in a reinforcement learning program and I am using this article as the reference. I am using python with keras(theano) for creating neural network and the pseudo code I am using for this program is Do a feedforward pass for the current…
Eka
  • 14,170
  • 38
  • 128
  • 212
10
votes
2 answers

getting "pygpu was configured but could not be imported" error while trying with OpenCL+Theano on AMD Radeon

I have followed the instructions from this: https://gist.github.com/jarutis/ff28bca8cfb9ce0c8b1a But then when I tried : THEANO_FLAGS=device=opencl0:0 python test.py on the test file I am getting error: ERROR (theano.sandbox.gpuarray): pygpu was…
Sayantan Ghosh
  • 998
  • 2
  • 9
  • 29
10
votes
1 answer

What do Keras convolution layers do with color channels?

Bellow is a piece of example code from the documentation in Keras. It looks like the first convolution accepts a 256x256 image with 3 color channels. It has 64 output filters (I think these are the same as feature maps which I have read about…
chasep255
  • 11,745
  • 8
  • 58
  • 115
10
votes
1 answer

How to enable Keras with Theano to utilize multiple GPUs

Setup: Using a Amazon Linux system with a Nvidia GPU I'm using Keras 1.0.1 Running Theano v0.8.2 backend Using CUDA and CuDNN THEANO_FLAGS="device=gpu,floatX=float32,lib.cnmem=1" Everything works fine, but I run out of video memory on large…
Ray
  • 40,256
  • 21
  • 101
  • 138
10
votes
2 answers

how to setup cuDnn with theano on Windows 7 64 bit

I have installed Theano framework and enabled CUDA on my machine, however when I "import theano" in my python console, I got the following message: >>> import theano Using gpu device 0: GeForce GTX 950 (CNMeM is disabled, CuDNN not available) Now…
Tyler Xie
  • 169
  • 1
  • 3
  • 13
10
votes
3 answers

Keras: How to feed input directly into other hidden layers of the neural net than the first?

I have a question about using Keras to which I'm rather new. I'm using a convolutional neural net that feeds its results into a standard perceptron layer, which generates my output. This CNN is fed with a series of images. This is so far quite…
10
votes
4 answers

How is Hard Sigmoid defined

I am working on Deep Nets using keras. There is an activation "hard sigmoid". Whats its mathematical definition ? I know what is Sigmoid. Someone asked similar question on Quora:…
Anuj Gupta
  • 6,328
  • 7
  • 36
  • 55
10
votes
1 answer

TensorFlow or Theano: how do they know the loss function derivative based on the neural network graph?

In TensorFlow or Theano, you only tell the library how your neural network is, and how feed-forward should operate. For instance, in TensorFlow, you would write: with graph.as_default(): _X = tf.constant(X) _y = tf.constant(y) hidden =…
Ricardo Magalhães Cruz
  • 3,504
  • 6
  • 33
  • 57
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
10
votes
2 answers

PyMC3 & Theano - Theano code that works stop working after pymc3 import

Some simple theano code that works perfectly, stop working when I import pymc3 Here some snipets in order to reproduce the error: #Initial Theano Code (this works) import theano.tensor as tsr x = tsr.dscalar('x') y = tsr.dscalar('y') z = x +…
Samoht-Sann
  • 256
  • 1
  • 8