MCPcopy Create free account
hub / github.com/dome272/Diffusion-Models-pytorch / __init__

Method __init__

modules.py:103–118  ·  view source on GitHub ↗
(self, in_channels, out_channels, emb_dim=256)

Source from the content-addressed store, hash-verified

101
102class Up(nn.Module):
103 def __init__(self, in_channels, out_channels, emb_dim=256):
104 super().__init__()
105
106 self.up = nn.Upsample(scale_factor=2, mode="bilinear", align_corners=True)
107 self.conv = nn.Sequential(
108 DoubleConv(in_channels, in_channels, residual=True),
109 DoubleConv(in_channels, out_channels, in_channels // 2),
110 )
111
112 self.emb_layer = nn.Sequential(
113 nn.SiLU(),
114 nn.Linear(
115 emb_dim,
116 out_channels
117 ),
118 )
119
120 def forward(self, x, skip_x, t):
121 x = self.up(x)

Callers 6

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

DoubleConvClass · 0.85

Tested by

no test coverage detected