MCPcopy Create free account
hub / github.com/PrathamLearnsToCode/paper2code / UNetConfig

Class UNetConfig

skills/paper2code/worked/ddpm/src/model.py:36–49  ·  view source on GitHub ↗

U-Net configuration. Values from Appendix B (CIFAR-10 config) and official code unless marked.

Source from the content-addressed store, hash-verified

34
35@dataclass
36class UNetConfig:
37 """U-Net configuration.
38
39 Values from Appendix B (CIFAR-10 config) and official code unless marked.
40 """
41 image_channels: int = 3 # §4 — RGB images
42 base_channels: int = 128 # Appendix B — "128 base channels"
43 channel_mults: tuple = (1, 2, 2, 2) # [FROM_OFFICIAL_CODE] — channel multipliers per level
44 num_res_blocks: int = 2 # [FROM_OFFICIAL_CODE] — residual blocks per resolution level
45 attention_resolutions: tuple = (16,) # Appendix B — "attention at 16×16 resolution"
46 dropout: float = 0.0 # Appendix B — "dropout 0.0" for CIFAR-10
47 time_embed_dim: int = 512 # [FROM_OFFICIAL_CODE] — 4 * base_channels
48 num_groups: int = 32 # [FROM_OFFICIAL_CODE] — groups for GroupNorm
49 image_size: int = 32 # CIFAR-10 is 32×32
50
51
52# ---------------------------------------------------------------------------

Callers 2

trainFunction · 0.90
load_modelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected