06 2014 档案
摘要:1.7.1计算导数使用theano.tensor.grad() 函数计算梯度>>> import theano>>> import theano.tensor as T>>> from theano import pp>>> x = T.dscalar('x')>>> y = x ** 2>>> gy = T.grad(y, x)>>> pp(gy)'((fill((x ** TensorCons...
阅读全文
摘要:theano 实例, 逻辑回归(logistic regression)# -*- coding: utf-8 -*-"""Created on Fri Jun 06 08:56:54 2014@author: Administrator"""import theanoimport numpy as npimport theano.tensor as Tdef logistic_regressio...
阅读全文
摘要:# -*- coding: utf-8 -*-"""Created on Thu Jun 05 17:48:31 2014@author: Administrator"""import theanoimport numpy as npimport theano.tensor as Tfrom theano.sandbox.rng_mrg import MRG_RandomStreamsfrom t...
阅读全文
摘要:使用共享变量# -*- coding: utf-8 -*-"""Created on Wed Jun 4 23:28:21 2014@author: wencc"""from theano import sharedfrom theano import functionimport theano.tensor as Tif __name__ == '__main__':state = shared...
阅读全文
摘要:theano 入门教程1.3给一个参数设置默认值# -*- coding: utf-8 -*-"""Created on Wed Jun 4 23:22:17 2014@author: wencc"""import theano.tensor as Tfrom theano import functionfrom theano import Paramfrom theano import ppif...
阅读全文
摘要:theano 入门教程1.1两个标量相加import theano.tensor as Tfrom theano import functionx = T.dscalar('x')y = T.dscalar('y')z = x + yf = function([x,y], z)f(2, 3)1.x = T.dscalar('x')y = T.dscalar('y')先定义两个符号x,y,代表你想用...
阅读全文
摘要:theano入门教程1.21. 两个矩阵相加import theano.tensor as Tfrom theano import functionx = T.dmatrix('x')y = T.dmatrix('y')z = x + yf = function([x,y], z)f([2,3], [4,5])2 .logistic functionimport theano.tensor as ...
阅读全文

浙公网安备 33010602011771号