Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d3496971
提交
d3496971
authored
8月 05, 2012
作者:
Olivier Delalleau
提交者:
Frederic
9月 12, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed tabs from doc files
上级
876944c7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
23 行增加
和
23 行删除
+23
-23
examples.txt
doc/tutorial/examples.txt
+3
-3
extending_theano.txt
doc/tutorial/extending_theano.txt
+4
-4
gpu_data_convert.txt
doc/tutorial/gpu_data_convert.txt
+1
-1
index.txt
doc/tutorial/index.txt
+1
-1
loop.txt
doc/tutorial/loop.txt
+1
-1
modes.txt
doc/tutorial/modes.txt
+6
-6
using_gpu.txt
doc/tutorial/using_gpu.txt
+7
-7
没有找到文件。
doc/tutorial/examples.txt
浏览文件 @
d3496971
...
@@ -416,9 +416,9 @@ The preceding elements are featured in this more realistic example. It will be
...
@@ -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
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
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
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
gw,gb = T.grad(cost, [w,b])
# Compute the gradient of the cost
# (we shall return to this in a
# (we shall return to this in a
# following section of this tutorial)
# following section of this tutorial)
# Compile
# Compile
train = theano.function(
train = theano.function(
...
...
doc/tutorial/extending_theano.txt
浏览文件 @
d3496971
...
@@ -68,8 +68,8 @@ Op Contract
...
@@ -68,8 +68,8 @@ Op Contract
pass
pass
# C implementation: [see theano web site for other functions]
# C implementation: [see theano web site for other functions]
def c_code(...):
def c_code(...):
# ...
# ...
pass
pass
# others implementation (pycuda, ...):
# others implementation (pycuda, ...):
...
@@ -83,7 +83,7 @@ Op Contract
...
@@ -83,7 +83,7 @@ Op Contract
def grad(self, inputs, g):
def grad(self, inputs, g):
pass
pass
def R_op(self, inputs, eval_points):
def R_op(self, inputs, eval_points):
pass
pass
def infer_shape(node, (i0_shapes, ...))
def infer_shape(node, (i0_shapes, ...))
...
@@ -157,7 +157,7 @@ Op Example
...
@@ -157,7 +157,7 @@ Op Example
def grad(self, inputs, output_grads):
def grad(self, inputs, output_grads):
return [output_grads[0] * 2]
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.
# R_op can receive None as eval_points.
# That mean there is no diferientiable path through that input
# That mean there is no diferientiable path through that input
# If this imply that you cannot compute some outputs,
# If this imply that you cannot compute some outputs,
...
...
doc/tutorial/gpu_data_convert.txt
浏览文件 @
d3496971
...
@@ -69,7 +69,7 @@ CudaNdarrays. Here is an example from the file ``theano/misc/tests/test_pycuda_t
...
@@ -69,7 +69,7 @@ CudaNdarrays. Here is an example from the file ``theano/misc/tests/test_pycuda_t
gb = cuda_ndarray.CudaNdarray(b)
gb = cuda_ndarray.CudaNdarray(b)
dest = cuda_ndarray.CudaNdarray.zeros(a.shape)
dest = cuda_ndarray.CudaNdarray.zeros(a.shape)
multiply_them(dest, ga, gb,
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()
assert (numpy.asarray(dest) == a * b).all()
...
...
doc/tutorial/index.txt
浏览文件 @
d3496971
...
@@ -29,7 +29,7 @@ you out.
...
@@ -29,7 +29,7 @@ you out.
adding
adding
examples
examples
symbolic_graphs
symbolic_graphs
printing_drawing
printing_drawing
gradients
gradients
modes
modes
loading_and_saving
loading_and_saving
...
...
doc/tutorial/loop.txt
浏览文件 @
d3496971
...
@@ -61,7 +61,7 @@ The full documentation can be found in the library: :ref:`Scan <lib_scan>`.
...
@@ -61,7 +61,7 @@ The full documentation can be found in the library: :ref:`Scan <lib_scan>`.
import numpy
import numpy
import theano
import theano
import theano.tensor as T
import theano.tensor as T
theano.config.warn.subtensor_merge_bug = False
theano.config.warn.subtensor_merge_bug = False
coefficients = theano.tensor.vector("coefficients")
coefficients = theano.tensor.vector("coefficients")
x = T.scalar("x")
x = T.scalar("x")
...
...
doc/tutorial/modes.txt
浏览文件 @
d3496971
...
@@ -83,14 +83,14 @@ Consider the logistic regression:
...
@@ -83,14 +83,14 @@ Consider the logistic regression:
name = "predict")
name = "predict")
if any([x.op.__class__.__name__ in ['Gemv', 'CGemv', 'Gemm', 'CGemm'] for x in
if any([x.op.__class__.__name__ in ['Gemv', 'CGemv', 'Gemm', 'CGemm'] for x in
train.maker.fgraph.toposort()]):
train.maker.fgraph.toposort()]):
print 'Used the cpu'
print 'Used the cpu'
elif any([x.op.__class__.__name__ in ['GpuGemm', 'GpuGemv'] for x in
elif any([x.op.__class__.__name__ in ['GpuGemm', 'GpuGemv'] for x in
train.maker.fgraph.toposort()]):
train.maker.fgraph.toposort()]):
print 'Used the gpu'
print 'Used the gpu'
else:
else:
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print train.maker.fgraph.toposort()
print train.maker.fgraph.toposort()
for i in range(training_steps):
for i in range(training_steps):
pred, err = train(D[0], D[1])
pred, err = train(D[0], D[1])
...
...
doc/tutorial/using_gpu.txt
浏览文件 @
d3496971
...
@@ -44,7 +44,7 @@ file and run it.
...
@@ -44,7 +44,7 @@ file and run it.
rng = numpy.random.RandomState(22)
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], T.exp(x))
f = function([], T.exp(x))
print f.maker.fgraph.toposort()
print f.maker.fgraph.toposort()
t0 = time.time()
t0 = time.time()
for i in xrange(iters):
for i in xrange(iters):
r = f()
r = f()
...
@@ -339,14 +339,14 @@ Consider again the logistic regression:
...
@@ -339,14 +339,14 @@ Consider again the logistic regression:
name = "predict")
name = "predict")
if any([x.op.__class__.__name__ in ['Gemv', 'CGemv', 'Gemm', 'CGemm'] for x in
if any([x.op.__class__.__name__ in ['Gemv', 'CGemv', 'Gemm', 'CGemm'] for x in
train.maker.fgraph.toposort()]):
train.maker.fgraph.toposort()]):
print 'Used the cpu'
print 'Used the cpu'
elif any([x.op.__class__.__name__ in ['GpuGemm', 'GpuGemv'] for x in
elif any([x.op.__class__.__name__ in ['GpuGemm', 'GpuGemv'] for x in
train.maker.fgraph.toposort()]):
train.maker.fgraph.toposort()]):
print 'Used the gpu'
print 'Used the gpu'
else:
else:
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print 'ERROR, not able to tell if theano used the cpu or the gpu'
print train.maker.fgraph.toposort()
print train.maker.fgraph.toposort()
for i in range(training_steps):
for i in range(training_steps):
pred, err = train(D[0], D[1])
pred, err = train(D[0], D[1])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论