tf.keras.layers.UpSampling1D
| Просмотреть исходный код на GitHub |
Слой повышения разрешения для 1D входных данных.
tf.keras.layers.UpSampling1D(
size=2, **kwargs
)
Повторяет каждый временной шаг 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)
| Аргументы | |
|---|---|
size | Целое число. Коэффициент повышения разрешения. |
Форма входных данных:
3D тензор с формой: (batch_size, steps, features).
Форма выходных данных:
3D тензор с формой: (batch_size, upsampled_steps, features).
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/keras/layers/UpSampling1D