theano

Cyclic computational graphs with Tensorflow or Theano

孤街浪徒 提交于 2019-12-29 09:14:18
问题 Both TensorFlow and Theano do not seem to support cyclic computational graphs, cyclic elements are implemented as recurrent cells with buffer and unrolling (RNN / LSTM cells), but this limitation is mostly related with the computation of back-propagation. I don't have a particular need for computing back-propagation but just the forward propagations. Is there a way to ignore this limitation, or perhaps just to break down arbitrary computational graphs in acyclic components? 回答1: TensorFlow

浅谈chainer框架

会有一股神秘感。 提交于 2019-12-27 10:30:35
一 chainer基础 Chainer是一个专门为高效研究和开发深度学习算法而设计的开源框架。 这篇博文会通过一些例子简要地介绍一下Chainer,同时把它与其他一些框架做比较,比如Caffe、Theano、Torch和Tensorflow。 大多数现有的深度学习框架是在模型训练之前构建计算图。 这种方法是相当简单明了的,特别是对于结构固定且分层的神经网络(比如卷积神经网络)的实现。 然而,现在的复杂神经网络(比如循环神经网络或随机神经网络)带来了新的性能改进和新的应用。虽然现有的框架可以用于实现这些复杂神经网络,但是它们有时需要一些(不优雅的)编程技巧,这可能会降低代码的开发效率和可维护性。 而Chainer的方法是独一无二的:即在训练时“实时”构建计算图。 这种方法可以让用户在每次迭代时或者对每个样本根据条件更改计算图。同时也很容易使用标准调试器和分析器来调试和重构基于Chainer的代码,因为Chainer使用纯Python和NumPy提供了一个命令式的API。 这为复杂神经网络的实现提供了更大的灵活性,同时又加快了迭代速度,提高了快速实现最新深度学习算法的能力。 以下我会介绍Chainer是如何工作的,以及用户可以从中获得什么样的好处。 Chainer 是一个基于Python的独立的深度学习框架。 不同于其它基于Python接口的框架(比如Theano和TensorFlow

Keras 深度学习框架中文文档

故事扮演 提交于 2019-12-26 18:02:50
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Keras深度学习框架中文文档 Keras官网: http://keras.io/ Github项目: https://github.com/fchollet/keras 中文文档主页: http://keras-cn.readthedocs.io/en/latest/ Github中文文档: https://github.com/MoyanZitto/keras-cn.git 快速开始Keras   Keras的核心数据结构是“模型”,模型是一种组织网络层的方式。Keras中主要的模型是Sequential模型,Sequential是一系列网络层按顺序构成的栈。Sequential模型如下: from keras.models import Sequential model = Sequential()   将一些网络层通过.add()堆叠起来,就构成了一个模型: from keras.layers.core import Dense, Activation model.add(Dense(output_dim=64, input_dim=100)) model.add(Activation("relu")) model.add(Dense(output_dim=10)) model.add

Keras 深度学习框架的优化器(optimizers)

狂风中的少年 提交于 2019-12-26 17:52:58
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> optimizers(优化器)。 机器学习包括两部分内容,一部分是如何构建模型,另一部分就是如何训练模型。训练模型就是通过挑选最佳的优化器去训练出最优的模型。 Keras包含了很多优化方法。比如最常用的随机梯度下降法(SGD),还有Adagrad、Adadelta、RMSprop、Adam等。下面通过具体的代码介绍一下优化器的使用方法。最重要的就是SGD,其他的优化器有兴趣的可以自行了解一下。 一、优化器的使用方法 在编译一个Keras模型时,优化器是2个参数之一(另外一个是损失函数)。看如下代码: model = Sequential() model.add(Dense(64, init='uniform', input_dim=10)) model.add(Activation('tanh')) model.add(Activation('softmax')) sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True) model.compile(loss='mean_squared_error', optimizer=sgd) 这个例子中是在调用compile之前实例化了一个优化器。我们也可以通过传递名字的方式调用默认的优化器。代码如下: #

What is the use of Mask? [closed]

巧了我就是萌 提交于 2019-12-25 20:03:26
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I often see use of masks (in C, C++, Python, Java), like masked softmax or something. I can't understand its use (I am not talking about masks in computer vision but about masks in programming in general). I understood mask as something you used in a bitwise operation like x & 1 :

What is the use of Mask? [closed]

瘦欲@ 提交于 2019-12-25 20:01:49
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I often see use of masks (in C, C++, Python, Java), like masked softmax or something. I can't understand its use (I am not talking about masks in computer vision but about masks in programming in general). I understood mask as something you used in a bitwise operation like x & 1 :

Theano row/column wise subtraction

怎甘沉沦 提交于 2019-12-25 08:14:54
问题 X is an n by d matrix, W is an m by d matrix, for every row in X I want to compute the squared Euclidean distance with every row in W , so the results will be an n by m matrix. If there's only one row in W , this is easy x = tensor.TensorType("float64", [False, False])() w = tensor.TensorType("float64", [False])() z = tensor.sum((x-w)**2, axis=1) fn = theano.function([x, w], z) print fn([[1,2,3], [2,2,2]], [2,2,2]) # [ 2. 0.] What do I do when W is a matrix (in Theano)? 回答1: Short answer, use

Internal Server Error on Azure Flask Web App

感情迁移 提交于 2019-12-25 06:51:49
问题 I created a Flask web app hosted on Azure with a Dreamspark subscription. It uses libraries such as Numpy, Scipy and Theano. When I deploy the app using a simple Theano calculations, it works perfectly. However, when I change the code to a more complex Theano calculation, I get an Internal Server Error. Here is a sample code. When I call simpleFunction (something like a Theano function for a sum) it works but when calling complexFunction (something like an image classification calculation)

Can Tensorflow be installed alongside Theano?

删除回忆录丶 提交于 2019-12-25 04:30:16
问题 I'm trying to install tensorflow alongside Theano on a Nvidia Tesla K80. I'm working with Cuda 7.5 and following the instructions given here Theano by itself works well, but as soon as I install tensorflow from source code following the instructions OR using pip install, nvidia-smi as well as Theano stops working. More specifically, nvidia-smi hangs indefinitely whereas Theano just refuses to run in GPU mode. I'm also using the latest version of cudnn v4. Does Tensorflow have known issues

python theano Optimization failure due to: local_dot_to_dot22

僤鯓⒐⒋嵵緔 提交于 2019-12-24 04:33:09
问题 I just pip installed theano and tried to run theano.test(). It produced a very long log of errors and I copied the first part. I also tried a couple other examples - I have seen "local_dot_to_dot22" and "ValueError: invalid token "Files\Enthought\Canopy\App\appdata\canopy1.5.2.2785.win-x86_64\Scripts" in ldflags_str: "-LC:\Program Files\Enthought\Canopy\App\appdata\canopy-1.5.2.2785.win-x86_64\Scripts -lmk2_core -lmk2_intel_thread -lmk2_rt" several times. I'm using python 2.7 (canopy), scipy