
Theano
阿卡蒂奥
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
theano学习——数据类型
数据类型theano中常用数据类型:byte: bscalar, bvector, bmatrix, btensor3, btensor4 16-bit integers: wscalar, wvector, wmatrix,wtensor3, wtensor4 32-bit integers: iscalar, ivector, imatrix, itensor3, itensor4 6原创 2017-10-16 10:42:05 · 626 阅读 · 0 评论 -
theano学习--theano.function
theano.function标量的运算:import theano.tensor as Tx0 = T.dscalar('x0')x1 = T.dscalar('x1')aver = (x0 + x1)/2f = theano.function([x0, x1], aver)y = f(1,2)print yprint type(f)print type(x0)输出:1.5<cl原创 2017-10-20 19:01:50 · 6373 阅读 · 1 评论 -
theano学习--theano.shared共享变量
theano.shared可以看作是将变量设置为全局变量,其值可以在多个函数中共用.1. 通过get_value()、set_value()可以查看、设置共享变量的数值;import numpy, theanonp_array = numpy.ones(2, dtype='float32')s_default = theano.shared(np_array)print s_defaultpr原创 2017-10-20 19:38:19 · 2426 阅读 · 1 评论 -
theano学习--theano.tensor
dot是theano的tensor变量的点乘操作 T.dot接受两个矩阵(向量)输入, 计算它们的点积并返回一个保存了点乘信息的节点对象, 返回对象调用eval()可获得实际数值结果import theano.tensor as Tx = T.dot([[1,2],[4,5]],[[1,1],[1,0]])print x.eval()print type(x)原创 2017-10-20 21:42:39 · 2101 阅读 · 0 评论 -
theano学习--conv2d
import theano.tensor as Tinputs = T.tensor4(name='input', dtype='float64')conv_out = T.nnet.conv.conv2d(inputs, [[[[1., 0.]],[[0., 1.]]]])f = theano.function([inputs], conv_out)i = np.asarray([[[原创 2017-10-23 12:37:28 · 846 阅读 · 0 评论