Keras.backend.local_conv1d 纪要

K.local_conv1d

  • 关键输入
    1. inputs: 3D tensor with shape: (batch_size, steps, input_dim)
    2. kernel: the unshared weight for convolution,
      with shape (output_length, feature_dim, filters)
    3. kernel_size: a tuple of a single integer,
      specifying the length of the 1D convolution window
    4. strides: a tuple of a single integer,
      specifying the stride length of the convolution
  • 注意点
    1. steps表示kernel要在该维度上移动
    2. steps维度的大小应该等于 (output_length-1)*stride + kernel_size
    3. feature_dim 应该是被 batch_size * kernel_size * input_dim 整除

K.local_conv2d

  • 输入
    1. inputs: 4D tensor with shape:
      (batch_size, filters, new_rows, new_cols)
      if data_format='channels_first'
      or 4D tensor with shape:
      (batch_size, new_rows, new_cols, filters)
      if data_format='channels_last'.
    2. kernel: the unshared weight for convolution,
      with shape (output_items, feature_dim, filters)
    3. kernel_size: a tuple of 2 integers, specifying the
      width and height of the 2D convolution window.
    4. strides: a tuple of 2 integers, specifying the strides
      of the convolution along the width and height.
    5. output_shape: a tuple with (output_row, output_col)
    6. data_format: the data format, channels_first or channels_last
  • output_row, output_col的要求和local_conv1d中output_length的要求类似
  • kernel 中的 feature_dim 应该可以被 batch_size * filters * kernel_size[0] * kernel_size[1] 整除
  • kernel中的output_items = output_shape[0] * output_shape[1]
  • kernel中的feature_dim的含义是什么?难道要等于 kernel_size[0]*kernel_size[0]
  • inputs中的 filters 指输入filter
  • kernel中的filters 指输出filter, 输入中的filter和输出中的filter 不必相等
  • 要想输出的batch_size 等于 输入的batch_size, kernel中的feature_dim应该等等于kernel_size[0] * kernel_size[1] * 输入中的filters
  • 返回
    A 4d tensor with shape:
    (batch_size, filters, new_rows, new_cols)
    if data_format='channels_first'
    or 4D tensor with shape:
    `(batch_size, new_rows, new_cols, filters)
    if data_format='channels_last'.

你可能感兴趣的:(Keras.backend.local_conv1d 纪要)