MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / __init__

Method __init__

ldm/modules/diffusionmodules/model.py:786–796  ·  view source on GitHub ↗
(self, in_channels, ch, resolution, out_ch, num_res_blocks,
                 attn_resolutions, dropout=0.0, resamp_with_conv=True,
                 ch_mult=(1,2,4,8), rescale_factor=1.0, rescale_module_depth=1)

Source from the content-addressed store, hash-verified

784
785class MergedRescaleEncoder(nn.Module):
786 def __init__(self, in_channels, ch, resolution, out_ch, num_res_blocks,
787 attn_resolutions, dropout=0.0, resamp_with_conv=True,
788 ch_mult=(1,2,4,8), rescale_factor=1.0, rescale_module_depth=1):
789 super().__init__()
790 intermediate_chn = ch * ch_mult[-1]
791 self.encoder = Encoder(in_channels=in_channels, num_res_blocks=num_res_blocks, ch=ch, ch_mult=ch_mult,
792 z_channels=intermediate_chn, double_z=False, resolution=resolution,
793 attn_resolutions=attn_resolutions, dropout=dropout, resamp_with_conv=resamp_with_conv,
794 out_ch=None)
795 self.rescaler = LatentRescaler(factor=rescale_factor, in_channels=intermediate_chn,
796 mid_channels=intermediate_chn, out_channels=out_ch, depth=rescale_module_depth)
797
798 def forward(self, x):
799 x = self.encoder(x)

Callers

nothing calls this directly

Calls 3

EncoderClass · 0.85
LatentRescalerClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected