theano

Neural Network Ordinal Classification for Age

旧时模样 提交于 2019-12-03 12:54:48
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. The accuracy might be hurt by the fact that the network has no knowledge of ordinality. For the network there is no relationship between the age classifications. It is currently selecting the age with the highest probability from the softmax output layer. I have considered changing the output classification to an average of the weighted probability for each age. E.g Given age probabilities: (Age

What is the definition of a non-trainable parameter?

怎甘沉沦 提交于 2019-12-03 12:30:14
问题 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 becoming something else rather than 0. What would be the reason behind it? 回答1: Non-trainable parameters are quite a broad subject. A straightforward example is to consider the case of any specific NN model and its architecture. Say we have already setup your network definition in Keras, and your

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

拈花ヽ惹草 提交于 2019-12-03 10:56:59
问题 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([img[:,:,i] for i in range(3)]) which i guess gets the job done, but it is both ugly and i can't figure out how to reverse it to get the original image back. 回答1: To reorder data You can use numpy.rollaxis to roll the axis 3 to position 1 (considering you have the batch size as dimension 0). np

Error while calling eval() on Tensor variable in keras

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using keras and using a layer output for some modifications. Before, using the output ( a tensor variable ) I am converting it to numpy array and thus calling eval() on it, as below: def convert_output(orig_output): conv_output = invoke_modifications(orig_output.eval(), 8) The code fails with following error: File "<ipython-input-11-df86946997d5>", line 1, in <module> orig_output.eval() File "C:\ENV\p34\lib\site-packages\theano-0.9.0.dev4-py3.4.egg\theano\gof\graph.py", line 516, in eval self._fn_cache[inputs] = theano.function(inputs,

Keras LSTM on CPU faster than GPU?

北慕城南 提交于 2019-12-03 09:53:34
问题 I am testing LSTM networks on Keras and I am getting much faster training on CPU (5 seconds/epoch on i2600k 16GB) than on GPU (35secs on Nvidia 1060 6GB). GPU utilisation runs at around 15%, and I never see it over 30% when trying other LSTM networks including the Keras examples. When I run other types of networks MLP and CNN the GPU is much faster. I am using the latest theano 0.9.0dev4 and keras 1.2.0 The sequence has 50,000 timesteps with 3 inputs (ints). If the inputs are descending (3,2

IPython module import error: /usr/bin/ld: cannot find -lpython2.7. collect2: ld returned 1 exit status

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using the Python module Theano on a server. It is not pre-installed on there so I installed it in my home folder along with some other modules that weren't on the server. I get the following error when I "import theano" in IPython. Problem occurred during compilation with the command line below: g++ -shared -g -march=core2 -mcx16 -msahf -maes -mpclmul -mpopcnt -msse4.2 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=12288 -mtune=generic -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D NPY_ARRAY_ENSURECOPY=NPY

Error while using Conv2DLayer with lasagne NeuralNet

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have windows 8.1 64bit and use recommended here http://deeplearning.net/software/theano/install_windows.html#installing-theano python win-python distribution (python 3.4). I've went through every step of tutorial (excluding CUDA stuff and GPU config), uninstalled everything and did it again but my problem persists. I am trying to build convolutional neural network using Lasagne. Every layer I've tested so far is working - only Conv2DLayer throws errors. Code is as follows: net2 = NeuralNet( layers=[ ('input', layers.InputLayer), ('conv1',

How configure theano on Windows?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have Installed Theano on Windows machine and followed the configuration instructions . I placed the following .theanorc.txt file in C:\Users\my_username folder: #!sh [ global ] device = gpu floatX = float32 [ nvcc ] fastmath = True # flags=-m32 # we have this hard coded for now [ blas ] ldflags = # ldflags = -lopenblas # placeholder for openblas support I tried to run the test, but haven't managed to run it on GPU. I guess the values from .theanorc.txt are not read, because I added the line print config.device and it outputs "cpu

how to fit a method belonging to an instance with pymc3?

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I failed to fit a method belonging to an instance of a class, as a Deterministic function, with PyMc3. Can you show me how to do that ? For simplicity, my case is summarised below with a simple example. In reality, my constraint is that everything is made through a GUI and actions like ‘find_MAP’ should be inside methods linked to pyqt buttons. I want to fit the function ‘FunctionIWantToFit’ over the data points. Problem, the following code: import numpy as np import pymc3 as pm3 from scipy.interpolate import interp1d import theano.tensor as

Training only one output of a network in Keras

痞子三分冷 提交于 2019-12-03 08:06:47
I have a network in Keras with many outputs, however, my training data only provides information for a single output at a time. At the moment my method for training has been to run a prediction on the input in question, change the value of the particular output that I am training and then doing a single batch update. If I'm right this is the same as setting the loss for all outputs to zero except the one that I'm trying to train. Is there a better way? I've tried class weights where I set a zero weight for all but the output I'm training but it doesn't give me the results I expect? I'm using