Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c4ef38da
提交
c4ef38da
authored
7月 05, 2016
作者:
Francesco Visin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix broken source links
上级
f27c11e2
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
67 行增加
和
90 行删除
+67
-90
debugmode.txt
doc/library/compile/debugmode.txt
+1
-1
function.txt
doc/library/compile/function.txt
+1
-1
io.txt
doc/library/compile/io.txt
+1
-1
mode.txt
doc/library/compile/mode.txt
+1
-1
nanguardmode.txt
doc/library/compile/nanguardmode.txt
+1
-1
profilemode.txt
doc/library/compile/profilemode.txt
+1
-1
fgraph.txt
doc/library/gof/fgraph.txt
+18
-15
graph.txt
doc/library/gof/graph.txt
+3
-5
type.txt
doc/library/gof/type.txt
+3
-5
utils.txt
doc/library/gof/utils.txt
+3
-5
printing.txt
doc/library/printing.txt
+1
-1
index.txt
doc/library/tensor/nnet/index.txt
+1
-1
nnet.txt
doc/library/tensor/nnet/nnet.txt
+1
-1
raw_random.txt
doc/library/tensor/raw_random.txt
+1
-1
shared_randomstreams.txt
doc/library/tensor/shared_randomstreams.txt
+1
-1
fg.txt
doc/sandbox/fg.txt
+0
-19
index2.txt
doc/sandbox/index2.txt
+0
-1
fg.py
theano/gof/fg.py
+27
-23
graph.py
theano/gof/graph.py
+2
-6
没有找到文件。
doc/library/compile/debugmode.txt
浏览文件 @
c4ef38da
...
...
@@ -5,7 +5,7 @@
:mod:`debugmode`
=================
.. module:: debugmode
.. module::
theano.compile.
debugmode
:platform: Unix, Windows
:synopsis: defines DebugMode
.. moduleauthor:: LISA
...
...
doc/library/compile/function.txt
浏览文件 @
c4ef38da
...
...
@@ -5,7 +5,7 @@
:mod:`function` - defines theano.function
===========================================
.. module:: function
.. module::
theano.compile.
function
:platform: Unix, Windows
:synopsis: defines theano.function and related classes
.. moduleauthor:: LISA
...
...
doc/library/compile/io.txt
浏览文件 @
c4ef38da
...
...
@@ -10,7 +10,7 @@
:mod:`io` - defines theano.function [TODO]
===========================================
.. module:: io
.. module::
theano.compile.
io
:platform: Unix, Windows
:synopsis: defines In and Out
.. moduleauthor:: LISA
...
...
doc/library/compile/mode.txt
浏览文件 @
c4ef38da
...
...
@@ -5,7 +5,7 @@
:mod:`mode` -- controlling compilation
======================================
.. module:: mode
.. module::
theano.compile.
mode
:platform: Unix, Windows
:synopsis: controlling compilation
.. moduleauthor:: LISA
...
...
doc/library/compile/nanguardmode.txt
浏览文件 @
c4ef38da
...
...
@@ -5,7 +5,7 @@
:mod:`nanguardmode`
===================
.. module:: nanguardmode
.. module::
theano.compile.
nanguardmode
:platform: Unix, Windows
:synopsis: defines NanGuardMode
.. moduleauthor:: LISA
...
...
doc/library/compile/profilemode.txt
浏览文件 @
c4ef38da
...
...
@@ -6,7 +6,7 @@
================================================
.. module:: profilemode
.. module::
theano.compile.
profilemode
:platform: Unix, Windows
:synopsis: profiling Theano functions with ProfileMode
.. moduleauthor:: LISA
...
...
doc/library/gof/fgraph.txt
浏览文件 @
c4ef38da
...
...
@@ -2,26 +2,40 @@
.. _libdoc_gof_fgraph:
================================================
:mod:`fg
raph
` -- Graph Container [doc TODO]
:mod:`fg` -- Graph Container [doc TODO]
================================================
.. module::
fgraph
.. module::
theano.gof.fg
:platform: Unix, Windows
:synopsis: Theano Internals
.. moduleauthor:: LISA
Guide
=====
.. _fgraph:
FunctionGraph
-------------
.. autoclass:: theano.gof.FunctionGraph
:members:
***TODO***
.. note:: FunctionGraph(inputs, outputs) clones the inputs by
default. To avoid this behavior, add the parameter
clone=False. This is needed as we do not want cached constants
in fgraph.
.. _libdoc_gof_fgraphfeature:
.. _fgraphfeature:
FunctionGraph Features
----------------------
.. autoclass:: theano.gof.toolbox.Feature
:members:
.. _libdoc_gof_fgraphfeaturelist:
FunctionGraph Feature List
...
...
@@ -29,14 +43,3 @@ FunctionGraph Feature List
* ReplaceValidate
* DestroyHandler
Reference
=========
.. class:: FunctionGraph
***TODO***
.. note:: FunctionGraph(inputs, outputs) clones the inputs by
default. To avoid this behavior, add the parameter
clone=False. This is needed as we do not want cached constants
in fgraph.
doc/library/gof/graph.txt
浏览文件 @
c4ef38da
...
...
@@ -4,14 +4,12 @@
:mod:`graph` -- Interface for the Theano graph
==============================================
.. module:: graph
:platform: Unix, Windows
:synopsis: Interface for types of symbolic variables
.. moduleauthor:: LISA
---------
Reference
---------
.. automodule:: theano.gof.graph
:platform: Unix, Windows
:synopsis: Interface for types of symbolic variables
:members:
.. moduleauthor:: LISA
doc/library/gof/type.txt
浏览文件 @
c4ef38da
...
...
@@ -4,14 +4,12 @@
:mod:`type` -- Interface for types of variables
================================================
.. module:: type
:platform: Unix, Windows
:synopsis: Interface for types of symbolic variables
.. moduleauthor:: LISA
---------
Reference
---------
.. automodule:: theano.gof.type
:platform: Unix, Windows
:synopsis: Interface for types of symbolic variables
:members:
.. moduleauthor:: LISA
doc/library/gof/utils.txt
浏览文件 @
c4ef38da
...
...
@@ -8,14 +8,12 @@
from theano.gof.utils import *
.. module:: utils
:platform: Unix, Windows
:synopsis: Utilities functions operating on the graph
.. moduleauthor:: LISA
---------
Reference
---------
.. automodule:: theano.gof.utils
:platform: Unix, Windows
:synopsis: Utilities functions operating on the graph
:members:
.. moduleauthor:: LISA
doc/library/printing.txt
浏览文件 @
c4ef38da
...
...
@@ -4,7 +4,7 @@
:mod:`printing` -- Graph Printing and Symbolic Print Statement
===============================================================
.. module:: printing
.. module::
theano.
printing
:platform: Unix, Windows
:synopsis: Provides the Print Op and graph-printing routines.
.. moduleauthor:: LISA
...
...
doc/library/tensor/nnet/index.txt
浏览文件 @
c4ef38da
...
...
@@ -4,7 +4,7 @@
:mod:`nnet` -- Ops related to neural networks
==================================================
.. module:: nnet
.. module::
theano.tensor.
nnet
:platform: Unix, Windows
:synopsis: various ops relating to neural networks
.. moduleauthor:: LISA
...
...
doc/library/tensor/nnet/nnet.txt
浏览文件 @
c4ef38da
...
...
@@ -4,7 +4,7 @@
:mod:`nnet` -- Ops for neural networks
======================================================
.. module:: t
ensor
.nnet
.. module:: t
heano.tensor.nnet
.nnet
:platform: Unix, Windows
:synopsis: Ops for neural networks
.. moduleauthor:: LISA
...
...
doc/library/tensor/raw_random.txt
浏览文件 @
c4ef38da
...
...
@@ -5,7 +5,7 @@
:mod:`raw_random` -- Low-level random numbers
=============================================
.. module:: raw_random
.. module::
theano.tensor.
raw_random
:synopsis: symbolic random variables
.. moduleauthor:: LISA
...
...
doc/library/tensor/shared_randomstreams.txt
浏览文件 @
c4ef38da
...
...
@@ -4,7 +4,7 @@
:mod:`shared_randomstreams` -- Friendly random numbers
======================================================
.. module:: shared_randomstreams
.. module::
theano.tensor.
shared_randomstreams
:platform: Unix, Windows
:synopsis: symbolic random variables
.. moduleauthor:: LISA
...
...
doc/sandbox/fg.txt
deleted
100644 → 0
浏览文件 @
f27c11e2
.. _fgraph:
=============
FunctionGraph
=============
TODO: clean up/update the doc/check if complete
WRITEME
.. autoclass:: theano.gof.fg.FunctionGraph
.. _fgraphfeature:
Feature
=======
.. autoclass:: theano.gof.toolbox.Feature
:members:
doc/sandbox/index2.txt
浏览文件 @
c4ef38da
...
...
@@ -8,7 +8,6 @@ Advanced Topics (under construction)
.. toctree::
:maxdepth: 2
fg
compilation
ccodegen
function
...
...
theano/gof/fg.py
浏览文件 @
c4ef38da
...
...
@@ -593,10 +593,10 @@ class FunctionGraph(utils.object2):
# callback utils #
def
execute_callbacks
(
self
,
name
,
*
args
,
**
kwargs
):
"""
Calls
getattr(feature, name)(*args)
for each feature which has
a method called after name.
"""
Execute callbacks
Calls `getattr(feature, name)(*args)` for each feature which has
a method called after name.
"""
t0
=
time
.
time
()
...
...
@@ -614,11 +614,11 @@ class FunctionGraph(utils.object2):
self
.
execute_callbacks_time
+=
time
.
time
()
-
t0
def
collect_callbacks
(
self
,
name
,
*
args
):
"""
Returns a dictionary d such that:
d[feature] == getattr(feature, name)(*args)
For each feature which has a method called after name.
"""Collects callbacks
Returns a dictionary d such that
`d[feature] == getattr(feature, name)(*args)`
For each feature which has a method called after name.
"""
d
=
{}
for
feature
in
self
.
_features
:
...
...
@@ -631,17 +631,18 @@ class FunctionGraph(utils.object2):
# misc #
def
toposort
(
self
):
"""
Return an ordering of the graph's Apply nodes such that:
- All the nodes of the inputs of a node are before that node.
- Satisfies the orderings provided by each feature that has
"""Toposort
Return an ordering of the graph's Apply nodes such that
* All the nodes of the inputs of a node are before that node.
* Satisfies the orderings provided by each feature that has
an 'orderings' method.
If a feature has an 'orderings' method, it will be called with
this FunctionGraph as sole argument. It should return a dictionary of
{node: predecessors} where predecessors is a list of nodes
that should be computed before the key node.
`{node: predecessors}` where predecessors is a list of nodes that
should be computed before the key node.
"""
if
len
(
self
.
apply_nodes
)
<
2
:
# optimization
...
...
@@ -760,17 +761,20 @@ class FunctionGraph(utils.object2):
return
self
.
clone_get_equiv
(
check_integrity
)[
0
]
def
clone_get_equiv
(
self
,
check_integrity
=
True
,
attach_feature
=
True
):
"""Clone the graph and get a
memo( a dict )that map old node to new node
----------------------------
"""Clone the graph and get a
dict that maps old nodes to new ones
Parameters:
check_integrity - { bool } Whether to check integrity.
check_integrity: bool
Whether to check integrity. Default is True.
attach_feature: bool
Whether to attach feature of origin graph to cloned graph.
Default is True.
attach_feature - { bool } Whether to attach feature of origin graph to
cloned graph. Default is True.
----------------------------
Returns:
e - { FunctionGraph } Cloned fgraph. Every node in cloned graph is cloned.
equiv - { dict } A dict that map old node to new node.
e: FunctionGraph
Cloned fgraph. Every node in cloned graph is cloned.
equiv: dict
A dict that map old node to new node.
"""
equiv
=
graph
.
clone_get_equiv
(
self
.
inputs
,
self
.
outputs
)
...
...
theano/gof/graph.py
浏览文件 @
c4ef38da
"""
Node classes (`Apply`, `Variable`) and expression graph algorithms.
To read about what theano graphs are from a user perspective, have a look at
`graph.html <../doc/graph.html>`__.
"""
from
__future__
import
absolute_import
,
print_function
,
division
...
...
@@ -1246,9 +1242,9 @@ def as_string(i, o,
Input `Variable` s.
o : list
Output `Variable` s.
leaf_formatter : function
leaf_formatter :
theano.
function
Takes a `Variable` and returns a string to describe it.
node_formatter :
function
node_formatter :
callable
Takes an `Op` and the list of strings corresponding to its arguments
and returns a string to describe it.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论