Method
__init__
(
self,
inp_channels: int,
out_channels: int,
kernel_size: int | tuple[int, int],
n_groups: int = 8,
activation: str = "mish",
)
Source from the content-addressed store, hash-verified
| 402 | """ |
| 403 | |
| 404 | def __init__( |
| 405 | self, |
| 406 | inp_channels: int, |
| 407 | out_channels: int, |
| 408 | kernel_size: int | tuple[int, int], |
| 409 | n_groups: int = 8, |
| 410 | activation: str = "mish", |
| 411 | ): |
| 412 | super().__init__() |
| 413 | |
| 414 | self.conv1d = nn.Conv1d(inp_channels, out_channels, kernel_size, padding=kernel_size // 2) |
| 415 | self.group_norm = nn.GroupNorm(n_groups, out_channels) |
| 416 | self.mish = get_activation(activation) |
| 417 | |
| 418 | def forward(self, inputs: torch.Tensor) -> torch.Tensor: |
| 419 | intermediate_repr = self.conv1d(inputs) |
Tested by
no test coverage detected