Theano tensor 模块:操作符和逐元素操作 操作符 import theano from theano import tensor as T Using gpu device 1: Tesla C2075 (CNMeM is disabled) tensor 类型支持很多基本的操作: # 两个整形三维张量 a, b = T.itensor3("a"), T.itens…
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()…
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…
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…
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 表示是实验…
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…