标签: Theano 基础

19 篇文章

121、Theano tensor 模块:conv 子模块
Theano tensor 模块:conv 子模块 conv 是 tensor 中处理卷积神经网络的子模块。 卷积 这里只介绍二维卷积: T.nnet.conv2d(input, filters, input_shape=None, filter_shape=None, border_mode='valid', subsample=(1, 1), filter_flip=Tru…
120、Theano tensor 模块:nnet 子模块
Theano tensor 模块:nnet 子模块 nnet 是 tensor 模块中与神经网络 Neural Networks 相关的子模块。 import theano from theano import tensor as T Using gpu device 1: Tesla C2075 (CNMeM is disabled) Sigmoid 函数 共有三种 sigmoid: T.nne…
118、Theano tensor 模块:索引
Theano tensor 模块:索引 import theano import theano.tensor as T import numpy as np Using gpu device 1: Tesla C2075 (CNMeM is disabled) 简单索引 tensor 模块完全支持 numpy 中的简单索引: t = T.arange(9) print t[1::2].eval()…
117、Theano tensor 模块:基础
Theano tensor 模块:基础 张量是向量在数学上的一种推广,具体内容可以参考维基百科: https://en.wikipedia.org/wiki/Tensor 在 Theano 中有一个专门处理张量变量的模块:theano.tensor (以下简称 T)。 import theano import theano.tensor as T Using gpu device 1: Tesla…
116、Theano 实例:卷积神经网络
Theano 实例:卷积神经网络 import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import numpy as np from load import mnist srng = RandomStreams() Using gp…
115、Theano 实例:更复杂的网络
Theano 实例:更复杂的网络 import theano import theano.tensor as T import numpy as np from load import mnist from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams srng = RandomStreams() def floa…
114、Theano 随机数流变量
Theano 随机数流变量 import theano import theano.tensor as T import numpy as np Using gpu device 1: Tesla C2075 (CNMeM is disabled) Theano 的随机数变量由 theano.sandbox.rng_mrg 中的 MRG_RandomStreams 实现(sandbox 表示是实验…
113、Theano 实例:人工神经网络
Theano 实例:人工神经网络 神经网络的模型可以参考 UFLDL 的教程,这里不做过多描述。 http://ufldl.stanford.edu/wiki/index.php/%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C import theano import theano.tensor as T import numpy as np from load impo…
112、Theano 实例:Softmax 回归
Theano 实例:Softmax 回归 MNIST 数据集的下载和导入 MNIST 数据集 是一个手写数字组成的数据集,现在被当作一个机器学习算法评测的基准数据集。 这是一个下载并解压数据的脚本: %%file download_mnist.py import os import os.path import urllib import gzip import shutil if not os.…