Update I/O and configs

This commit is contained in:
2026-08-21 09:11:38 +02:00
parent 7c7dc28ce0
commit 3686b3e8c4
5 changed files with 16 additions and 16 deletions
+3 -3
View File
@@ -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
+4 -4
View File
@@ -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
+3 -3
View File
@@ -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
+5 -5
View File
@@ -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
+1 -1
View File
@@ -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,