Cropping3D
類別keras.layers.Cropping3D(
cropping=((1, 1), (1, 1), (1, 1)), data_format=None, **kwargs
)
用於 3D 資料(例如空間或時空)的裁剪層。
範例
>>> input_shape = (2, 28, 28, 10, 3)
>>> x = np.arange(np.prod(input_shape)).reshape(input_shape)
>>> y = keras.layers.Cropping3D(cropping=(2, 4, 2))(x)
>>> y.shape
(2, 24, 20, 6, 3)
引數
(symmetric_dim1_crop, symmetric_dim2_crop, symmetric_dim3_crop)
。((left_dim1_crop, right_dim1_crop), (left_dim2_crop, right_dim2_crop), (left_dim3_crop, right_dim3_crop))
。"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)
的輸入。未指定時,使用在您的 Keras 設定檔 ~/.keras/keras.json
(如果存在) 中找到的 image_data_format
值。預設為 "channels_last"
。輸入形狀
5D 張量,形狀為: - 如果 data_format
為 "channels_last"
: (batch_size, first_axis_to_crop, second_axis_to_crop, third_axis_to_crop, channels)
- 如果 data_format
為 "channels_first"
: (batch_size, channels, 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, channels)
- 如果 data_format
為 "channels_first"
: (batch_size, channels, first_cropped_axis, second_cropped_axis, third_cropped_axis)