theano

Converting Theano-based Keras model definition to TensorFlow

穿精又带淫゛_ 提交于 2019-12-02 13:51:14
When converting Theano-based Keras model definition to TensorFlow, is it enough to change the order of input_shape on the input layer? For example, the following layer Convolution2D(32, 3, 3, input_shape=(3, img_width, img_height)) will be replaced as Convolution2D(32, 3, 3, input_shape=(img_width, img_height, 3)) Note: I don't want to use dim_ordering='th' . Answer from Francois Chollet : I think the question means "what input_shape should I pass to my first layer given that I'm using TensorFlow and that my default setting for dim_ordering is "tf" ". The answer is yep, that's how you do it,

How to process input and output shape for keras LSTM

孤街醉人 提交于 2019-12-02 13:03:23
问题 I am learning about RNN and I wrote this simple LSTM model in keras (theano) using a sample dataset generated using sklearn. from sklearn.datasets import make_regression from keras.models import Sequential from keras.layers import Dense,Activation,LSTM #creating sample dataset X,Y=make_regression(100,9,9,2) X.shape Y.shape #creating LSTM model model = Sequential() model.add(LSTM(32, input_dim=9)) model.add(Dense(2)) model.compile(loss='mean_squared_error', optimizer='adam') #model fitting

How can you train multiple neural networks simultaneously in nolearn/lasagne/theano on Python?

拟墨画扇 提交于 2019-12-02 12:21:33
问题 I am writing a calibration pipeline to learn the hyperparameters for neural networks to detect properties of DNA sequences*. This therefore requires training a large number of models on the same dataset with different hyperparameters. I am trying to optimise this to run on GPU. DNA sequence datasets are quite small compared to image datasets (typically 10s or 100s of base-pairs in 4 'channels' to represent the 4 DNA bases, A, C, G and T, compared to 10,000s of pixels in 3 RGB channels), and

Issue with simple CAE

左心房为你撑大大i 提交于 2019-12-02 12:18:00
问题 It looks like simple CAE not working for Carvana dataset I’m trying simple CAE for Carvana dataset. You can download it here My code is following: import numpy as np import pandas as pd import matplotlib.pyplot as plt from skimage.io import imread from skimage.transform import downscale_local_mean from skimage.color import rgb2grey from os.path import join, isfile from tqdm import tqdm_notebook from sklearn.model_selection import train_test_split from keras.layers import Conv2D, MaxPooling2D,

深度学习框架太抽象?其实不外乎这五大核心组件

谁都会走 提交于 2019-12-02 10:41:16
许多初学者觉得深度学习框架抽象,虽然调用了几个函数/方法,计算了几个数学难题,但始终不能理解这些框架的全貌。 为了更好地认识深度学习框架,也为了给一些想要自己亲手搭建深度学习框架的朋友提供一些基础性的指导,日前来自苏黎世联邦理工学院计算机科学系的硕士研究生Gokula Krishnan Santhanam在博客上撰文,概括了大部分深度学习框架都会包含的五大核心组件,为我们详细剖析了深度学习框架一般性的内部组织结构。以下由AI科技评论编译。 Gokula Krishnan Santhanam认为,大部分深度学习框架都包含以下五个核心组件: 1. 张量(Tensor) 2. 基于张量的各种操作 3. 计算图(Computation Graph) 4. 自动微分(Automatic Differentiation)工具 5. BLAS、cuBLAS、cuDNN等拓展包 1. 张量(Tensor) 张量是所有深度学习框架中最核心的组件,因为后续的所有运算和优化算法都是基于张量进行的。几何代数中定义的张量是基于向量和矩阵的推广,通俗一点理解的话,我们可以将标量视为零阶张量,矢量视为一阶张量,那么矩阵就是二阶张量。 举例来说,我们可以将任意一张RGB彩色图片表示成一个三阶张量(三个维度分别是图片的高度、宽度和色彩数据)。如下图所示是一张普通的水果图片,按照RGB三原色表示,其可以拆分为三张红色

Receive AssertionError while optimizing convolution in theano

不打扰是莪最后的温柔 提交于 2019-12-02 10:22:19
问题 I am trying to run this code: x_set = np.random.rand(100,100,100) x = T.dtensor3('x') inp = x.reshape((100, 1, 100, 100)) W_stdDev = np.sqrt(2. / (3 * 3 * 2)) W = theano.shared( np.asarray( np.random.normal(loc=.0, scale=W_stdDev, size=(3,1,3,3)), dtype=theano.config.floatX ), borrow=True ) conv_out = conv2d( input=inp, filters=W, filter_shape=(3,1,3,3), ) train_model = theano.function( inputs=[x], outputs=conv_out, ) print(train_model(x_set)) but receive the error: AssertionError:

Python RuntimeError: Failed to import pydot

五迷三道 提交于 2019-12-02 08:19:09
I am learning concepts of logistic regression concepts. When i implement it in python, it shows me some error mentioned below. I am beginner in python. Could anybody help to rectify this error? RuntimeError Traceback (most recent call last) in () 64 theano.printing.pydotprint(predict, 65 outfile="pics/logreg_pydotprint_predic.png", 66 var_with_name_simple=True) 67 # before compilation 68 theano.printing.pydotprint_variables(prediction, C:\Anaconda\lib\site-packages\theano\printing.pyc in pydotprint(fct, outfile, compact, format, with_ids, high_contrast, cond_highlight, colorCodes, max_label

Error running theano.test() - ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed

蹲街弑〆低调 提交于 2019-12-02 07:54:45
I'm trying to get theano up and running on a Windows 10 (x64) machine. I've installed Python from the WinPython distribution, which comes with theano already running. But after installing CUDA 8.0.44 and MingW, I constantly get the following errors when running the simple script import theano theano.test() Note that I had several warnings before, that I already solved (e.g. by installing missing packages from here . But this error gives me no usable information. The really weird thing is, that the module-name is not given anywhere that theano is missing. theano.gof.opt: ERROR: Optimization

Python RuntimeError: Failed to import pydot

一曲冷凌霜 提交于 2019-12-02 07:11:12
问题 I am learning concepts of logistic regression concepts. When i implement it in python, it shows me some error mentioned below. I am beginner in python. Could anybody help to rectify this error? RuntimeError Traceback (most recent call last) in () 64 theano.printing.pydotprint(predict, 65 outfile="pics/logreg_pydotprint_predic.png", 66 var_with_name_simple=True) 67 # before compilation 68 theano.printing.pydotprint_variables(prediction, C:\Anaconda\lib\site-packages\theano\printing.pyc in

Receive AssertionError while optimizing convolution in theano

[亡魂溺海] 提交于 2019-12-02 06:53:13
I am trying to run this code: x_set = np.random.rand(100,100,100) x = T.dtensor3('x') inp = x.reshape((100, 1, 100, 100)) W_stdDev = np.sqrt(2. / (3 * 3 * 2)) W = theano.shared( np.asarray( np.random.normal(loc=.0, scale=W_stdDev, size=(3,1,3,3)), dtype=theano.config.floatX ), borrow=True ) conv_out = conv2d( input=inp, filters=W, filter_shape=(3,1,3,3), ) train_model = theano.function( inputs=[x], outputs=conv_out, ) print(train_model(x_set)) but receive the error: AssertionError: AbstractConv2d Theano optimization failed: there is no implementation available supporting the requested options.