Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8bad060c
提交
8bad060c
authored
2月 23, 2011
作者:
David Warde-Farley
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make tutorials/docs PEP 3113 compliant (remove tuple parameter unpacking).
上级
8ff2fb82
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
19 行增加
和
7 行删除
+19
-7
cop.txt
doc/extending/cop.txt
+6
-2
op.txt
doc/extending/op.txt
+3
-1
sandbox.txt
doc/sandbox/sandbox.txt
+6
-2
loading_and_saving.txt
doc/tutorial/loading_and_saving.txt
+4
-2
没有找到文件。
doc/extending/cop.txt
浏览文件 @
8bad060c
...
@@ -160,13 +160,17 @@ version that it produces in the code I gave above.
...
@@ -160,13 +160,17 @@ version that it produces in the code I gave above.
raise TypeError('%s only works on doubles' % self.name)
raise TypeError('%s only works on doubles' % self.name)
return gof.Apply(self, [x, y], [double()])
return gof.Apply(self, [x, y], [double()])
def perform(self, node, (x, y), (z, )):
def perform(self, node, inp, out):
x, y = inp
z, = out
z[0] = self.fn(x, y)
z[0] = self.fn(x, y)
def __str__(self):
def __str__(self):
return self.name
return self.name
def c_code(self, node, name, (x, y), (z, ), sub):
def c_code(self, node, name, inp, out, sub):
x, y = inp
z, = out
return self.ccode % locals()
return self.ccode % locals()
...
...
doc/extending/op.txt
浏览文件 @
8bad060c
...
@@ -363,7 +363,9 @@ arithmetic operators:
...
@@ -363,7 +363,9 @@ arithmetic operators:
raise TypeError('%s only works on doubles' % self.name)
raise TypeError('%s only works on doubles' % self.name)
return gof.Apply(self, [x, y], [double()])
return gof.Apply(self, [x, y], [double()])
def perform(self, node, (x, y), (z, )):
def perform(self, node, inp, out):
x, y = inp
z, = out
z[0] = self.fn(x, y)
z[0] = self.fn(x, y)
def __str__(self):
def __str__(self):
...
...
doc/sandbox/sandbox.txt
浏览文件 @
8bad060c
...
@@ -89,9 +89,13 @@ write an Op:**
...
@@ -89,9 +89,13 @@ write an Op:**
return x * numpy.log(x)
return x * numpy.log(x)
def impl(self, x):
def impl(self, x):
return XlogX.st_impl(x)
return XlogX.st_impl(x)
def grad(self, (x,), (gz,)):
def grad(self, inp, grads):
x, = inp
gz, = grads
return [gz * (1 + scalar.log(x))]
return [gz * (1 + scalar.log(x))]
def c_code(self, node, name, (x,), (z,), sub):
def c_code(self, node, name, inp, out, sub):
x, = inp
z, = out
if node.inputs[0].type in [scalar.float32, scalar.float64]:
if node.inputs[0].type in [scalar.float32, scalar.float64]:
return """%(z)s =
return """%(z)s =
%(x)s == 0.0
%(x)s == 0.0
...
...
doc/tutorial/loading_and_saving.txt
浏览文件 @
8bad060c
...
@@ -133,7 +133,8 @@ matrix ``W`` and a bias ``b``, you can define:
...
@@ -133,7 +133,8 @@ matrix ``W`` and a bias ``b``, you can define:
def __getstate__(self):
def __getstate__(self):
return (W, b)
return (W, b)
def __setstate__(self, (W,b)):
def __setstate__(self, state):
W, b = state
self.W = W
self.W = W
self.b = b
self.b = b
...
@@ -146,7 +147,8 @@ functions to reflect the change in name:
...
@@ -146,7 +147,8 @@ functions to reflect the change in name:
def __getstate__(self):
def __getstate__(self):
return (weights, bias)
return (weights, bias)
def __setstate__(self, (W,b)):
def __setstate__(self, state):
W, b = state
self.weights = W
self.weights = W
self.bias = b
self.bias = b
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论