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
26
votes
6 answers

Package installed by Conda, Python cannot find it

I try to install Theano by Anaconda. It works, but when I enter the python -i, import theano shows No module named 'theano'. Do I need to switch another interpreter of Python, how? Also, for the packages installed by conda, if I don't double…
StephanieCoding
  • 436
  • 1
  • 5
  • 7
26
votes
3 answers

Install Cuda without root

I know that I can install Cuda with the following: wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run chmod +x cuda_7.0.28_linux.run ./cuda_7.0.28_linux.run -extract=`pwd`/nvidia_installers cd…
user200340
  • 3,301
  • 13
  • 52
  • 74
25
votes
1 answer

input dimensions to a one dimensional convolutional network in keras

really finding it hard to understand the input dimensions to the convolutional 1d layer in keras: Input shape 3D tensor with shape: (samples, steps, input_dim). Output shape 3D tensor with shape: (samples, new_steps, nb_filter). steps value might…
Nick
  • 920
  • 1
  • 7
  • 21
25
votes
2 answers

How can I assign/update subset of tensor shared variable in Theano?

When compiling a function in theano, a shared variable(say X) can be updated by specifying updates=[(X, new_value)]. Now I am trying to update only subset of a shared variable: from theano import tensor as T from theano import function import…
gaga.zhn
  • 281
  • 1
  • 3
  • 5
24
votes
4 answers

Is it possible to activate virtualenv in Google-colab? (/bin/sh: 1: source: not found)

I am trying to install theano in Google Colab for testing. I have installed virtualenv and created an environment: !pip3 install virtualenv !virtualenv theanoEnv But am not able to activate the virtual environment even explicitly mentioned the…
Shern
  • 712
  • 1
  • 8
  • 20
23
votes
2 answers

Policy Gradients in Keras

I've been trying to build a model using 'Deep Q-Learning' where I have a large number of actions (2908). After some limited success with using standard DQN: (https://www.cs.toronto.edu/~vmnih/docs/dqn.pdf), I decided to do some more research because…
simeon
  • 585
  • 4
  • 15
22
votes
12 answers

How to uninstall Keras?

I have installed Keras using this command: sudo pip install keras It installed properly and worked fine until I tried to import application modules: from keras.applications.vgg16 import VGG16 Using Theano backend. Couldn't import dot_parser,…
Eka
  • 14,170
  • 38
  • 128
  • 212
21
votes
3 answers

keras - cannot import name Conv2D

I recently got the deep learning docker from https://github.com/floydhub/dl-docker running and while trying out the tutorials, received an error when importing the keras layers module. from __future__ import print_function import keras from…
Kong
  • 2,202
  • 8
  • 28
  • 56
21
votes
2 answers

Implementing sparse connections in neural network (Theano)

Some use cases for neural networks requires that not all neurons are connected between two consecutive layers. For my neural network architecture, I need to have a layer, where each neuron only has connections to some prespecified neurons in the…
pir
  • 5,513
  • 12
  • 63
  • 101
21
votes
1 answer

3d sliding window operation in Theano?

TL.DR. Is there a 3-dimensional friendly implementation of theano.tensor.nnet.neighbours.images2neibs? I would like to perform voxel-wise classification of a volume (NxNxN) using a neural network that takes in a nxnxn image, where N>n. To classify…
pangyuteng
  • 1,749
  • 14
  • 29
21
votes
2 answers

Purpose of 'givens' variables in Theano.function

I was reading the code for the logistic function given at http://deeplearning.net/tutorial/logreg.html. I am confused about the difference between inputs & givens variables for a function. The functions that compute mistakes made by a model on a…
user1245262
  • 6,968
  • 8
  • 50
  • 77
20
votes
1 answer

Numpy installation error. (Mingw32CCompiler instance has no attribute 'compile_options')

I use python with windows8 / anaconda spyder (2.7) I'm trying to update Theano up-to-date. When I installing the theano by "pip install --upgrade theano" The error happens at numpy installation part. Though numpy is available to use in anaconda…
MJ.Shin
  • 381
  • 1
  • 9
19
votes
2 answers

How to find wrong prediction cases in test set (CNNs using Keras)

I'm using MNIST example with 60000 training image and 10000 testing image. How do I find which of the 10000 testing image that has an incorrect classification/prediction?
user3796320
  • 327
  • 1
  • 2
  • 9
18
votes
1 answer

Will dropout automatically be deactivated in Keras model?

I have trained a model in Keras. The model contains dropout layers and I want to be absolutely sure nothing is dropped when doing this. According to the documentation, a layer's output can be extracted like this: layer_name =…
bjarkemoensted
  • 2,557
  • 3
  • 24
  • 37
18
votes
1 answer

Using Deep Learning to Predict Subsequence from Sequence

I have a data that looks like this: It can be viewed here and has been included in the code below. In actuality I have ~7000 samples (row), downloadable too. The task is given antigen, predict the corresponding epitope. So epitope is always an…
neversaint
  • 60,904
  • 137
  • 310
  • 477