cin-ldm-vq-f8.yaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. model:
  2. base_learning_rate: 1.0e-06
  3. target: ldm.models.diffusion.ddpm.LatentDiffusion
  4. params:
  5. linear_start: 0.0015
  6. linear_end: 0.0195
  7. num_timesteps_cond: 1
  8. log_every_t: 200
  9. timesteps: 1000
  10. first_stage_key: image
  11. cond_stage_key: class_label
  12. image_size: 32
  13. channels: 4
  14. cond_stage_trainable: true
  15. conditioning_key: crossattn
  16. monitor: val/loss_simple_ema
  17. unet_config:
  18. target: ldm.modules.diffusionmodules.openaimodel.UNetModel
  19. params:
  20. image_size: 32
  21. in_channels: 4
  22. out_channels: 4
  23. model_channels: 256
  24. attention_resolutions:
  25. #note: this isn\t actually the resolution but
  26. # the downsampling factor, i.e. this corresnponds to
  27. # attention on spatial resolution 8,16,32, as the
  28. # spatial reolution of the latents is 32 for f8
  29. - 4
  30. - 2
  31. - 1
  32. num_res_blocks: 2
  33. channel_mult:
  34. - 1
  35. - 2
  36. - 4
  37. num_head_channels: 32
  38. use_spatial_transformer: true
  39. transformer_depth: 1
  40. context_dim: 512
  41. first_stage_config:
  42. target: ldm.models.autoencoder.VQModelInterface
  43. params:
  44. embed_dim: 4
  45. n_embed: 16384
  46. ckpt_path: configs/first_stage_models/vq-f8/model.yaml
  47. ddconfig:
  48. double_z: false
  49. z_channels: 4
  50. resolution: 256
  51. in_channels: 3
  52. out_ch: 3
  53. ch: 128
  54. ch_mult:
  55. - 1
  56. - 2
  57. - 2
  58. - 4
  59. num_res_blocks: 2
  60. attn_resolutions:
  61. - 32
  62. dropout: 0.0
  63. lossconfig:
  64. target: torch.nn.Identity
  65. cond_stage_config:
  66. target: ldm.modules.encoders.modules.ClassEmbedder
  67. params:
  68. embed_dim: 512
  69. key: class_label
  70. data:
  71. target: main.DataModuleFromConfig
  72. params:
  73. batch_size: 64
  74. num_workers: 12
  75. wrap: false
  76. train:
  77. target: ldm.data.imagenet.ImageNetTrain
  78. params:
  79. config:
  80. size: 256
  81. validation:
  82. target: ldm.data.imagenet.ImageNetValidation
  83. params:
  84. config:
  85. size: 256
  86. lightning:
  87. callbacks:
  88. image_logger:
  89. target: main.ImageLogger
  90. params:
  91. batch_frequency: 5000
  92. max_images: 8
  93. increase_log_steps: False
  94. trainer:
  95. benchmark: True