[source]

MaxPooling1D

keras.layers.MaxPooling1D(pool_size=2, strides=None, padding='valid', data_format='channels_last')

时间数据的最大合并操作.

Arguments

  • pool_size :整数,最大池窗口的大小.
  • 大步 :整数或无. 缩减规模的因素. 例如2将使输入减半. 如果为None,它将默认为pool_size .
  • padding"valid""same" (不区分大小写)之一.
  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, steps, features)输入,而channels_first对应于形状(batch, features, steps) .

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, steps, features) 3D张量
  • 如果data_format='channels_first' :形状为(batch_size, features, steps) 3D张量

输出形状

  • 如果data_format='channels_last' :形状为(batch_size, downsampled_steps, features) 3D张量
  • 如果data_format='channels_first' :形状为(batch_size, features, downsampled_steps) 3D张量

[source]

MaxPooling2D

keras.layers.MaxPooling2D(pool_size=(2, 2), strides=None, padding='valid', data_format=None)

空间数据的最大合并操作.

Arguments

  • pool_size :2个整数的整数或元组,用于缩减的因子(垂直,水平). (2,2)将在两个空间维度上将输入减半. 如果仅指定一个整数,则两个尺寸将使用相同的窗口长度.
  • 步幅 :整数,2个整数的元组或无. 跨越价值观. 如果为None,它将默认为pool_size .
  • padding"valid""same" (不区分大小写)之一.
  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, height, width, channels)输入,而channels_first对应于形状(batch, channels, height, width) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, rows, cols, channels) 4D张量
  • 如果data_format='channels_first' :形状为(batch_size, channels, rows, cols) 4D张量

输出形状

  • 如果data_format='channels_last' :形状为(batch_size, pooled_rows, pooled_cols, channels) 4D张量
  • 如果data_format='channels_first' :形状为(batch_size, channels, pooled_rows, pooled_cols) 4D张量

[source]

MaxPooling3D

keras.layers.MaxPooling3D(pool_size=(2, 2, 2), strides=None, padding='valid', data_format=None)

3D数据(空间或时空)的最大合并操作.

Arguments

  • pool_size :3个整数的元组,用于缩减的因子(dim1,dim2,dim3). (2、2、2)将使每个维度中3D输入的大小减半.
  • 步幅 :3个整数的元组,或无. 跨越价值观.
  • padding"valid""same" (不区分大小写)之一.
  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状为(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)输入,而channels_first对应于形状为(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels) 5D张量
  • 如果data_format='channels_first' :具有以下形状的5D张量: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

输出形状

  • 如果data_format='channels_last' :具有以下形状的5D张量: (batch_size, pooled_dim1, pooled_dim2, pooled_dim3, channels)
  • 如果data_format='channels_first' :形状为(batch_size, channels, pooled_dim1, pooled_dim2, pooled_dim3) 5D张量

[source]

AveragePooling1D

keras.layers.AveragePooling1D(pool_size=2, strides=None, padding='valid', data_format='channels_last')

时间数据的平均池.

Arguments

  • pool_size :整数,平均池化窗口的大小.
  • 大步 :整数或无. 缩减规模的因素. 例如2将使输入减半. 如果为None,它将默认为pool_size .
  • padding"valid""same" (不区分大小写)之一.
  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, steps, features)输入,而channels_first对应于形状(batch, features, steps) .

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, steps, features) 3D张量
  • 如果data_format='channels_first' :形状为(batch_size, features, steps) 3D张量

输出形状

  • 如果data_format='channels_last' :形状为(batch_size, downsampled_steps, features) 3D张量
  • 如果data_format='channels_first' :形状为(batch_size, features, downsampled_steps) 3D张量

[source]

AveragePooling2D

keras.layers.AveragePooling2D(pool_size=(2, 2), strides=None, padding='valid', data_format=None)

空间数据的平均池化操作.

Arguments

  • pool_size :2个整数的整数或元组,用于缩减的因子(垂直,水平). (2,2)将在两个空间维度上将输入减半. 如果仅指定一个整数,则两个尺寸将使用相同的窗口长度.
  • 步幅 :整数,2个整数的元组或无. 跨越价值观. 如果为None,它将默认为pool_size .
  • padding"valid""same" (不区分大小写)之一.
  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, height, width, channels)输入,而channels_first对应于形状(batch, channels, height, width) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, rows, cols, channels) 4D张量
  • 如果data_format='channels_first' :形状为(batch_size, channels, rows, cols) 4D张量

输出形状

  • 如果data_format='channels_last' :形状为(batch_size, pooled_rows, pooled_cols, channels) 4D张量
  • 如果data_format='channels_first' :形状为(batch_size, channels, pooled_rows, pooled_cols) 4D张量

[source]

AveragePooling3D

keras.layers.AveragePooling3D(pool_size=(2, 2, 2), strides=None, padding='valid', data_format=None)

3D数据(空间或时空)的平均合并操作.

Arguments

  • pool_size :3个整数的元组,用于缩减的因子(dim1,dim2,dim3). (2、2、2)将使每个维度中3D输入的大小减半.
  • 步幅 :3个整数的元组,或无. 跨越价值观.
  • padding"valid""same" (不区分大小写)之一.
  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状为(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)输入,而channels_first对应于形状为(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels) 5D张量
  • 如果data_format='channels_first' :具有以下形状的5D张量: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

Output shape

  • 如果data_format='channels_last' :具有以下形状的5D张量: (batch_size, pooled_dim1, pooled_dim2, pooled_dim3, channels)
  • 如果data_format='channels_first' :形状为(batch_size, channels, pooled_dim1, pooled_dim2, pooled_dim3) 5D张量

[source]

GlobalMaxPooling1D

keras.layers.GlobalMaxPooling1D(data_format='channels_last')

全局最大池操作用于时间数据.

Arguments

  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, steps, features)输入,而channels_first对应于形状(batch, features, steps) .

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, steps, features) 3D张量
  • 如果data_format='channels_first' :形状为(batch_size, features, steps) 3D张量

输出形状

具有形状的2D张量: (batch_size, features)


[source]

GlobalAveragePooling1D

keras.layers.GlobalAveragePooling1D(data_format='channels_last')

时间数据的全局平均池化操作.

Arguments

  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, steps, features)输入,而channels_first对应于形状(batch, features, steps) .

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, steps, features) 3D张量
  • If data_format='channels_first': 3D tensor with shape: (batch_size, features, steps)

输出形状

具有形状的2D张量: (batch_size, features)


[source]

GlobalMaxPooling2D

keras.layers.GlobalMaxPooling2D(data_format=None)

空间数据的全局最大池化操作.

Arguments

  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, height, width, channels)输入,而channels_first对应于形状(batch, channels, height, width) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, rows, cols, channels) 4D张量
  • 如果data_format='channels_first' :形状为(batch_size, channels, rows, cols) 4D张量

输出形状

具有以下形状的2D张量: (batch_size, channels)


[source]

GlobalAveragePooling2D

keras.layers.GlobalAveragePooling2D(data_format=None)

空间数据的全局平均池化操作.

Arguments

  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状(batch, height, width, channels)输入,而channels_first对应于形状(batch, channels, height, width) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, rows, cols, channels) 4D张量
  • 如果data_format='channels_first' :形状为(batch_size, channels, rows, cols) 4D张量

输出形状

具有以下形状的2D张量: (batch_size, channels)


[source]

GlobalMaxPooling3D

keras.layers.GlobalMaxPooling3D(data_format=None)

3D数据的全局最大池化操作.

Arguments

  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状为(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)输入,而channels_first对应于形状为(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels) 5D张量
  • 如果data_format='channels_first' :具有以下形状的5D张量: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

输出形状

具有以下形状的2D张量: (batch_size, channels)


[source]

GlobalAveragePooling3D

keras.layers.GlobalAveragePooling3D(data_format=None)

3D数据的全局平均池化操作.

Arguments

  • data_format :一个字符串, channels_last (默认)或channels_first . 输入中尺寸的顺序. channels_last对应于形状为(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)输入,而channels_first对应于形状为(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3) . 它默认为在~/.keras/keras.json配置文件中找到的image_data_format值. 如果您从未设置,那么它将是" channels_last".

输入形状

  • 如果data_format='channels_last' :形状为(batch_size, spatial_dim1, spatial_dim2, spatial_dim3, channels) 5D张量
  • 如果data_format='channels_first' :具有以下形状的5D张量: (batch_size, channels, spatial_dim1, spatial_dim2, spatial_dim3)

输出形状

具有以下形状的2D张量: (batch_size, channels)