U-Net configuration. Values from Appendix B (CIFAR-10 config) and official code unless marked.
| 34 | |
| 35 | @dataclass |
| 36 | class 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 | # --------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected