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

サブピクセル演算のためのdepth2space 変換を演算する。

 

Parameters:
Returns:

分散した深さの層(interspersed depth layers)からアップスケースされた配列をもつVariable。この shape は(batch, channel, dim1 * r, dim2 * r)

Return type:

Variable

Note

これは超解像変形の演算にも用いることが出来ます。 詳細はこちらをお読みください。 https://arxiv.org/abs/1609.05158

こちらもお読みください(*準備中)

space2depth()

 

Example

 

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

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