提交 952b738b authored 作者: James Bergstra's avatar James Bergstra

changes to documentation

上级 90cbc85f
...@@ -18,12 +18,3 @@ Structure ...@@ -18,12 +18,3 @@ Structure
ccodegen ccodegen
function function
module module
Concepts
========
.. toctree::
:maxdepth: 2
gradient
...@@ -64,6 +64,11 @@ An Op is any object which defines the following methods: ...@@ -64,6 +64,11 @@ An Op is any object which defines the following methods:
evaluated once on inputs A and returned B, then if ever inputs C, equal to evaluated once on inputs A and returned B, then if ever inputs C, equal to
A, are presented again, then outputs equal to B must be returned again. A, are presented again, then outputs equal to B must be returned again.
- You must be careful about aliasing outputs to inputs, and making
modifications to any of the inputs. See `Views and inplace operations`_
before writing a ``perform`` implementation that does either of these
things.
- **__eq__(self, other)** - **__eq__(self, other)**
- Returning True here is a promise to the optimization system that the other - Returning True here is a promise to the optimization system that the other
......
...@@ -152,7 +152,7 @@ so if ``x`` is an ``int`` it we will return an equivalent ``float``. ...@@ -152,7 +152,7 @@ so if ``x`` is an ``int`` it we will return an equivalent ``float``.
.. code-block:: python .. code-block:: python
def values_eq_approx(x, y, tolerance=1e-4): def values_eq_approx(x, y, tolerance=1e-4):
return abs(x - y) / (x + y) < tolerance return abs(x - y) / (abs(x) + abs(y)) < tolerance
The second method we define is ``values_eq_approx``. This method The second method we define is ``values_eq_approx``. This method
allows approximate comparison between two values respecting our Type's allows approximate comparison between two values respecting our Type's
...@@ -204,7 +204,7 @@ and define ``filter`` and ``values_eq_approx`` in the subclass: ...@@ -204,7 +204,7 @@ and define ``filter`` and ``values_eq_approx`` in the subclass:
return float(x) return float(x)
def values_eq_approx(self, x, y, tolerance=1e-4): def values_eq_approx(self, x, y, tolerance=1e-4):
return abs(x - y) / (x + y) < tolerance return abs(x - y) / (abs(x) + abs(y)) < tolerance
double = Double() double = Double()
...@@ -291,7 +291,7 @@ Final version ...@@ -291,7 +291,7 @@ Final version
return float(x) return float(x)
def values_eq_approx(self, x, y, tolerance=1e-4): def values_eq_approx(self, x, y, tolerance=1e-4):
return abs(x - y) / (x + y) < tolerance return abs(x - y) / (abs(x) + abs(y)) < tolerance
def __str__(self): def __str__(self):
return "double" return "double"
......
...@@ -30,12 +30,11 @@ concepts at work here. ...@@ -30,12 +30,11 @@ concepts at work here.
graphstructures graphstructures
ex1/type ex1/type
ex1/op ex1/op
inplace
ex1/ctype ex1/ctype
ex1/cop ex1/cop
inplace
optimization optimization
tips tips
wrapup
......
...@@ -189,11 +189,3 @@ input(s)'s memory). From there, go to the previous section. ...@@ -189,11 +189,3 @@ input(s)'s memory). From there, go to the previous section.
certainly lead to erroneous computations and be a headache to certainly lead to erroneous computations and be a headache to
debug. debug.
**Next:** `Graph optimization`_
.. _Graph optimization: optimization.html
...@@ -276,7 +276,3 @@ Inplace optimizations ...@@ -276,7 +276,3 @@ Inplace optimizations
**Next:** `Tips`_
.. _Tips: tips.html
...@@ -56,8 +56,3 @@ common mistakes. ...@@ -56,8 +56,3 @@ common mistakes.
WRITEME WRITEME
**Next:** `Wrapping up`_
.. _Wrapping up: wrapup.html
===========
Wrapping up
===========
WRITEME
...@@ -136,7 +136,7 @@ with respect to the second. In this way, Theano can be used for ...@@ -136,7 +136,7 @@ with respect to the second. In this way, Theano can be used for
.. note:: .. note::
In general, the result of ``T.grad`` has the same dimensions as the The result of ``T.grad`` has the same dimensions as the
second argument. This is exactly like the first derivative if the second argument. This is exactly like the first derivative if the
first argument is a scalar or a tensor of size 1 but not if it is first argument is a scalar or a tensor of size 1 but not if it is
larger. For more information on the semantics when the first larger. For more information on the semantics when the first
...@@ -212,7 +212,7 @@ of the internal ``state`` will be replaced by the value computed as ...@@ -212,7 +212,7 @@ of the internal ``state`` will be replaced by the value computed as
``new_state``. In this case, the state will be replaced by the result ``new_state``. In this case, the state will be replaced by the result
of incrementing it by ``inc``. of incrementing it by ``inc``.
We recommend (insist?) that internl state arguments occur after any We recommend (insist?) that internal state arguments occur after any
plain arguments and arguments with default values. plain arguments and arguments with default values.
There is no limit to how many states you can have. You can add an There is no limit to how many states you can have. You can add an
......
...@@ -34,4 +34,3 @@ Now we're ready for the tour: ...@@ -34,4 +34,3 @@ Now we're ready for the tour:
module_vs_op module_vs_op
randomstreams randomstreams
tools tools
wrapup
...@@ -269,11 +269,4 @@ WRITEME ...@@ -269,11 +269,4 @@ WRITEME
**Next:** `Tools`_
.. _Tools: tools.html
===========
Wrapping up
===========
WRITEME
...@@ -6,8 +6,6 @@ Developer Start Guide ...@@ -6,8 +6,6 @@ Developer Start Guide
===================== =====================
- Learn about the basics of using mercurial.
- Learn some `non-basic python`_ to understand what's going on in some of the - Learn some `non-basic python`_ to understand what's going on in some of the
tricker files (like tensor.py). tricker files (like tensor.py).
...@@ -44,7 +42,7 @@ As a developer, you should clone this repository like this: ...@@ -44,7 +42,7 @@ As a developer, you should clone this repository like this:
Nightly test Nightly test
============ ============
Their is nightly build done. The output is at: http://lgcm/nightly_build/do_nightly_build.txt WRITEME
Setting up your environment Setting up your environment
=========================== ===========================
......
...@@ -345,6 +345,8 @@ class Value(Result): ...@@ -345,6 +345,8 @@ class Value(Result):
raise ValueError("Value instances cannot have an owner.") raise ValueError("Value instances cannot have an owner.")
owner = property(lambda self: None, __set_owner) owner = property(lambda self: None, __set_owner)
# index is not defined, because the `owner` attribute must necessarily be None
class Constant(Value): class Constant(Value):
""" """
A :term:`Constant` is a `Value` that cannot be changed at runtime. A :term:`Constant` is a `Value` that cannot be changed at runtime.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论