chainer.functions.space2depth(X, r)[source]

サブピクセル計算のためのspace2depth transformationを演算する。

 

Parameters:
Returns:

サブピクセル配列の標本からダウンスケールした配列をもつVariables。shape は (batch, channel * r * r, dim1, dim2)

Return type:

Variable

 

Note
これは、超解像変形の反転を計算するために使用することも可能。 詳細は https://arxiv.org/abs/1609.05158 をお読みください。
See also

depth2space()

 

Example

 


>>> X = np.arange(24).reshape(1, 1, 4, 6).astype('f')

>>> X.shape (1, 1, 4, 6)
>>> X
array([[[[ 0., 1., 2., 3., 4., 5.],
[ 6., 7., 8., 9., 10., 11.],
[ 12., 13., 14., 15., 16., 17.],
[ 18., 19., 20., 21., 22., 23.]]]], dtype=float32)
>>> y = F.space2depth(X, 2)
>>> y.shape (1, 4, 2, 3)
>>> y.data
array([[[[ 0., 2., 4.], [ 12., 14., 16.]],
[[ 1., 3., 5.], [ 13., 15., 17.]],
[[ 6., 8., 10.], [ 18., 20., 22.]],
[[ 7., 9., 11.], [ 19., 21., 23.]]]], dtype=float32)