提交 4e81ebac authored 作者: serdyuk's avatar serdyuk

Fixed typos, merged documentation, added references

上级 018aa096
...@@ -1000,6 +1000,7 @@ Reductions ...@@ -1000,6 +1000,7 @@ Reductions
:Returns: A new array holding the result. :Returns: A new array holding the result.
.. _indexing:
Indexing Indexing
======== ========
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
.. note:: Currently, the function doesn't support tensors created with .. note:: Currently, the function doesn't support tensors created with
`neib_step` different from default value. This means that it may be `neib_step` different from default value. This means that it may be
impossible to compute the gradient in this case. impossible to compute the gradient of an error signal in this case.
Example: Example:
...@@ -102,3 +102,5 @@ ...@@ -102,3 +102,5 @@
im_new_val = inv_window(neibs_val) im_new_val = inv_window(neibs_val)
.. note:: The code will output the initial image array. .. note:: The code will output the initial image array.
- See also: :ref:`indexing`, :ref:`lib_scan`
""" """
Neighbours was moved into theano.tensor.nnet.neighbours. Neighbours was moved into theano.tensor.nnet.neighbours.
This file was created for compatibility compatibility. This file was created for compatibility.
""" """
from theano.tensor.nnet.neighbours import (images2neibs, neibs2images, from theano.tensor.nnet.neighbours import (images2neibs, neibs2images,
Images2Neibs) Images2Neibs)
\ No newline at end of file
...@@ -439,16 +439,21 @@ def images2neibs(ten4, neib_shape, neib_step=None, mode='valid'): ...@@ -439,16 +439,21 @@ def images2neibs(ten4, neib_shape, neib_step=None, mode='valid'):
.. code-block:: python .. code-block:: python
idx = 0 idx = 0
for i in xrange(list 1 dim) for i in xrange(list 1 dim):
for j in xrange(list 2 dim) for j in xrange(list 2 dim):
for k in <image column coordinates> for k in <image column coordinates>:
for l in <image row coordinates> for l in <image row coordinates>:
output[idx,:] output[idx,:]
= flattened version of ten4[i,j,l:l+r,k:k+c] = flattened version of ten4[i,j,l:l+r,k:k+c]
idx += 1 idx += 1
(note: the op isn't necessarily implemented internally with these
for loops, they're just the easiest way to describe the output .. note:: The operation isn't necessarily implemented internally with
pattern) these for loops, they're just the easiest way to describe the output
pattern.
.. note:: Currently the step size should be chosen in the way that the
corresponding dimension :math:`i` (width or height) is equal to
:math:`n * step\_size_i + neib\_shape_i` for some :math:`n`
""" """
return Images2Neibs(mode)(ten4, neib_shape, neib_step) return Images2Neibs(mode)(ten4, neib_shape, neib_step)
...@@ -462,6 +467,10 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'): ...@@ -462,6 +467,10 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'):
:param original_shape: original shape of the 4d tensor given to images2neib :param original_shape: original shape of the 4d tensor given to images2neib
:return: Return a 4d tensor of shape `original_shape`. :return: Return a 4d tensor of shape `original_shape`.
.. note:: Currently, the function doesn't support tensors created with
`neib_step` different from default value. This means that it may be
impossible to compute the gradient of an error signal in this case.
""" """
neibs = T.as_tensor_variable(neibs) neibs = T.as_tensor_variable(neibs)
neib_shape = T.as_tensor_variable(neib_shape) neib_shape = T.as_tensor_variable(neib_shape)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论