提交 d3496971 authored 作者: Olivier Delalleau's avatar Olivier Delalleau 提交者: Frederic

Removed tabs from doc files

上级 876944c7
......@@ -416,9 +416,9 @@ The preceding elements are featured in this more realistic example. It will be
prediction = p_1 > 0.5 # The prediction thresholded
xent = -y*T.log(p_1) - (1-y)*T.log(1-p_1) # Cross-entropy loss function
cost = xent.mean() + 0.01*(w**2).sum() # The cost to minimize
gw,gb = T.grad(cost, [w,b]) # Compute the gradient of the cost
# (we shall return to this in a
# following section of this tutorial)
gw,gb = T.grad(cost, [w,b]) # Compute the gradient of the cost
# (we shall return to this in a
# following section of this tutorial)
# Compile
train = theano.function(
......
......@@ -68,8 +68,8 @@ Op Contract
pass
# C implementation: [see theano web site for other functions]
def c_code(...):
# ...
def c_code(...):
# ...
pass
# others implementation (pycuda, ...):
......@@ -83,7 +83,7 @@ Op Contract
def grad(self, inputs, g):
pass
def R_op(self, inputs, eval_points):
def R_op(self, inputs, eval_points):
pass
def infer_shape(node, (i0_shapes, ...))
......@@ -157,7 +157,7 @@ Op Example
def grad(self, inputs, output_grads):
return [output_grads[0] * 2]
def R_op(self, inputs, eval_points):
def R_op(self, inputs, eval_points):
# R_op can receive None as eval_points.
# That mean there is no diferientiable path through that input
# If this imply that you cannot compute some outputs,
......
......@@ -69,7 +69,7 @@ CudaNdarrays. Here is an example from the file ``theano/misc/tests/test_pycuda_t
gb = cuda_ndarray.CudaNdarray(b)
dest = cuda_ndarray.CudaNdarray.zeros(a.shape)
multiply_them(dest, ga, gb,
block=(400, 1, 1), grid=(1, 1))
block=(400, 1, 1), grid=(1, 1))
assert (numpy.asarray(dest) == a * b).all()
......
......@@ -29,7 +29,7 @@ you out.
adding
examples
symbolic_graphs
printing_drawing
printing_drawing
gradients
modes
loading_and_saving
......
......@@ -61,7 +61,7 @@ The full documentation can be found in the library: :ref:`Scan <lib_scan>`.
import numpy
import theano
import theano.tensor as T
theano.config.warn.subtensor_merge_bug = False
theano.config.warn.subtensor_merge_bug = False
coefficients = theano.tensor.vector("coefficients")
x = T.scalar("x")
......
......@@ -83,14 +83,14 @@ Consider the logistic regression:
name = "predict")
if any([x.op.__class__.__name__ in ['Gemv', 'CGemv', 'Gemm', 'CGemm'] for x in
train.maker.fgraph.toposort()]):
print 'Used the cpu'
train.maker.fgraph.toposort()]):
print 'Used the cpu'
elif any([x.op.__class__.__name__ in ['GpuGemm', 'GpuGemv'] for x in
train.maker.fgraph.toposort()]):
print 'Used the gpu'
train.maker.fgraph.toposort()]):
print 'Used the gpu'
else:
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print train.maker.fgraph.toposort()
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print train.maker.fgraph.toposort()
for i in range(training_steps):
pred, err = train(D[0], D[1])
......
......@@ -44,7 +44,7 @@ file and run it.
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], T.exp(x))
print f.maker.fgraph.toposort()
print f.maker.fgraph.toposort()
t0 = time.time()
for i in xrange(iters):
r = f()
......@@ -339,14 +339,14 @@ Consider again the logistic regression:
name = "predict")
if any([x.op.__class__.__name__ in ['Gemv', 'CGemv', 'Gemm', 'CGemm'] for x in
train.maker.fgraph.toposort()]):
print 'Used the cpu'
train.maker.fgraph.toposort()]):
print 'Used the cpu'
elif any([x.op.__class__.__name__ in ['GpuGemm', 'GpuGemv'] for x in
train.maker.fgraph.toposort()]):
print 'Used the gpu'
train.maker.fgraph.toposort()]):
print 'Used the gpu'
else:
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print train.maker.fgraph.toposort()
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print train.maker.fgraph.toposort()
for i in range(training_steps):
pred, err = train(D[0], D[1])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论