PreactResBlock¶
-
class
torchelie.nn.
PreactResBlock
(in_channels: int, out_channels: int, stride: int = 1)¶ A Preactivated Residual Block. Skip connection will be added if the number of input and output channels don’t match or stride > 1 is used.
- Parameters
in_ch (int) – input channels
out_ch (int) – output channels
stride (int) – stride
-
condition
(z: torch.Tensor) → None¶
-
forward
(x: torch.Tensor, z: Optional[torch.Tensor] = None) → torch.Tensor¶
-
no_preact
() → torchelie.nn.resblock.PreactResBlock¶
-
preact_skip
() → torchelie.nn.resblock.PreactResBlock¶
-
remove_batchnorm
() → torchelie.nn.resblock.PreactResBlock¶
-
use_se
() → torchelie.nn.resblock.PreactResBlock¶
-
branch
: torchelie.nn.condseq.CondSeq¶
-
shortcut
: torchelie.nn.condseq.CondSeq¶