提交 3bc6876a authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Remove reference to a previous way of using the ``until`` class.

上级 178b3384
...@@ -146,7 +146,7 @@ def scan( fn ...@@ -146,7 +146,7 @@ def scan( fn
outputs ordered in the same order as ``outputs_info``, with the outputs ordered in the same order as ``outputs_info``, with the
difference that there should be only one output variable per difference that there should be only one output variable per
output initial state (even if no tap value is used). Secondly output initial state (even if no tap value is used). Secondly
`fn` should return an update dictionary ( that tells how to `fn` should return an update dictionary (that tells how to
update any shared variable after each iteration step). The update any shared variable after each iteration step). The
dictionary can optionally be given as a list of tuples. There is dictionary can optionally be given as a list of tuples. There is
no constraint on the order of these two list, ``fn`` can return no constraint on the order of these two list, ``fn`` can return
...@@ -157,31 +157,16 @@ def scan( fn ...@@ -157,31 +157,16 @@ def scan( fn
To use ``scan`` as a while loop, the user needs to change the To use ``scan`` as a while loop, the user needs to change the
function ``fn`` such that also a stopping condition is returned. function ``fn`` such that also a stopping condition is returned.
To do so, he/she needs to wrap the condition in an ``until`` class. To do so, he/she needs to wrap the condition in an ``until`` class.
The condition can be returned as a third element, or all the other The condition should be returned as a third element, for example:
outputs and updates can be wrapped in ``until``. A few examples
would be :
.. code-block:: python .. code-block:: python
... ...
return [y1_t, y2_t], {x:x+1}, theano.scan_module.until(x < 50) return [y1_t, y2_t], {x:x+1}, theano.scan_module.until(x < 50)
or Note that a number of steps (considered in here as the maximum
.. code-block:: python
...
return theano.scan_module.until(x<50, [y1_t, y2_t], {x:x+1})
Note that a number of steps ( considered in here as the maximum
number of steps ) is still required even though a condition is number of steps ) is still required even though a condition is
passed ( and it is used to allocate memory if needed ). Also when passed (and it is used to allocate memory if needed). = {}):
passing multiple argument to ``until`` be aware of its signature:
.. code-block:: python
class until(object):
def __init__( condition, outputs = [], updates = {}):
:param sequences: :param sequences:
``sequences`` is the list of Theano variables or dictionaries ``sequences`` is the list of Theano variables or dictionaries
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论