In [3]:
import theano.tensor as T
from theano import pp
from theano import function
from theano.printing import pydotprint

In [2]:
x = T.dvector('x')
y = T.dvector('y')
m = T.dscalar('m')
theta = T.dvector('theta')
h = theta[0] * x + 2
J = T.pow(h - y,2)


cost = function([x, y, theta], J)
pydotprint(xor, 'img/xor.png')


((((Constant{0}[theta] * x) + TensorConstant{2}) - y) ** TensorConstant{2})

In [33]:
x1 = [0, 1, 2, 3]
y1 = [4, 7, 7, 8]
theta1 = [1, 1]
cost(x1,y1, theta1)


Out[33]:
array([  4.,  16.,   9.,   9.])

In [ ]: