Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7344f170
提交
7344f170
authored
3月 31, 2009
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
5093d1d5
4b07f9a3
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
28 行增加
和
27 行删除
+28
-27
graphstructures.txt
doc/advanced_tutorial/graphstructures.txt
+6
-6
inplace.txt
doc/advanced_tutorial/inplace.txt
+1
-1
type.txt
doc/advanced_tutorial/type.txt
+2
-2
module.txt
doc/basic_tutorial/module.txt
+7
-6
tools.txt
doc/basic_tutorial/tools.txt
+8
-8
mechanism2.py
doc/examples/module/mechanism2.py
+1
-1
glossary.txt
doc/glossary.txt
+3
-3
没有找到文件。
doc/advanced_tutorial/graphstructures.txt
浏览文件 @
7344f170
...
@@ -68,12 +68,12 @@ This is what you would normally type:
...
@@ -68,12 +68,12 @@ This is what you would normally type:
.. code-block:: python
.. code-block:: python
from theano.tensor import *
from theano.tensor import *
# create 3 Variables with owner = None
# create 3 Variables with owner = None
x = matrix('x')
x = matrix('x')
y = matrix('y')
y = matrix('y')
z = matrix('z')
z = matrix('z')
# create 2 Variables (one for 'e', one intermediate for y*z)
# create 2 Variables (one for 'e', one intermediate for y*z)
# create 2 Apply instances (one for '+', one for '*')
# create 2 Apply instances (one for '+', one for '*')
e = x + y * z
e = x + y * z
...
@@ -86,7 +86,7 @@ This is what you would type to build the graph explicitly:
...
@@ -86,7 +86,7 @@ This is what you would type to build the graph explicitly:
.. code-block:: python
.. code-block:: python
from theano.tensor import *
from theano.tensor import *
# Instantiate a type that represents a matrix of doubles
# Instantiate a type that represents a matrix of doubles
float64_matrix = TensorType(dtype = 'float64', # double
float64_matrix = TensorType(dtype = 'float64', # double
broadcastable = (False, False)) # matrix
broadcastable = (False, False)) # matrix
...
@@ -129,7 +129,7 @@ Note how the call to ``Apply`` modifies the ``owner`` and ``index``
...
@@ -129,7 +129,7 @@ Note how the call to ``Apply`` modifies the ``owner`` and ``index``
fields of the :ref:`Variables <variable>` passed as outputs to point to
fields of the :ref:`Variables <variable>` passed as outputs to point to
itself and the rank they occupy in the output list. This whole
itself and the rank they occupy in the output list. This whole
machinery builds a DAG (Directed Acyclic Graph) representing the
machinery builds a DAG (Directed Acyclic Graph) representing the
computation, a graph that
t
heano can compile and optimize.
computation, a graph that
T
heano can compile and optimize.
Automatic wrapping
Automatic wrapping
...
@@ -189,8 +189,8 @@ inputs. Therefore, an Apply node may be obtained from an Op
...
@@ -189,8 +189,8 @@ inputs. Therefore, an Apply node may be obtained from an Op
and a list of inputs by calling ``Op.make_node(*inputs)``.
and a list of inputs by calling ``Op.make_node(*inputs)``.
Comparing with the Python language, an :ref:`apply` node is
Comparing with the Python language, an :ref:`apply` node is
t
heano's version of a function call whereas an :ref:`op` is
T
heano's version of a function call whereas an :ref:`op` is
t
heano's version of a function definition.
T
heano's version of a function definition.
An Apply instance has three important fields:
An Apply instance has three important fields:
...
...
doc/advanced_tutorial/inplace.txt
浏览文件 @
7344f170
...
@@ -94,7 +94,7 @@ operation on ``x``.
...
@@ -94,7 +94,7 @@ operation on ``x``.
.. note::
.. note::
Inplace operations in
t
heano still work in a functional setting:
Inplace operations in
T
heano still work in a functional setting:
they need to return the modified input. Symbolically, Theano
they need to return the modified input. Symbolically, Theano
requires one Variable standing for the input *before* being modified
requires one Variable standing for the input *before* being modified
and *another* Variable representing the input *after* being
and *another* Variable representing the input *after* being
...
...
doc/advanced_tutorial/type.txt
浏览文件 @
7344f170
...
@@ -160,7 +160,7 @@ the Type is to instantiate a plain Type and set the needed fields:
...
@@ -160,7 +160,7 @@ the Type is to instantiate a plain Type and set the needed fields:
.. code-block:: python
.. code-block:: python
from
t
heano import gof
from
T
heano import gof
double = gof.Type()
double = gof.Type()
double.filter = filter
double.filter = filter
...
@@ -216,7 +216,7 @@ There are several ways to make sure that equality testing works properly:
...
@@ -216,7 +216,7 @@ There are several ways to make sure that equality testing works properly:
#. Hide the Double class and only advertise a single instance of it.
#. Hide the Double class and only advertise a single instance of it.
Here we will prefer the final option, because it's the simplest.
Here we will prefer the final option, because it's the simplest.
Often Ops in the
t
heano code define the ``__eq__`` function though.
Often Ops in the
T
heano code define the ``__eq__`` function though.
Untangling some concepts
Untangling some concepts
...
...
doc/basic_tutorial/module.txt
浏览文件 @
7344f170
...
@@ -179,7 +179,7 @@ Extending your Module with Python methods
...
@@ -179,7 +179,7 @@ Extending your Module with Python methods
Let's say we want to add a method to our accumulator to print out the
Let's say we want to add a method to our accumulator to print out the
state and we want to call it ``print_state``. There are two mechanisms to do
state and we want to call it ``print_state``. There are two mechanisms to do
this: let's call them
instance methods
and InstanceType.
this: let's call them
_instance_method
and InstanceType.
Mechanism 1: _instance_method
Mechanism 1: _instance_method
...
@@ -198,7 +198,7 @@ Note that when we define ``_instance_print_state`` there are two "self"
...
@@ -198,7 +198,7 @@ Note that when we define ``_instance_print_state`` there are two "self"
arguments: ``self`` which is *symbolic* and ``obj`` which is the compiled
arguments: ``self`` which is *symbolic* and ``obj`` which is the compiled
object (the one that contains values).
object (the one that contains values).
Hint:``self.state`` is the symbolic state variable and
Hint:
``self.state`` is the symbolic state variable and
prints out as "state", whereas ``obj.state`` is the state's actual
prints out as "state", whereas ``obj.state`` is the state's actual
value in the accumulator and prints out as "0.0".
value in the accumulator and prints out as "0.0".
...
@@ -207,7 +207,7 @@ Mechanism 2: InstanceType
...
@@ -207,7 +207,7 @@ Mechanism 2: InstanceType
-------------------------
-------------------------
If a number of instance methods are going to be defined, and especially if you
If a number of instance methods are going to be defined, and especially if you
will want to inherit from the kind of class that gets instantiated by
make
,
will want to inherit from the kind of class that gets instantiated by
``make``
,
you might prefer to consider using the InstanceType mechanism.
you might prefer to consider using the InstanceType mechanism.
...
@@ -223,15 +223,16 @@ where we give the states' initial values with keyword arguments
...
@@ -223,15 +223,16 @@ where we give the states' initial values with keyword arguments
can override the default with your own method, which has to be called
can override the default with your own method, which has to be called
``_instance_initialize``.
``_instance_initialize``.
Here is an example where we take width and height arguments to
.. TODO
initialize a state with a matrix of zeros:
Here is an example where we take width and height arguments to
initialize a state with a matrix of zeros:
Nesting Modules
Nesting Modules
===============
===============
Probably the most powerful feature of
theano's m
odules is that one can be
Probably the most powerful feature of
Theano's M
odules is that one can be
included as an attribute to another so that the storage of each is available
included as an attribute to another so that the storage of each is available
to both.
to both.
...
...
doc/basic_tutorial/tools.txt
浏览文件 @
7344f170
...
@@ -8,14 +8,14 @@ Basic Tutorial Mini-Reference
...
@@ -8,14 +8,14 @@ Basic Tutorial Mini-Reference
Mode
Mode
====
====
=============
=========================================================== ===============================================================================
=============
==== ====
=========================================================== ===============================================================================
short name
Full constructor
What does it do?
short name
Full constructor
What does it do?
=============
=========================================================== ===============================================================================
=============
==== ====
=========================================================== ===============================================================================
(default)
compile.mode.Mode(linker='py', optimizer=None)
Python implementations with zero graph modifications.
(default)
``compile.mode.Mode(linker='py', optimizer=None)``
Python implementations with zero graph modifications.
FAST_COMPILE
compile.mode.Mode(linker='c|py', optimizer='fast_compile')
C implementations where available, quick and cheap graph transformations
FAST_COMPILE
``compile.mode.Mode(linker='c|py', optimizer='fast_compile')``
C implementations where available, quick and cheap graph transformations
FAST_RUN
compile.mode.Mode(linker='c|py', optimizer='fast_run')
C implementations where available, all available graph transformations.
FAST_RUN
``compile.mode.Mode(linker='c|py', optimizer='fast_run')``
C implementations where available, all available graph transformations.
DEBUG_MODE
compile.debugmode.DebugMode()
Both implementations where available, all available graph transformations.
DEBUG_MODE
``compile.debugmode.DebugMode()``
Both implementations where available, all available graph transformations.
=============
=========================================================== ===============================================================================
=============
==== ====
=========================================================== ===============================================================================
.. _tensortypes:
.. _tensortypes:
...
...
doc/examples/module/mechanism2.py
浏览文件 @
7344f170
...
@@ -9,7 +9,7 @@ class AccumulatorInstance(ModuleInstance):
...
@@ -9,7 +9,7 @@ class AccumulatorInstance(ModuleInstance):
class
Accumulator
(
Module
):
class
Accumulator
(
Module
):
# This line tells
t
heano to instantiate an AccumulatorInstance
# This line tells
T
heano to instantiate an AccumulatorInstance
# when make() is called.
# when make() is called.
InstanceType
=
AccumulatorInstance
InstanceType
=
AccumulatorInstance
...
...
doc/glossary.txt
浏览文件 @
7344f170
...
@@ -91,10 +91,10 @@ Glossary of terminology
...
@@ -91,10 +91,10 @@ Glossary of terminology
WRITEME
WRITEME
type
type
See :ref:`tensortypes`
See :ref:`tensortypes`
or :ref:`type`.
Variable
Variable
A :ref:`
v
ariable` is the main data structure you work with when
A :ref:`
V
ariable` is the main data structure you work with when
using Theano. The symbolic inputs that you operate on are
using Theano. The symbolic inputs that you operate on are
Variables and what you get from applying various operations to
Variables and what you get from applying various operations to
these inputs are also Variables. For example, when I type
these inputs are also Variables. For example, when I type
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论