diff --git a/Configs/train_1photon.yaml b/Configs/train_1photon.yaml index ea8b974..9ad9604 100644 --- a/Configs/train_1photon.yaml +++ b/Configs/train_1photon.yaml @@ -1,10 +1,10 @@ # configs/train_1photon.yaml experiment: - name: "1photon_12keV" + name: "1photon_15keV" data: sample_folder: "/mnt/sls_det_storage/moench_data/MLXID/Samples/Simulation/Moench040" - energy: 12 ### in keV + energy: 15 ### in keV noise_keV: 0.13 noise_threshold: 0.0 ### set values below (noise * noise_threshold) to zero num_aug_ops: 1 @@ -22,7 +22,7 @@ model: version: "260511" # 251022 training: - epochs: 150 + epochs: 500 learning_rate: 1.0e-3 scheduler_factor: 0.7 scheduler_patience: 3 diff --git a/Configs/train_2photon.yaml b/Configs/train_2photon.yaml index f6878ab..0921b05 100644 --- a/Configs/train_2photon.yaml +++ b/Configs/train_2photon.yaml @@ -1,10 +1,10 @@ # configs/train_2photon.yaml experiment: - name: "2photon_12keV" + name: "2photon_15keV" data: - sample_folder: "/home/xie_x1/MLXID/DataProcess/Samples/SimuPileupSample/" - energy: 12 ### in keV + sample_folder: "/home/xie_x1/MLXID/DataProcess/Samples/15keV_SimuPileupSample/" + energy: 15 ### in keV sample_ratio: 1.0 noise_keV: 0.13 @@ -18,7 +18,7 @@ data: n_size: 6 ### size of sub-images containing 2 photons model: - version: "260608" ## 260608 + version: "260610" ### 260610 is the best one as of 260622 training: epochs: 1000 diff --git a/Configs/train_3photon.yaml b/Configs/train_3photon.yaml index b71de23..0075330 100644 --- a/Configs/train_3photon.yaml +++ b/Configs/train_3photon.yaml @@ -1,12 +1,12 @@ # configs/train_3photon.yaml experiment: - name: "3photon_12keV" + name: "3photon_15keV" data: sample_folder: "/home/xie_x1/MLXID/DeepLearning/PileupSample" - energy: 12 ### in keV + energy: 15 ### in keV - batch_size_train: 4096 + batch_size_train: 512 batch_size_val: 8192 batch_size_test: 8192 num_workers: 16 diff --git a/Train_1Photon.py b/Train_1Photon.py index 8b7b7e6..a8a5307 100644 --- a/Train_1Photon.py +++ b/Train_1Photon.py @@ -31,13 +31,13 @@ def prepare_output_folder(conf): # find the next index for experiment name exp_index = 0 while True: - exp_name = f'{date}_1ph_{conf.data.energy}keV_v{conf.model.version}_{exp_index:02d}' - if not Path(f'Results/{exp_name}').exists(): + exp_name = f'{date}_{conf.data.energy}keV_v{conf.model.version}_{exp_index:02d}' + if not Path(f'Results/1ph/{exp_name}').exists(): break exp_index += 1 - Path(f'Results/{exp_name}').mkdir(parents=True, exist_ok=True) - Path(f'Results/{exp_name}/Models').mkdir(parents=True, exist_ok=True) - Path(f'Results/{exp_name}/Plots').mkdir(parents=True, exist_ok=True) + Path(f'Results/1ph/{exp_name}').mkdir(parents=True, exist_ok=True) + Path(f'Results/1ph/{exp_name}/Models').mkdir(parents=True, exist_ok=True) + Path(f'Results/1ph/{exp_name}/Plots').mkdir(parents=True, exist_ok=True) OmegaConf.save(conf, f'Results/{exp_name}/config.yaml') return exp_name diff --git a/Train_2Photon.py b/Train_2Photon.py index a8ca505..f268ba8 100644 --- a/Train_2Photon.py +++ b/Train_2Photon.py @@ -181,7 +181,7 @@ def get_dataloaders(conf): file_range_keys = ['train_file_range', 'val_file_range', 'test_file_range'] for split, key, batch_key, file_range_key in zip(splits, keys, batch_keys, file_range_keys): - files = [f"{conf.data.sample_folder}/pileupOf2phs_sample_{i}.npz" for i in range(conf.data[file_range_key][0], conf.data[file_range_key][1] + 1)] + files = [f"{conf.data.sample_folder}/{conf.data.energy}keV_Noise{conf.data.noise_keV}keV_pileupOf2phs_sample_{i}.npz" for i in range(conf.data[file_range_key][0], conf.data[file_range_key][1] + 1)] datasets[split] = doublePhotonDataset( files,