Xsmos commited on
Commit
fe1814b
·
verified ·
1 Parent(s): a004bb0
Files changed (3) hide show
  1. context_unet.py +1 -1
  2. diffusion.py +5 -5
  3. quantify_results.ipynb +0 -0
context_unet.py CHANGED
@@ -330,7 +330,7 @@ class ContextUnet(nn.Module):
330
  elif image_size == 128:
331
  channel_mult = (1, 1, 2, 3, 4)
332
  elif image_size == 64:
333
- channel_mult = (1, 1, 2, 2, 4, 4)#(1, 2, 2, 4, 8)#(1, 1, 2, 2, 4, 4)#(1, 2, 4, 8, 16)#(1, 2, 3, 4)#(1, 2, 4, 6, 8)#(1, 2, 2, 4)#(1, 2, 8, 8, 8)#(1, 2, 4)#(1, 2, 2, 4)#(0.5,1,2,2,4,4)#(1, 1, 2, 2, 4, 4)#
334
  elif image_size == 32:
335
  channel_mult = (1, 2, 2, 4)
336
  elif image_size == 28:
 
330
  elif image_size == 128:
331
  channel_mult = (1, 1, 2, 3, 4)
332
  elif image_size == 64:
333
+ channel_mult = (2,4,4,4,8)#(1, 2, 2, 4, 4)#(1, 2, 2, 4, 8)#(1, 1, 2, 2, 4, 4)#(1, 2, 4, 8, 16)#(1, 2, 3, 4)#(1, 2, 4, 6, 8)#(1, 2, 2, 4)#(1, 2, 8, 8, 8)#(1, 2, 4)#(1, 2, 2, 4)#(0.5,1,2,2,4,4)#(1, 1, 2, 2, 4, 4)#
334
  elif image_size == 32:
335
  channel_mult = (1, 2, 2, 4)
336
  elif image_size == 28:
diffusion.py CHANGED
@@ -238,12 +238,12 @@ class TrainConfig:
238
 
239
  # dim = 2
240
  dim = 2
241
- stride = (2,2) if dim == 2 else (2,2,2)
242
  num_image = 1000#2000#20000#15000#7000#25600#3000#10000#1000#10000#5000#2560#800#2560
243
- batch_size = 50#20#50#1#2#50#20#2#100 # 10
244
  n_epoch = 50#50#100#30#120#5#4# 10#50#20#20#2#5#25 # 120
245
  HII_DIM = 64
246
- num_redshift = 64#512#64#256CUDAoom#128#64#512#128#64#512#256#256#64#512#128
247
  channel = 1
248
  img_shape = (channel, HII_DIM, num_redshift) if dim == 2 else (channel, HII_DIM, HII_DIM, num_redshift)
249
 
@@ -268,7 +268,7 @@ class TrainConfig:
268
  # seed = 0
269
  # save_dir = './outputs/'
270
 
271
- save_period = n_epoch // 2 #np.infty#.1 # the period of sampling
272
  # general parameters for the name and logger
273
  # device = "cuda" if torch.cuda.is_available() else "cpu"
274
  lrate = 1e-4
@@ -636,7 +636,7 @@ class DDPM21CM:
636
  return x_last
637
  # %%
638
 
639
- num_train_image_list = [8000]#[1000]#[100]#
640
 
641
  def train(rank, world_size):
642
  config = TrainConfig()
 
238
 
239
  # dim = 2
240
  dim = 2
241
+ stride = (2,4) if dim == 2 else (2,2,2)
242
  num_image = 1000#2000#20000#15000#7000#25600#3000#10000#1000#10000#5000#2560#800#2560
243
+ batch_size = 10#50#20#50#1#2#50#20#2#100 # 10
244
  n_epoch = 50#50#100#30#120#5#4# 10#50#20#20#2#5#25 # 120
245
  HII_DIM = 64
246
+ num_redshift = 512#64#512#64#256CUDAoom#128#64#512#128#64#512#256#256#64#512#128
247
  channel = 1
248
  img_shape = (channel, HII_DIM, num_redshift) if dim == 2 else (channel, HII_DIM, HII_DIM, num_redshift)
249
 
 
268
  # seed = 0
269
  # save_dir = './outputs/'
270
 
271
+ save_period = 20#n_epoch // 2 #np.infty#.1 # the period of sampling
272
  # general parameters for the name and logger
273
  # device = "cuda" if torch.cuda.is_available() else "cpu"
274
  lrate = 1e-4
 
636
  return x_last
637
  # %%
638
 
639
+ num_train_image_list = [6000]#[600]#[8000]#[1000]#[100]#
640
 
641
  def train(rank, world_size):
642
  config = TrainConfig()
quantify_results.ipynb CHANGED
The diff for this file is too large to render. See raw diff