tf.keras.layers.Cropping3D
| Просмотреть исходный код на GitHub |
Слой обрезки для 3D данных (например, пространственных или пространственно-временных).
Наследуется от: Layer
tf.keras.layers.Cropping3D(
cropping=((1, 1), (1, 1), (1, 1)), data_format=None, **kwargs
)
Примеры:
input_shape = (2, 28, 28, 10, 3) x = np.arange(np.prod(input_shape)).reshape(input_shape) y = tf.keras.layers.Cropping3D(cropping=(2, 4, 2))(x) print(y.shape) (2, 24, 20, 6, 3)
| Аргументы | |
|---|---|
cropping | Целое число или кортеж из 3 целых чисел или кортеж из 3 кортежей по 2 целых числа.
|
data_format | Строка, одна из channels_last (по умолчанию) или channels_first. Порядок измерений на входе. channels_last соответствует входным данным с формой (batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels), в то время как channels_first соответствует входным данным с формой (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3). По умолчанию используется значение image_data_format в файле конфигурации Keras по адресу ~/.keras/keras.json. Если вы никогда его не устанавливали, он будет равен "channels_last". |
Форма входных данных:
5D тензор с формой:
- Если
data_formatравно"channels_last":(batch_size, first_axis_to_crop, second_axis_to_crop, third_axis_to_crop, depth) - Если
data_formatравно"channels_first":(batch_size, depth, first_axis_to_crop, second_axis_to_crop, third_axis_to_crop)
Форма выходных данных:
5D тензор с формой:
- Если
data_formatравно"channels_last":(batch_size, first_cropped_axis, second_cropped_axis, third_cropped_axis, depth) - Если
data_formatравно"channels_first":(batch_size, depth, first_cropped_axis, second_cropped_axis, third_cropped_axis)
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/keras/layers/Cropping3D