Conv1d

class dragon.vm.torch.nn.Conv1d(
  in_channels,
  out_channels,
  kernel_size,
  stride=1,
  padding=0,
  dilation=1,
  groups=1,
  bias=True
)[source]

Apply the 1d convolution.

This module excepts the input size \((N, C_{\text{in}}, H)\), and output size is \((N, C_{\text{out}}, H_{\text{out}})\), where \(N\) is the batch size, \(C\) is the number of channels, \(H\) is the height of data.

Examples:

m = torch.nn.Conv1d(2, 3, 3, padding=1)
x = torch.ones(2, 2, 2)
y = m(x)

__init__

Conv1d.__init__(
  in_channels,
  out_channels,
  kernel_size,
  stride=1,
  padding=0,
  dilation=1,
  groups=1,
  bias=True
)[source]

Create a Conv1d module.

Parameters:
  • in_channels (int) – The number of input channels.
  • out_channels (int) – The number of output channels.
  • kernel_size (Union[int, Sequence[int]]) – The size of convolution window.
  • stride (Union[int, Sequence[int]], optional, default=1) – The stride of convolution window.
  • padding (Union[int, Sequence[int]], optional, default=0) – The zero padding size.
  • dilation (Union[int, Sequence[int]], optional, default=1) – The rate of dilated convolution.
  • groups (int, optional, default=1) – The number of groups to split channels into.
  • bias (bool, optional, default=True) – True to add a bias on the output.