Xsmos commited on
Commit
59fef97
·
verified ·
1 Parent(s): f8d6e5f
Files changed (1) hide show
  1. diffusion.ipynb +32 -32
diffusion.ipynb CHANGED
@@ -255,14 +255,14 @@
255
  " device = 'cuda' if torch.cuda.is_available() else 'cpu'\n",
256
  " # repeat = 2\n",
257
  "\n",
258
- " dim = 2\n",
259
- " # dim = 3\n",
260
  " stride = (2,2) if dim == 2 else (2,2,2)\n",
261
  " num_image = 2000#32000#20000#15000#7000#25600#3000#10000#1000#10000#5000#2560#800#2560\n",
262
- " batch_size = 2*64#2#50#20#2#100 # 10\n",
263
  " n_epoch = 10#50#20#20#2#5#25 # 120\n",
264
  " HII_DIM = 64\n",
265
- " num_redshift = 64#512#256#256#64#512#128\n",
266
  " channel = 1\n",
267
  " img_shape = (channel, HII_DIM, num_redshift) if dim == 2 else (channel, HII_DIM, HII_DIM, num_redshift)\n",
268
  "\n",
@@ -565,15 +565,14 @@
565
  "output_type": "stream",
566
  "text": [
567
  "Number of parameters for nn_model: 111048705\n",
568
- "---------------- num_image = 512 -----------------\n",
569
- "run_name = 0706-2033\n",
570
  "Launching training on one GPU.\n",
571
  "dataset content: <KeysViewHDF5 ['brightness_temp', 'density', 'kwargs', 'params', 'redshifts_distances', 'seeds', 'xH_box']>\n",
572
  "51200 images can be loaded\n",
573
  "field.shape = (64, 64, 514)\n",
574
  "params keys = [b'ION_Tvir_MIN', b'HII_EFF_FACTOR']\n",
575
- "loading 512 images randomly\n",
576
- "images loaded: (512, 1, 64, 64)\n"
577
  ]
578
  },
579
  {
@@ -587,20 +586,21 @@
587
  "name": "stdout",
588
  "output_type": "stream",
589
  "text": [
590
- "params loaded: (512, 2)\n",
591
- "images rescaled to [-1.0, 1.116640567779541]\n",
592
- "params rescaled to [0.00024580534048324054, 0.9967556649676916]\n"
 
593
  ]
594
  },
595
  {
596
  "data": {
597
  "application/vnd.jupyter.widget-view+json": {
598
- "model_id": "0528cc7f8f7b4013a38dc1f5f5ecc99b",
599
  "version_major": 2,
600
  "version_minor": 0
601
  },
602
  "text/plain": [
603
- " 0%| | 0/4 [00:00<?, ?it/s]"
604
  ]
605
  },
606
  "metadata": {},
@@ -609,12 +609,12 @@
609
  {
610
  "data": {
611
  "application/vnd.jupyter.widget-view+json": {
612
- "model_id": "03c91703f35749bdb710e54196d0cd8e",
613
  "version_major": 2,
614
  "version_minor": 0
615
  },
616
  "text/plain": [
617
- " 0%| | 0/4 [00:00<?, ?it/s]"
618
  ]
619
  },
620
  "metadata": {},
@@ -623,12 +623,12 @@
623
  {
624
  "data": {
625
  "application/vnd.jupyter.widget-view+json": {
626
- "model_id": "f55a5c7a47074aa49326453b7b3d9a2b",
627
  "version_major": 2,
628
  "version_minor": 0
629
  },
630
  "text/plain": [
631
- " 0%| | 0/4 [00:00<?, ?it/s]"
632
  ]
633
  },
634
  "metadata": {},
@@ -637,12 +637,12 @@
637
  {
638
  "data": {
639
  "application/vnd.jupyter.widget-view+json": {
640
- "model_id": "4f41ba4f484b4548abc4a8694fd51fcf",
641
  "version_major": 2,
642
  "version_minor": 0
643
  },
644
  "text/plain": [
645
- " 0%| | 0/4 [00:00<?, ?it/s]"
646
  ]
647
  },
648
  "metadata": {},
@@ -651,12 +651,12 @@
651
  {
652
  "data": {
653
  "application/vnd.jupyter.widget-view+json": {
654
- "model_id": "5148cb8ca78b4787a533c420adffa654",
655
  "version_major": 2,
656
  "version_minor": 0
657
  },
658
  "text/plain": [
659
- " 0%| | 0/4 [00:00<?, ?it/s]"
660
  ]
661
  },
662
  "metadata": {},
@@ -665,12 +665,12 @@
665
  {
666
  "data": {
667
  "application/vnd.jupyter.widget-view+json": {
668
- "model_id": "ee1acc3b3dff479c973a66747f5a674d",
669
  "version_major": 2,
670
  "version_minor": 0
671
  },
672
  "text/plain": [
673
- " 0%| | 0/4 [00:00<?, ?it/s]"
674
  ]
675
  },
676
  "metadata": {},
@@ -679,12 +679,12 @@
679
  {
680
  "data": {
681
  "application/vnd.jupyter.widget-view+json": {
682
- "model_id": "beea681d6de64561855a3ae95318fe7a",
683
  "version_major": 2,
684
  "version_minor": 0
685
  },
686
  "text/plain": [
687
- " 0%| | 0/4 [00:00<?, ?it/s]"
688
  ]
689
  },
690
  "metadata": {},
@@ -693,12 +693,12 @@
693
  {
694
  "data": {
695
  "application/vnd.jupyter.widget-view+json": {
696
- "model_id": "b627c0db8ba142eb8a11db3ba1d2cccd",
697
  "version_major": 2,
698
  "version_minor": 0
699
  },
700
  "text/plain": [
701
- " 0%| | 0/4 [00:00<?, ?it/s]"
702
  ]
703
  },
704
  "metadata": {},
@@ -707,12 +707,12 @@
707
  {
708
  "data": {
709
  "application/vnd.jupyter.widget-view+json": {
710
- "model_id": "ec52b0207eb049f6aff31f5847283d5b",
711
  "version_major": 2,
712
  "version_minor": 0
713
  },
714
  "text/plain": [
715
- " 0%| | 0/4 [00:00<?, ?it/s]"
716
  ]
717
  },
718
  "metadata": {},
@@ -721,12 +721,12 @@
721
  {
722
  "data": {
723
  "application/vnd.jupyter.widget-view+json": {
724
- "model_id": "e959387839db4d3b8a601723e19f7f35",
725
  "version_major": 2,
726
  "version_minor": 0
727
  },
728
  "text/plain": [
729
- " 0%| | 0/4 [00:00<?, ?it/s]"
730
  ]
731
  },
732
  "metadata": {},
@@ -734,7 +734,7 @@
734
  }
735
  ],
736
  "source": [
737
- "num_image_list = [512]#[20]#[200]#[1600,3200,6400,12800,25600]\n",
738
  "if __name__ == \"__main__\":\n",
739
  " # torch.multiprocessing.set_start_method(\"spawn\")\n",
740
  " # args = (config, nn_model, ddpm, optimizer, dataloader, lr_scheduler)\n",
 
255
  " device = 'cuda' if torch.cuda.is_available() else 'cpu'\n",
256
  " # repeat = 2\n",
257
  "\n",
258
+ " # dim = 2\n",
259
+ " dim = 3\n",
260
  " stride = (2,2) if dim == 2 else (2,2,2)\n",
261
  " num_image = 2000#32000#20000#15000#7000#25600#3000#10000#1000#10000#5000#2560#800#2560\n",
262
+ " batch_size = 2#2#50#20#2#100 # 10\n",
263
  " n_epoch = 10#50#20#20#2#5#25 # 120\n",
264
  " HII_DIM = 64\n",
265
+ " num_redshift = 128#64#512#256#256#64#512#128\n",
266
  " channel = 1\n",
267
  " img_shape = (channel, HII_DIM, num_redshift) if dim == 2 else (channel, HII_DIM, HII_DIM, num_redshift)\n",
268
  "\n",
 
565
  "output_type": "stream",
566
  "text": [
567
  "Number of parameters for nn_model: 111048705\n",
568
+ "----------------- num_image = 20 -----------------\n",
569
+ "run_name = 0706-2044\n",
570
  "Launching training on one GPU.\n",
571
  "dataset content: <KeysViewHDF5 ['brightness_temp', 'density', 'kwargs', 'params', 'redshifts_distances', 'seeds', 'xH_box']>\n",
572
  "51200 images can be loaded\n",
573
  "field.shape = (64, 64, 514)\n",
574
  "params keys = [b'ION_Tvir_MIN', b'HII_EFF_FACTOR']\n",
575
+ "loading 20 images randomly\n"
 
576
  ]
577
  },
578
  {
 
586
  "name": "stdout",
587
  "output_type": "stream",
588
  "text": [
589
+ "images loaded: (20, 1, 64, 128)\n",
590
+ "params loaded: (20, 2)\n",
591
+ "images rescaled to [-1.0, 1.0278661251068115]\n",
592
+ "params rescaled to [0.005739769005289105, 0.972333144312969]\n"
593
  ]
594
  },
595
  {
596
  "data": {
597
  "application/vnd.jupyter.widget-view+json": {
598
+ "model_id": "432face5514f46dbab6a0bd6752ee9dd",
599
  "version_major": 2,
600
  "version_minor": 0
601
  },
602
  "text/plain": [
603
+ " 0%| | 0/10 [00:00<?, ?it/s]"
604
  ]
605
  },
606
  "metadata": {},
 
609
  {
610
  "data": {
611
  "application/vnd.jupyter.widget-view+json": {
612
+ "model_id": "43bc633a08524f1ea75546311244f8aa",
613
  "version_major": 2,
614
  "version_minor": 0
615
  },
616
  "text/plain": [
617
+ " 0%| | 0/10 [00:00<?, ?it/s]"
618
  ]
619
  },
620
  "metadata": {},
 
623
  {
624
  "data": {
625
  "application/vnd.jupyter.widget-view+json": {
626
+ "model_id": "884b273aa5d9468ba1facd835f4de2df",
627
  "version_major": 2,
628
  "version_minor": 0
629
  },
630
  "text/plain": [
631
+ " 0%| | 0/10 [00:00<?, ?it/s]"
632
  ]
633
  },
634
  "metadata": {},
 
637
  {
638
  "data": {
639
  "application/vnd.jupyter.widget-view+json": {
640
+ "model_id": "7eabba7c6741415ea5e6fd097e33dbb2",
641
  "version_major": 2,
642
  "version_minor": 0
643
  },
644
  "text/plain": [
645
+ " 0%| | 0/10 [00:00<?, ?it/s]"
646
  ]
647
  },
648
  "metadata": {},
 
651
  {
652
  "data": {
653
  "application/vnd.jupyter.widget-view+json": {
654
+ "model_id": "8cfc863995a74070b23bfcd73d314cca",
655
  "version_major": 2,
656
  "version_minor": 0
657
  },
658
  "text/plain": [
659
+ " 0%| | 0/10 [00:00<?, ?it/s]"
660
  ]
661
  },
662
  "metadata": {},
 
665
  {
666
  "data": {
667
  "application/vnd.jupyter.widget-view+json": {
668
+ "model_id": "7c53f6b374644535aa8e2bce7e961d80",
669
  "version_major": 2,
670
  "version_minor": 0
671
  },
672
  "text/plain": [
673
+ " 0%| | 0/10 [00:00<?, ?it/s]"
674
  ]
675
  },
676
  "metadata": {},
 
679
  {
680
  "data": {
681
  "application/vnd.jupyter.widget-view+json": {
682
+ "model_id": "2494d9b658f7493088b64eab1006f2c4",
683
  "version_major": 2,
684
  "version_minor": 0
685
  },
686
  "text/plain": [
687
+ " 0%| | 0/10 [00:00<?, ?it/s]"
688
  ]
689
  },
690
  "metadata": {},
 
693
  {
694
  "data": {
695
  "application/vnd.jupyter.widget-view+json": {
696
+ "model_id": "070d1da1b37043f8aac851d3bf5c22f3",
697
  "version_major": 2,
698
  "version_minor": 0
699
  },
700
  "text/plain": [
701
+ " 0%| | 0/10 [00:00<?, ?it/s]"
702
  ]
703
  },
704
  "metadata": {},
 
707
  {
708
  "data": {
709
  "application/vnd.jupyter.widget-view+json": {
710
+ "model_id": "063fc075914d4e7bb5ffaf9f0ac14285",
711
  "version_major": 2,
712
  "version_minor": 0
713
  },
714
  "text/plain": [
715
+ " 0%| | 0/10 [00:00<?, ?it/s]"
716
  ]
717
  },
718
  "metadata": {},
 
721
  {
722
  "data": {
723
  "application/vnd.jupyter.widget-view+json": {
724
+ "model_id": "01c9c1d56a394f3caf0c6fec1b072bcd",
725
  "version_major": 2,
726
  "version_minor": 0
727
  },
728
  "text/plain": [
729
+ " 0%| | 0/10 [00:00<?, ?it/s]"
730
  ]
731
  },
732
  "metadata": {},
 
734
  }
735
  ],
736
  "source": [
737
+ "num_image_list = [20]#[200]#[1600,3200,6400,12800,25600]\n",
738
  "if __name__ == \"__main__\":\n",
739
  " # torch.multiprocessing.set_start_method(\"spawn\")\n",
740
  " # args = (config, nn_model, ddpm, optimizer, dataloader, lr_scheduler)\n",