theano入门教程1.2

theano入门教程1.2

1. 两个矩阵相加


import theano.tensor as T

from theano import function


x = T.dmatrix('x')

y = T.dmatrix('y')

z = x + y

f = function([x,y], z)

f([2,3], [4,5])


2 .logistic function


import theano.tensor as T

from theano import function

x = T.dmatrix('x')

s = 1/ (1 + T.exp(-x))

logistic = function([x], s)

logistic([1, 2])








posted @ 2014-06-05 08:48  fireae  阅读(280)  评论(0编辑  收藏  举报