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
Filter by
Sorted by
Tagged with
153 votes
12 answers
250k views

Deep-Learning Nan loss reasons

What would cause a Convolutional Neural Network to diverge? Specifics: I am using Tensorflow's iris_training model with some of my own data and keep getting ERROR:tensorflow:Model diverged with loss =...
Free Url's user avatar
  • 1,916
133 votes
28 answers
215k views

NaN loss when training regression network

I have a data matrix in "one-hot encoding" (all ones and zeros) with 260,000 rows and 35 columns. I am using Keras to train a simple neural network to predict a continuous variable. The code to make ...
The_Anomaly's user avatar
  • 2,465
110 votes
11 answers
68k views

How to get reproducible results in keras

I get different results (test accuracy) every time I run the imdb_lstm.py example from Keras framework (https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py) The code contains np.random....
Pavel Surmenok's user avatar
109 votes
6 answers
228k views

Keras, how do I predict after I trained a model?

I'm playing with the reuters-example dataset and it runs fine (my model is trained). I read about how to save a model, so I could load it later to use again. But how do I use this saved model to ...
bky's user avatar
  • 1,335
79 votes
6 answers
193k views

Keras model.summary() result - Understanding the # of Parameters

I have a simple NN model for detecting hand-written digits from a 28x28px image written in python using Keras (Theano backend): model0 = Sequential() #number of epochs to train for nb_epoch = 12 #...
user3501476's user avatar
  • 1,105
69 votes
7 answers
76k views

Convert Keras model to C++ [closed]

I am using Keras (with Theano) to train my CNN model. Does anyone has idea how can I use it in my C++ application? Does anyone tried something similar? I have idea to write some python code that will ...
pplonski's user avatar
  • 5,439
64 votes
8 answers
184k views

How do I install Keras and Theano in Anaconda Python on Windows?

I am trying to work on neural networks in Python using the following Keras packages: from keras.utils import np_utils from keras.layers.core import Dense, Activation, Dropout from keras.models import ...
pavikirthi's user avatar
  • 1,631
64 votes
8 answers
83k views

How to compute Receiving Operating Characteristic (ROC) and AUC in keras?

I have a multi output(200) binary classification model which I wrote in keras. In this model I want to add additional metrics such as ROC and AUC but to my knowledge keras dosen't have in-built ROC ...
Eka's user avatar
  • 14.6k
62 votes
20 answers
171k views

Keras accuracy does not change

I have a few thousand audio files and I want to classify them using Keras and Theano. So far, I generated a 28x28 spectrograms (bigger is probably better, but I am just trying to get the algorithm ...
Murat Aykanat's user avatar
62 votes
5 answers
91k views

What is the number of filter in CNN?

I am currently seeing the API of theano, theano.tensor.nnet.conv2d(input, filters, input_shape=None, filter_shape=None, border_mode='valid', subsample=(1, 1), filter_flip=True, image_shape=None, **...
xxx222's user avatar
  • 3,132
61 votes
6 answers
98k views

What is the correct way to change image channel ordering between channels first and channels last?

I can not for the life of me figure out how to switch the image ordering. images are read in (x,x,3) format, theano requires it to be in (3,x,x) format. I tried changing the order with numpy.array([...
Kuysea's user avatar
  • 693
56 votes
10 answers
86k views

How to switch Backend with Keras (from TensorFlow to Theano)

I tried to switch Backend with Keras (from TensorFlow to Theano) but did not manage. I followed the temps described here but it doesn't work. I created a keras.json in the keras' directory (as it did ...
DaniPaniz's user avatar
  • 1,068
55 votes
8 answers
141k views

How to plot a chart in the terminal

I'm researching ML/Theano, and recently came across this script: https://gist.github.com/notmatthancock/68d52af2e8cde7fbff1c9225b2790a7f which was cool to play with. And like all ML researchers, I ...
Rich's user avatar
  • 1,153
53 votes
2 answers
37k views

Calling "fit" multiple times in Keras

I've working on a CNN over several hundred GBs of images. I've created a training function that bites off 4Gb chunks of these images and calls fit over each of these pieces. I'm worried that I'm only ...
jonas smith's user avatar
47 votes
2 answers
44k views

Getting gradient of model output w.r.t weights using Keras

I am interested in building reinforcement learning models with the simplicity of the Keras API. Unfortunately, I am unable to extract the gradient of the output (not error) with respect to the weights....
Matt S's user avatar
  • 1,434
46 votes
1 answer
7k views

Keras not using multiple cores

Based on the famous check_blas.py script, I wrote this one to check that theano can in fact use multiple cores: import os os.environ['MKL_NUM_THREADS'] = '8' os.environ['GOTO_NUM_THREADS'] = '8' os....
Herbert's user avatar
  • 5,431
44 votes
4 answers
43k views

What is the definition of a non-trainable parameter?

What is the definition of non-trainable parameter in a model? For example, while you are building your own model, its value is 0 as a default, but when you want to use an inception model, it is ...
TheWho's user avatar
  • 829
44 votes
3 answers
86k views

Keras: How to get layer shapes in a Sequential model

I would like to access the layer size of all the layers in a Sequential Keras model. My code: model = Sequential() model.add(Conv2D(filters=32, kernel_size=(3,3), ...
Toke Faurby's user avatar
  • 5,878
42 votes
3 answers
35k views

Activation function after pooling layer or convolutional layer?

The theory from these links show that the order of Convolutional Network is: Convolutional Layer - Non-linear Activation - Pooling Layer. Neural networks and deep learning (equation (125) Deep ...
malioboro's user avatar
  • 3,205
41 votes
5 answers
33k views

theano - print value of TensorVariable

How can I print the numerical value of a theano TensorVariable? I'm new to theano, so please be patient :) I have a function where I get y as a parameter. Now I want to debug-print the shape of this ...
Stefan Profanter's user avatar
40 votes
3 answers
24k views

Keras uses way too much GPU memory when calling train_on_batch, fit, etc

I've been messing with Keras, and like it so far. There's one big issue I have been having, when working with fairly deep networks: When calling model.train_on_batch, or model.fit etc., Keras ...
Martin's user avatar
  • 401
38 votes
5 answers
46k views

How to set up theano config

I'm new to Theano. Trying to set up a config file. First of all, I notice that I have no .theanorc file: locate .theanorc - returns nothing echo $THEANORC - returns nothing theano.test() - passes ok ...
eran's user avatar
  • 14.8k
37 votes
1 answer
11k views

Unsupervised pre-training for convolutional neural network in theano

I would like to design a deep net with one (or more) convolutional layers (CNN) and one or more fully connected hidden layers on top. For deep network with fully connected layers there are methods in ...
Shai's user avatar
  • 113k
36 votes
12 answers
50k views

How to change Keras backend (where's the json file)?

I have installed Keras, and wanted to switch the backend to Theano. I checked out this post, but still have no idea where to put the created json file. Also, below is the error I got when running ...
George Liu's user avatar
  • 3,483
32 votes
9 answers
18k views

Keras verbose training progress bar writing a new line on each batch issue

running a Dense feed-forward neural net in Keras. there are class_weights for two outputs, and sample_weights for a third output. fore some reason it prints the progress verbose display for each batch ...
Natanel Davidovits's user avatar
31 votes
2 answers
26k views

Use of None in Array indexing in Python

I am using the LSTM tutorial for Theano (http://deeplearning.net/tutorial/lstm.html). In the lstm.py (http://deeplearning.net/tutorial/code/lstm.py) file, I don't understand the following line: c = ...
nisace's user avatar
  • 463
30 votes
13 answers
41k views

Keras: "RuntimeError: Failed to import pydot." after installing graphviz and pydot

I'm using Anaconda Python 2.7 on windows 10 I was planning on doing Keras visualization so (whilst spyder was open) I opened the Anaconda command prompt and pip installed graphviz and pydot. Now when ...
ishido's user avatar
  • 4,165
29 votes
6 answers
73k views

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 ...
StephanieCoding's user avatar
28 votes
3 answers
4k views

Theano with Keras on Raspberry Pi

I am trying to get Theano to run with Keras on a Raspberry Pi 3 (B) without success. I tried Ubuntu MATE and Raspbian as operating systems, without success. To install Theano and Keras, I have taken ...
peschn's user avatar
  • 305
27 votes
3 answers
41k views

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....
user200340's user avatar
  • 3,331
27 votes
4 answers
48k views

How to install Theano on Anaconda Python 2.7 x64 on Windows?

I wonder how to install Theano on Anaconda Python 2.7 x64 on Windows 7 x64. The Theano website provides some instructions but is not clear as to what is specific to Anaconda.
Franck Dernoncourt's user avatar
26 votes
5 answers
16k views

Python: rewrite a looping numpy math function to run on GPU

Can someone help me rewrite this one function (the doTheMath function) to do the calculations on the GPU? I used a few good days now trying to get my head around it but to no result. I wonder maybe ...
RaduS's user avatar
  • 2,545
25 votes
2 answers
15k views

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 ...
gaga.zhn's user avatar
  • 281
25 votes
1 answer
13k views

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: (...
Nick's user avatar
  • 958
24 votes
4 answers
43k views

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 ...
Shern's user avatar
  • 761
23 votes
2 answers
9k views

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....
simeon's user avatar
  • 585
22 votes
12 answers
67k views

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 ...
Eka's user avatar
  • 14.6k
21 votes
3 answers
55k views

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 ...
Kong's user avatar
  • 2,283
21 votes
2 answers
6k views

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 ...
user1245262's user avatar
  • 7,326
21 votes
2 answers
2k views

Implementing sparse connections in neural network

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 ...
pir's user avatar
  • 5,685
21 votes
1 answer
905 views

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 ...
pangyuteng's user avatar
  • 1,799
20 votes
1 answer
771 views

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 ...
MJ.Shin's user avatar
  • 381
19 votes
2 answers
13k views

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's user avatar
18 votes
6 answers
34k views

theano g++ not detected

I installed theano but when I try to use it I got this error: WARNING (theano.configdefaults): g++ not detected! Theano will be unable to execute optimized C-implementations (for both CPU and ...
rggir's user avatar
  • 181
18 votes
1 answer
2k views

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 ...
neversaint's user avatar
  • 62.5k
18 votes
1 answer
15k views

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 ...
bjarkemoensted's user avatar
17 votes
1 answer
11k views

Neural Network Ordinal Classification for Age

I have created a simple neural network (Python, Theano) to estimate a persons age based on their spending history from a selection of different stores. Unfortunately, it is not particularly accurate. ...
A. Dev's user avatar
  • 350
17 votes
3 answers
7k views

How can I change device used of theano

I tried to change the device used in theano-based program. from theano import config config.device = "gpu1" However I got error Exception: Can't change the value of this config parameter after ...
Alex Gao's user avatar
  • 2,071
16 votes
3 answers
14k views

Why is the convolutional filter flipped in convolutional neural networks? [closed]

I don't understand why there is the need to flip filters when using convolutional neural networks. According to the lasagne documentation, flip_filters : bool (default: True) Whether to flip ...
KenobiBastila's user avatar
16 votes
2 answers
7k views

Is there a common format for neural networks

Different teams use different libraries to train and run neural networks (caffe, torch, theano...). This makes sharing difficult: each library has its own format to store networks and you have to ...
David's user avatar
  • 1,898

1
2 3 4 5
49