MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / __init__

Method __init__

model/DocDiff.py:324–330  ·  view source on GitHub ↗
(self, input_channels: int = 2, output_channels: int = 1, n_channels: int = 32,
                 ch_mults: Union[Tuple[int, ...], List[int]] = (1, 2, 2, 4),
                 n_blocks: int = 1)

Source from the content-addressed store, hash-verified

3229
323class DocDiff(nn.Module):
324 def __init__(self, input_channels: int = 2, output_channels: int = 1, n_channels: int = 32,
325 ch_mults: Union[Tuple[int, ...], List[int]] = (1, 2, 2, 4),
326 n_blocks: int = 1):
327 super(DocDiff, self).__init__()
328 self.denoiser = UNet(input_channels, output_channels, n_channels, ch_mults, n_blocks, is_noise=True)
329 self.init_predictor = UNet(input_channels//2, output_channels, n_channels, ch_mults, n_blocks, is_noise=False)
330 # self.init_predictor = UNet(input_channels, output_channels, 2 * n_channels, ch_mults, n_blocks)
331
332 def forward(self, x, condition, t, diffusion):
333 x_ = self.init_predictor(condition, t)

Callers

nothing calls this directly

Calls 2

UNetClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected