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
8
votes
2 answers

CNN with keras, accuracy not improving

I have started with Machine Learning recently, I am learning CNN, I planned to write an application for Car Damage severity detection, with the help of this Keras blog and this github repo. This is how car data-set looks…
Laxmikant
  • 2,046
  • 3
  • 30
  • 44
8
votes
4 answers

Flattening two last dimensions of a tensor in TensorFlow

I'm trying to reshape a tensor from [A, B, C, D] into [A, B, C * D] and feed it into a dynamic_rnn. Assume that I don't know the B, C, and D in advance (they're a result of a convolutional network). I think in Theano such reshaping would look like…
naktinis
  • 3,957
  • 3
  • 36
  • 52
8
votes
3 answers

ModuleNotFoundError: No module named 'tensorflow.python.training'

When I am trying to run this import keras I am getting following error: Traceback (most recent call last): File "", line 1, in import keras File…
Md. Rezwanul Haque
  • 2,882
  • 7
  • 28
  • 45
8
votes
3 answers

How to dynamically freeze weights after compiling model in Keras?

I would like to train a GAN in Keras. My final target is BEGAN, but I'm starting with the simplest one. Understanding how to freeze weights properly is necessary here and that's what I'm struggling with. During the generator training time the…
Andrzej Pisarek
  • 271
  • 3
  • 9
8
votes
1 answer

Accessing gradient values of keras model outputs with respect to inputs

I made a pretty simple NN model to do some non-linear regressions for me in Keras, as an introduction exercise. I uploaded my jupyter notebookit as a gist here (renders properly on github), which is pretty short and to the point. It just fits the 1D…
thearn
  • 323
  • 3
  • 6
8
votes
1 answer

Behavior of Dropout layers in test / training phase

According to the Keras documentation dropout layers show different behaviors in training and test phase: Note that if your model has a different behavior in training and testing phase (e.g. if it uses Dropout, BatchNormalization, etc.), you …
null
  • 1,369
  • 2
  • 18
  • 38
8
votes
2 answers

Why is a CNN slower to train than a fully connected MLP in Keras?

I looked to the following examples from Keras: MLP in MNIST: https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py CNN in MNIST: https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py I run both in Theano on CPU. In the…
Jorge del Val
  • 111
  • 1
  • 3
8
votes
4 answers

'::hypot' has not been declared

I'm using python3.6 theano, with mingw-w64-x86-64 installed, my os is Win10_64, cuda installed, and seems everything is ok the theano.test() is ok, saying my gpu is working, but it just keeps tell me that "error: '::hypot' has not been declared" …
YJHMITWEB
  • 113
  • 2
  • 7
8
votes
1 answer

Keras: reshape to connect lstm and conv

This question exists as a github issue , too. I would like to build a neural network in Keras which contains both 2D convolutions and an LSTM layer. The network should classify MNIST. The training data in MNIST are 60000 grey-scale images of…
lhk
  • 27,458
  • 30
  • 122
  • 201
8
votes
4 answers

ImportError: No module named downsample

I am using Theano. The OS is Ubuntu. The Theano is UPTODATE. I am wondering why I am getting by from theano.tensor.signal.downsample import max_pool_2d command. ImportError: No module named downsample.
Amn Kh
  • 531
  • 3
  • 7
  • 19
8
votes
2 answers

How to implement Weighted Binary CrossEntropy on theano?

How to implement Weighted Binary CrossEntropy on theano? My Convolutional neural network only predict 0 ~~ 1 (sigmoid). I want to penalize my predictions in this way : Basically, i want to penalize MORE when the model predicts 0 but the truth was…
KenobiBastila
  • 539
  • 4
  • 16
  • 52
8
votes
3 answers

Keras Convolution2D Input: Error when checking model input: expected convolution2d_input_1 to have shape

I am working through this great tutorial on creating an image classifier using Keras. Once I have trained the model, I save it to a file and then later reload it into a model in a test script shown below. I get the following exception when I…
JessicaOwensby
  • 189
  • 1
  • 7
8
votes
1 answer

Deconvolution2D layer in keras

This layer in not ready documented very well and I'm having a bit of trouble figuring out exactly how to use it. I'm Trying something like: input_img = Input(shape=(1, h, w)) x = Convolution2D(16, 7, 7, activation='relu',…
izikgo
  • 479
  • 7
  • 12
8
votes
3 answers

WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: cuda unavailable)

in Ubuntu MATE 16.04 I'm trying to run the deep-learning python examples here using the GPU: testing Theano with GPU I did run the example code, THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python check1.py but it seems that it is used the…
valerio_sperati
  • 793
  • 2
  • 9
  • 23
8
votes
6 answers

g++ error on import of Theano on Windows 7

I'm attempting to get setup with a proper g++ installation according to the theano installation guide. I've previously had theano working with the python only implementation. I'm using the bleeding edge version of theano from their git repo on…
Jwely
  • 682
  • 5
  • 18