提交 266b5baa authored 作者: Frederic's avatar Frederic

better doc.

上级 d9052e5c
...@@ -428,17 +428,19 @@ def images2neibs(ten4, neib_shape, neib_step=None, mode='valid'): ...@@ -428,17 +428,19 @@ def images2neibs(ten4, neib_shape, neib_step=None, mode='valid'):
Reshapes the input as a 2D tensor where each row is an Reshapes the input as a 2D tensor where each row is an
pooling example. Pseudo-code of the output: pooling example. Pseudo-code of the output:
idx = 0 .. code-block:: python
for i in xrange(list 1 dim)
for j in xrange(list 2 dim) idx = 0
for k in <image column coordinates> for i in xrange(list 1 dim)
for l in <image row coordinates> for j in xrange(list 2 dim)
output[idx,:] for k in <image column coordinates>
= flattened version of ten4[i,j,l:l+r,k:k+c] for l in <image row coordinates>
idx += 1 output[idx,:]
(note: the op isn't necessarily implemented internally with these = flattened version of ten4[i,j,l:l+r,k:k+c]
for loops, they're just the easiest way to describe the output idx += 1
pattern) (note: the op isn't necessarily implemented internally with these
for loops, they're just the easiest way to describe the output
pattern)
""" """
return Images2Neibs(mode)(ten4, neib_shape, neib_step) return Images2Neibs(mode)(ten4, neib_shape, neib_step)
...@@ -447,11 +449,11 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'): ...@@ -447,11 +449,11 @@ def neibs2images(neibs, neib_shape, original_shape, mode='valid'):
""" """
Inverse of images2neib. Inverse of images2neib.
neibs : matrix like the one obtained by images2neib :param neibs: matrix like the one obtained by images2neib
neib_shape : neib_shape that was used in images2neib :param neib_shape: neib_shape that was used in images2neib
original_shape : original shape of the 4d tensor given to images2neib :param original_shape: original shape of the 4d tensor given to images2neib
Return a 4d tensor of shape `original_shape`. :return: Return a 4d tensor of shape `original_shape`.
""" """
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论