mlx.nn.Conv1d

目录

mlx.nn.Conv1d#

class Conv1d(in_channels: int, out_channels: int, kernel_size: int, stride: int = 1, padding: int = 0, dilation: int = 1, groups: int = 1, bias: bool = True)#

在多通道输入序列上应用一维卷积。

通道维度应在最后,即输入形状应为 NLC,其中

  • N 是批次大小

  • L 是序列长度

  • C 是输入通道数

参数:
  • in_channels (int) – 输入通道数

  • out_channels (int) – 输出通道数

  • kernel_size (int) – 卷积核的大小

  • stride (int, 可选) – 应用卷积核时的步长。默认值: 1

  • padding (int, 可选) – 输入的零填充位置数。默认值: 0

  • dilation (int, 可选) – 卷积的空洞大小(dilation)。

  • groups (int, 可选) – 卷积的分组数。默认值: 1

  • bias (bool, 可选) – 如果为 True,则在输出中添加一个可学习的偏置。默认值: True

方法