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
1
vote
2 answers

Lasagne - error

i am trying to learn neural nets / lasagne by using the code in Robert Layton's Learning Data Mining with Python. I think i am following the code to the letter, but i get the following error message. any hints or intuition what i am doing wrong much…
user1885116
  • 1,757
  • 4
  • 26
  • 39
1
vote
2 answers

Using Theano on Windows: missing lazylinker_ext.pyd

When running a Python script that contain import theano, I get this error: =============================== 00001 #include 00002 #include "structmember.h" 00003 #include 00004 00005 // Old Python compatibility from…
Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
1
vote
2 answers

Why does this minimal RNN code throw a type error for a type never used?

I'm trying to implement a minimal recurrent neural network example in theano. I expected the following python script to print a 10-by-20 matrix representing a hidden state sequence. # import packages/functions from theano import shared, scan,…
1
vote
2 answers

Installing nolearn (python machine learning) results in error

I am attempting to install nolearn, a python machine learning library (based upon theano and lasagne), and am receiving an unusual error (note: the command is the first step in installing nolearn as install docs): COMMAND: sudo pip install -r…
Eric Broda
  • 6,701
  • 6
  • 48
  • 72
1
vote
1 answer

lasagne - unexpected keyword error

I am trying to learn machine learning in Python - and would like to run the lasagne / nolearn packages. I have installed all packages - and am using the script per below (from http://semantive.com/deep-learning-examples/) which gives the following…
user1885116
  • 1,757
  • 4
  • 26
  • 39
1
vote
1 answer

Minimize cosine distance theano

I have a simple and working multi-layer perceptron in Theano, with 1 hidden layer and 1 regression layer with 2 outputs. In the regression layer a mean square error function is defined which is used as cost function. However, during learning I now…
Semi
  • 448
  • 1
  • 5
  • 16
1
vote
1 answer

T.hessian gives NotImplementedError() in theano

How it can be that it works g_W = T.grad(cost=cost, wrt=classifier.vparamW) whereas this H_W=T.hessian(cost=cost, wrt=classifier.vparamW) gives NotImplementedError() may it be that the problem in such cost function: …
1
vote
1 answer

RuntimeError: NaN in hidden0_W, No handlers could be found for logger "sknn" scikit-neuralnetwork

I am trying to implement the Neural Network Classifier in Python. Here is the snippet of the function def create_and_train_nn(train_predictors,train_responses): print '\t\tcreating Neural Network' nn = Classifier( layers=[ …
Debasish Kanhar
  • 1,123
  • 2
  • 15
  • 27
1
vote
1 answer

Troubles with simple accumulation with Theano scan function

I am trying to accumulate matrix values while multiplying with the step: res = sum_i(i * a). My code looks like this: import numpy as np from theano import function, scan import theano.tensor as T x = T.lmatrix() results, updates = scan( …
Mikael Rousson
  • 2,247
  • 1
  • 15
  • 16
1
vote
1 answer

Theano: use ifelse to suppress evaluation of scan

I am trying to implement this paper: Deep Learning for Answer Sentence Selection and more accurately the Bigram model using theano's scan function like this: Tl = theano.shared(...) Tr = theano.shared(...) b = theano.shared(...) s =…
user3688217
  • 538
  • 2
  • 5
  • 15
1
vote
1 answer

Buidling matrix using scan within theano

I'm pretty certain this is trivial, but I haven't yet managed to quite get my head around scan. I want to iteratively build a matrix of values, m, where m[i,j] = f(m[k,l]) for k < i, j < l so you could think of it as a dynamic programming problem.…
dbeacham
  • 986
  • 2
  • 9
  • 16
1
vote
1 answer

Logistic Regression in Theano

I'm new to theano. I've learnt the basics and trying to implement simple models (Logistic Regression etc.). The model is a very simple with 784 (28*28) input units and a 10 unit softmax non-linearity on top of it (Training on MNIST dataset). I'm…
ayandas
  • 2,070
  • 1
  • 13
  • 26
1
vote
1 answer

Theano example for solving linear programming

I have the following problem. Let's say we have x_{jk} it is an expression value of gene j in a sample k. It is the average of expression levels across the cell types s_{ij}, weighted by respective proportions a_{ki} (i = 1 ... N,N is the disease…
neversaint
  • 60,904
  • 137
  • 310
  • 477
1
vote
1 answer

Calculate the normalized dot product of two matrices using Theano

I would like to get the normalized dot product of 2 matrices using Theano. By normalized dot product of 2 matrices, I define the normalized inner product of 2 vectors as the following: Take v_a from matrix A, and vector v_b from matrix B.…
RKM
  • 3,151
  • 9
  • 37
  • 50
1
vote
1 answer

MissingInputError with theano scan function

I am experimenting with Theano and specifically with the function scan. I want to use it to apply a linear classifier to a set of feature vectors stored as columns of a matrix X (I am sure there are better ways to do it, this is just to get…
mzs
  • 43
  • 6