UpSampling1D
類別tf_keras.layers.UpSampling1D(size=2, **kwargs)
用於 1D 輸入的上採樣層。
沿著時間軸將每個時間步重複 size
次。
範例
>>> input_shape = (2, 2, 3)
>>> x = np.arange(np.prod(input_shape)).reshape(input_shape)
>>> print(x)
[[[ 0 1 2]
[ 3 4 5]]
[[ 6 7 8]
[ 9 10 11]]]
>>> y = tf.keras.layers.UpSampling1D(size=2)(x)
>>> print(y)
tf.Tensor(
[[[ 0 1 2]
[ 0 1 2]
[ 3 4 5]
[ 3 4 5]]
[[ 6 7 8]
[ 6 7 8]
[ 9 10 11]
[ 9 10 11]]], shape=(2, 4, 3), dtype=int64)
參數
輸入形狀
形狀為 (batch_size, steps, features)
的 3D 張量。
輸出形狀
形狀為 (batch_size, upsampled_steps, features)
的 3D 張量。