diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..6fc9d4b9b16d5903436067a9f2448d9fa1e9d63a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,3 +33,64 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00001.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00002.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00003.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00004.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00005.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00006.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00007.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00008.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s0_e1_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s1_e2_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s2_e3_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s3_e4_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s4_e5_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s5_e6_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s6_e7_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s7_e8_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00004.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00006.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00007.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00008.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s0_e1_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s1_e2_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s2_e3_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s3_e4_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s4_e5_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s5_e6_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s6_e7_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s7_e8_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00004.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00006.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00007.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s0_e1_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s1_e2_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s2_e3_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s3_e4_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s4_e5_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s5_e6_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s6_e7_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s7_e8_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00004.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00006.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00007.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s0_e1_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s1_e2_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s2_e3_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s3_e4_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s4_e5_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s5_e6_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s6_e7_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s7_e8_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00004.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00006.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00007.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s0_e1_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s1_e2_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s2_e3_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s3_e4_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s4_e5_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s5_e6_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s6_e7_compare.png filter=lfs diff=lfs merge=lfs -text +WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s7_e8_compare.png filter=lfs diff=lfs merge=lfs -text diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..81628fcb0171d9fd7c06d6b2de3c630ee422525b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "python-envs.defaultEnvManager": "ms-python.python:conda", + "python-envs.defaultPackageManager": "ms-python.python:conda" +} \ No newline at end of file diff --git a/WWFDiff-PU/.gitignore b/WWFDiff-PU/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c039d72230e584066049a32a30f4d15a4af53062 --- /dev/null +++ b/WWFDiff-PU/.gitignore @@ -0,0 +1,7 @@ +tmp/** +data/** +test/** +article/** +article_old/** +article_old2/** +log/** diff --git a/WWFDiff-PU/article/load_article_data.py b/WWFDiff-PU/article/load_article_data.py new file mode 100644 index 0000000000000000000000000000000000000000..a2f20b02789d5d5e0bae268f7817a44487e87048 --- /dev/null +++ b/WWFDiff-PU/article/load_article_data.py @@ -0,0 +1,276 @@ +import scipy.io as sio +import torch +from spectral.io import envi +import numpy as np + +def pi_formatter(x, pos): + k = x / np.pi + + # 0 + if np.isclose(k, 0): + return "0" + + # 接近整数倍 π + if np.isclose(k, round(k)): + k_int = int(round(k)) + if k_int == 1: + return r"$\pi$" + elif k_int == -1: + return r"$-\pi$" + else: + return rf"${k_int}\pi$" + + # 非整数倍:显示数值(可改精度) + return rf"${x:.2f}$" + +def _to_numpy_2d(x: torch.Tensor): + return x.detach().cpu().squeeze().numpy() + + +def load_article_data(): + # gt + gt_mat_path = r"data/gt/gt.mat" + gt_mat = sio.loadmat(gt_mat_path)['gt'] + + # keys: wrapped, gt_unwrapped, pred_unwrapped, diff_unwrapped + #dlpu + dlpu_pred_batch_path = "data/dlpu/samples_0_1.pt" + dlpu_pred_batch_pt = torch.load(dlpu_pred_batch_path) + dlpu_pred = dlpu_pred_batch_pt['pred_unwrapped'] + dlpu_pred = _to_numpy_2d(dlpu_pred) + # dlpu_diff = gt_mat - _to_numpy_2d(dlpu_pred) + + #punet + punet_pred_batch_path = "data/punet/samples_0_1.pt" + punet_pred_batch_pt = torch.load(punet_pred_batch_path) + punet_pred = punet_pred_batch_pt['pred_unwrapped'] + # punet_diff = gt_mat - _to_numpy_2d(punet_pred) + punet_pred = _to_numpy_2d(punet_pred) + + #restormer + restormer_pred_batch_path = "data/restormer/samples_0_1.pt" + restormer_pred_batch_pt = torch.load(restormer_pred_batch_path) + restormer_pred = restormer_pred_batch_pt['pred_unwrapped'] + # restormer_diff = gt_mat - _to_numpy_2d(restormer_pred) + restormer_pred = _to_numpy_2d(restormer_pred) + + #snaphu + snaphu_pred_path = "data/snaphu/000001.hdr" + snaphu_mat = envi.open(snaphu_pred_path) + snaphu_pred = snaphu_mat.load()[:,:,0].squeeze(-1) + + #sqd_lstm + sqd_lstm_pred_batch_path = "data/sqd_lstm/samples_0_1.pt" + sqd_lstm_pred_batch_pt = torch.load(sqd_lstm_pred_batch_path) + sqd_lstm_pred = sqd_lstm_pred_batch_pt['pred_unwrapped'] + # sqd_lstm_diff = gt_mat - _to_numpy_2d(sqd_lstm_pred) + sqd_lstm_pred = _to_numpy_2d(sqd_lstm_pred) + + #u3net + u3net_pred_batch_path = "data/u3net/samples_0_1.pt" + u3net_pred_batch_pt = torch.load(u3net_pred_batch_path) + u3net_pred = u3net_pred_batch_pt['pred_unwrapped'] + # u3net_diff = gt_mat - _to_numpy_2d(u3net_pred) + u3net_pred = _to_numpy_2d(u3net_pred) + + #uformer + uformer_pred_batch_path = "data/uformer/samples_0_1.pt" + uformer_pred_batch_pt = torch.load(uformer_pred_batch_path) + uformer_pred = uformer_pred_batch_pt['pred_unwrapped'] + # uformer_diff = gt_mat - _to_numpy_2d(uformer_pred) + uformer_pred = _to_numpy_2d(uformer_pred) + + #ours + ours_pred_batch_path = "data/ours/samples_0_1.pt" + ours_pred_batch_pt = torch.load(ours_pred_batch_path) + ours_pred = ours_pred_batch_pt['pred_unwrapped'] + # ours_diff = gt_mat - _to_numpy_2d(ours_pred) + ours_pred = _to_numpy_2d(ours_pred) + + return { + "gt": gt_mat, + "dlpu_pred": dlpu_pred, + "punet_pred": punet_pred, + "restormer_pred": restormer_pred, + "snaphu_pred": snaphu_pred, + "sqd_lstm_pred": sqd_lstm_pred, + "u3net_pred": u3net_pred, + "uformer_pred": uformer_pred, + "ours_pred": ours_pred, + } + +def load_article_data_dlpu(): + # gt + gt_mat_path = r"data_dlpu/gt/gt.mat" + gt_mat = sio.loadmat(gt_mat_path)['output'] + + # keys: wrapped, gt_unwrapped, pred_unwrapped, diff_unwrapped + #dlpu + dlpu_pred_batch_path = "data_dlpu/dlpu/samples_0_1.pt" + dlpu_pred_batch_pt = torch.load(dlpu_pred_batch_path) + dlpu_pred = dlpu_pred_batch_pt['pred_unwrapped'] + dlpu_pred = _to_numpy_2d(dlpu_pred) + # dlpu_diff = gt_mat - _to_numpy_2d(dlpu_pred) + + #punet + punet_pred_batch_path = "data_dlpu/punet/samples_0_1.pt" + punet_pred_batch_pt = torch.load(punet_pred_batch_path) + punet_pred = punet_pred_batch_pt['pred_unwrapped'] + # punet_diff = gt_mat - _to_numpy_2d(punet_pred) + punet_pred = _to_numpy_2d(punet_pred) + + #restormer + restormer_pred_batch_path = "data_dlpu/restormer/samples_0_1.pt" + restormer_pred_batch_pt = torch.load(restormer_pred_batch_path) + restormer_pred = restormer_pred_batch_pt['pred_unwrapped'] + # restormer_diff = gt_mat - _to_numpy_2d(restormer_pred) + restormer_pred = _to_numpy_2d(restormer_pred) + + #snaphu + snaphu_pred_path = "data_dlpu/snaphu/000001.hdr" + snaphu_mat = envi.open(snaphu_pred_path) + snaphu_pred = snaphu_mat.load()[:,:,0].squeeze(-1) + + #sqd_lstm + sqd_lstm_pred_batch_path = "data_dlpu/sqd_lstm/samples_0_1.pt" + sqd_lstm_pred_batch_pt = torch.load(sqd_lstm_pred_batch_path) + sqd_lstm_pred = sqd_lstm_pred_batch_pt['pred_unwrapped'] + # sqd_lstm_diff = gt_mat - _to_numpy_2d(sqd_lstm_pred) + sqd_lstm_pred = _to_numpy_2d(sqd_lstm_pred) + + #u3net + u3net_pred_batch_path = "data_dlpu/u3net/samples_0_1.pt" + u3net_pred_batch_pt = torch.load(u3net_pred_batch_path) + u3net_pred = u3net_pred_batch_pt['pred_unwrapped'] + # u3net_diff = gt_mat - _to_numpy_2d(u3net_pred) + u3net_pred = _to_numpy_2d(u3net_pred) + + #uformer + uformer_pred_batch_path = "data_dlpu/uformer/samples_0_1.pt" + uformer_pred_batch_pt = torch.load(uformer_pred_batch_path) + uformer_pred = uformer_pred_batch_pt['pred_unwrapped'] + # uformer_diff = gt_mat - _to_numpy_2d(uformer_pred) + uformer_pred = _to_numpy_2d(uformer_pred) + + #ours + ours_pred_batch_path = "data_dlpu/ours/samples_0_1.pt" + ours_pred_batch_pt = torch.load(ours_pred_batch_path) + ours_pred = ours_pred_batch_pt['pred_unwrapped'] + # ours_diff = gt_mat - _to_numpy_2d(ours_pred) + ours_pred = _to_numpy_2d(ours_pred) + + return { + "gt": gt_mat, + "dlpu_pred": dlpu_pred, + "punet_pred": punet_pred, + "restormer_pred": restormer_pred, + "snaphu_pred": snaphu_pred, + "sqd_lstm_pred": sqd_lstm_pred, + "u3net_pred": u3net_pred, + "uformer_pred": uformer_pred, + "ours_pred": ours_pred, + } + + + +def load_article_ours_snr_data(): + #ours + ours_0db_batch_path = "data_snr/ours_snr/0db/samples_0_1.pt" + ours_0db_batch_pt = torch.load(ours_0db_batch_path) + ours_0db = ours_0db_batch_pt['pred_unwrapped'] + ours_pred = _to_numpy_2d(ours_0db) + + ours_5db_batch_path = "data_snr/ours_snr/5db/samples_0_1.pt" + ours_5db_batch_pt = torch.load(ours_5db_batch_path) + ours_5db = ours_5db_batch_pt['pred_unwrapped'] + ours_5db = _to_numpy_2d(ours_5db) + + ours_10db_batch_path = "data_snr/ours_snr/10db/samples_0_1.pt" + ours_10db_batch_pt = torch.load(ours_10db_batch_path) + ours_10db = ours_10db_batch_pt['pred_unwrapped'] + ours_10db = _to_numpy_2d(ours_10db) + + ours_20db_batch_path = "data_snr/ours_snr/20db/samples_0_1.pt" + ours_20db_batch_pt = torch.load(ours_20db_batch_path) + ours_20db = ours_20db_batch_pt['pred_unwrapped'] + ours_20db = _to_numpy_2d(ours_20db) + + ours_30db_batch_path = "data_snr/ours_snr/30db/samples_0_1.pt" + ours_30db_batch_pt = torch.load(ours_30db_batch_path) + ours_30db = ours_30db_batch_pt['pred_unwrapped'] + ours_30db = _to_numpy_2d(ours_30db) + + return { + "0db": ours_pred, + "5db": ours_5db, + "10db": ours_10db, + "20db": ours_20db, + "30db": ours_30db, + } + +def load_article_snr_data(name, snr): + # if name=="dlpu" or name =="restormer" or name=="ours": + # if name=="ours": + # name = "punet" + if name == "snaphu": + snaphu_pred_path = f"data_snr/{name}_snr/{snr}db/000001.hdr" + snaphu_mat = envi.open(snaphu_pred_path) + snaphu_pred = snaphu_mat.load()[:,:,0].squeeze(-1) + return snaphu_pred + elif name == "wrapped": + # wrapped_mat_path = f"data_snr/{name}_snr/{snr}db/wrapped.mat" + # wrapped_mat = sio.loadmat(wrapped_mat_path)['input'] + wrapped_mat_path = f"data_snr/ours_snr/{snr}db/samples_0_1.pt" + pred_batch_pt = torch.load(wrapped_mat_path) + wrapped_mat = pred_batch_pt['wrapped'] + wrapped_mat = _to_numpy_2d(wrapped_mat) + return wrapped_mat + else: + pred_batch_path = f"data_snr/{name}_snr/{snr}db/samples_0_1.pt" + pred_batch_pt = torch.load(pred_batch_path) + pred = pred_batch_pt['pred_unwrapped'] + # pred = _to_numpy_2d(pred) + return pred + +def load_article_data_idx(name, idx): + # if name=="dlpu" or name =="restormer": + # name = "punet" + if name == "wrapped": + wrapped_mat_path = f"data/{name}/00000{idx}.mat" + wrapped_mat = sio.loadmat(wrapped_mat_path)['input'] + return wrapped_mat + elif name == "gt": + wrapped_mat_path = f"data/{name}/00000{idx}.mat" + wrapped_mat = sio.loadmat(wrapped_mat_path)['gt'] + return wrapped_mat + else: + if name == "ours": + pred_batch_path = f"data/{name}/samples_{idx-1}_{idx}.pt" + else: + pred_batch_path = f"data/{name}/samples_{idx*2-2}_{idx*2-1}.pt" + pred_batch_pt = torch.load(pred_batch_path) + pred = pred_batch_pt['pred_unwrapped'] + # pred = _to_numpy_2d(pred) + return pred + + +def load_article_data_dlpu_idx(name, idx): + # if name == "ours": + # name = "punet" + if name == "wrapped": + wrapped_mat_path = f"data_dlpu/{name}/00000{idx}.mat" + wrapped_mat = sio.loadmat(wrapped_mat_path)['input'] + return wrapped_mat + elif name == "gt": + wrapped_mat_path = f"data_dlpu/{name}/00000{idx}.mat" + wrapped_mat = sio.loadmat(wrapped_mat_path)['output'] + return wrapped_mat + else: + if name == "ours": + pred_batch_path = f"data_dlpu/{name}/samples_{idx-1}_{idx}.pt" + else: + pred_batch_path = f"data_dlpu/{name}/samples_{idx*2-2}_{idx*2-1}.pt" + pred_batch_pt = torch.load(pred_batch_path) + pred = pred_batch_pt['pred_unwrapped'] + # pred = _to_numpy_2d(pred) + return pred \ No newline at end of file diff --git a/WWFDiff-PU/assets/.gitkeep b/WWFDiff-PU/assets/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00001.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00001.png new file mode 100644 index 0000000000000000000000000000000000000000..bd78733ffed1ad3ba5e054bff008ac21e9ed85aa --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:805df265525f2ec51d79983c1c0aaaa3b93a74fe83ad7145073d0c4e9f225539 +size 105378 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00002.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00002.png new file mode 100644 index 0000000000000000000000000000000000000000..e6edc5c0076adf6b6b946842aa907934bee2e7fe --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00002.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69165e2b7828ccfa5ca910bf7ee5dc208812cd12b211245a86d706db890d7502 +size 105530 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00003.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00003.png new file mode 100644 index 0000000000000000000000000000000000000000..7ebef2f9baad69da13352676ec02b38de6fdb16b --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00003.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a82913d2fa65f492761bffe95668a6fa3cf7a7d2617b6598709a498d0c561d1 +size 116595 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00004.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00004.png new file mode 100644 index 0000000000000000000000000000000000000000..c75037f48d9663dcf6676cc88513fe2b1e6d3f2b --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00004.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3365312b6ec34175450bc3a644b49c035c49f97550b0dbfffdccb14a6a40470d +size 133692 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00005.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00005.png new file mode 100644 index 0000000000000000000000000000000000000000..df14d26ef9393d2bda7303393db5f1e06304545b --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00005.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11e202a269382e7a00d22186f2df80f45ce444c536f801ec3b74883ebd9b84e8 +size 101760 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00006.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00006.png new file mode 100644 index 0000000000000000000000000000000000000000..9cb9a881018ca43bc12c7ceb1d491a4ad4d574cc --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00006.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebe45551403c106958001dd068eab50ee60b87a1fd260227f4ffbb0966493dc7 +size 122832 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00007.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00007.png new file mode 100644 index 0000000000000000000000000000000000000000..99825a943627c86240fb06a2c4fec8b2b426dd16 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00007.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7161dcb62edd9744dd08bce7bdc14ea6a76d005387a0ae82a87b569a3db6484 +size 130579 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00008.png b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00008.png new file mode 100644 index 0000000000000000000000000000000000000000..1e672bd8f02400d6b26ebd37c074ea6318471e6d --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/raw/sample_00008.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:927ec75563d06a620f5db7e9ba0180d5432a32d44c191d0f1dea18e94634e4a5 +size 122832 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_0_1.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_0_1.pt new file mode 100644 index 0000000000000000000000000000000000000000..6223969d421a9b349437cdd42601159195e76784 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_0_1.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32c19b25d27834ea3bca6b1835b2623e5710d4f08e29410c4e303336d04c2551 +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_1_2.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_1_2.pt new file mode 100644 index 0000000000000000000000000000000000000000..461bc01631afb5734828821bee44aa3905a8493b --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_1_2.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a10f9f4c3c4af90562bdab7b20c75566355fa03589ac217ca89ac236e13008f +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_2_3.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_2_3.pt new file mode 100644 index 0000000000000000000000000000000000000000..4313bf58f236c91a1fd46c524dbf25a0e82c1909 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_2_3.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd2d10823caeb89dc9005d6235f91ea6bf18081b28308f503f7f07a236f63e72 +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_3_4.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_3_4.pt new file mode 100644 index 0000000000000000000000000000000000000000..13a8e83d11a27502caf1890f32a572fef3fbafc8 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_3_4.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:920aff255eecf7987e75115121e762ea622b54dcc70c2050c26326d6529195fb +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_4_5.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_4_5.pt new file mode 100644 index 0000000000000000000000000000000000000000..214fcf71a7415feaa5d96290e822b35f18b906b9 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_4_5.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f9536aae5e4c29452449b8861f3f3d942f603edd4881f2d2e00934d5ed8a9ae +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_5_6.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_5_6.pt new file mode 100644 index 0000000000000000000000000000000000000000..9508fb8a89ecffd8fd568af3020409ba80c5358e --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_5_6.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:766b0b98cd898225abae63c795950b48674aa01cd3cf25f13442ccc6f99c2d7d +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_6_7.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_6_7.pt new file mode 100644 index 0000000000000000000000000000000000000000..3e0e1e7631da0dee8d2f50ba9544c08b04073866 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_6_7.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ae7c4729e4877a4665fcb4bf1f6e0c3be2cb4128debe6948adae8957176842b +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_7_8.pt b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_7_8.pt new file mode 100644 index 0000000000000000000000000000000000000000..b36acbc75a77aaf0fed91291891d3552b37eed4a --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_7_8.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:186b7d2c419804699ad2b5cc255ce9d9ed6a027ba8ca11022cf59e4e9ccc3b2a +size 2100528 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s0_e1_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s0_e1_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..f2309b969d8c69835a9473df3d98385d8efd7f57 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s0_e1_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db9076dd8f8f4dae2dbe9938df4a59f3653f64b45decec9143beda82f706d563 +size 4197100 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s1_e2_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s1_e2_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..475592d59877178956aedd90271a6761cd21610f --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s1_e2_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b17fa7dac898a6f400aa2b85af19e7356b9ec688bcd35425e5c0e90b9259d38 +size 3974525 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s2_e3_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s2_e3_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..96a2505f7be9ed4c5c96fb939230adfbaf673565 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s2_e3_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2137792b7e1546b670a69761be3227bc9ce80a93ac5b2f98554d10e8455270dc +size 4357689 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s3_e4_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s3_e4_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..b43e545a29e167ac70ebb24055533bcb90acae8a --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s3_e4_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5676b04fa6c29491be5788ed411adf054f677f155899c95c9c9ed336e97a2243 +size 4273754 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s4_e5_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s4_e5_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..8ef5cd4d51b10de419f0ef9ea0987e1accd6b86a --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s4_e5_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba1cfb3763739076f82b6751fb69502f1c064880f44143fda0dbea5093945852 +size 3946398 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s5_e6_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s5_e6_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..045d1e54f423c47201d5672e215c058636108cea --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s5_e6_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74646c3d31a26d9293c4d69b0b6f38570a4780c345a9045b2f3e543d521ced06 +size 4209804 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s6_e7_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s6_e7_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..6e466c40452c5dc5c9f80f16b9f25dc678673eab --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s6_e7_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d91184ef2c5e0be63e78a54eb7815cb459ee22e7606acce1734469bd8fb4558 +size 4257339 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s7_e8_compare.png b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s7_e8_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..175f3804b9d476d7c9d55f058d45f09d72ce7cdc --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/98/samples_c0_s7_e8_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcf75118760854e9c5d6bdd57d93ad8061f641a861cca35a9a8e0522efadcfbb +size 4338119 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/epoch_98.pth b/WWFDiff-PU/ckpt/insar-dlpu/epoch_98.pth new file mode 100644 index 0000000000000000000000000000000000000000..81660ea88fb95cd2603fde7b5bfdfc3961196d3f --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/epoch_98.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b1ce804b80a30f8298fde8c6bfc5f11b6ce0be1d3b0e929b3da9cf93f6d47d1 +size 42371037 diff --git a/WWFDiff-PU/ckpt/insar-dlpu/fdu_dlpu_256_big.yaml b/WWFDiff-PU/ckpt/insar-dlpu/fdu_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..107ede9c23a9f0a01ad2478e6889003fa2986ff3 --- /dev/null +++ b/WWFDiff-PU/ckpt/insar-dlpu/fdu_dlpu_256_big.yaml @@ -0,0 +1,89 @@ +seed: 42 + +loss_type: +# name: Pure + name: PureL1 + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 97 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 + batch_size: 16 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 64, 64, 64] + cross_attention_dim: 192 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 + use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00001.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00001.png new file mode 100644 index 0000000000000000000000000000000000000000..db632f3a25301f071ea382dbd7d3f51a5e114f77 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00001.png differ diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00002.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00002.png new file mode 100644 index 0000000000000000000000000000000000000000..041d10f64554256f3db7a819cef90c8800e623d9 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00002.png differ diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00003.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00003.png new file mode 100644 index 0000000000000000000000000000000000000000..6f5fd42ddff5d3377a3e062b6beb5197a2584928 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00003.png differ diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00004.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00004.png new file mode 100644 index 0000000000000000000000000000000000000000..78b74e5aa7a0b6de435383aa82b1820a65428498 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00004.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49308a9e27bdeb987f701427190a4834ced0089b77a859a3133c980ee6d78de7 +size 101396 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00005.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00005.png new file mode 100644 index 0000000000000000000000000000000000000000..01c95630c2e354c7565f536e1ec0023699187e44 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00005.png differ diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00006.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00006.png new file mode 100644 index 0000000000000000000000000000000000000000..ed1d0e8d09a33dbabb94d82401ac03c36f421ffc --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00006.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a8f62b990ad05868e9429a47b8f7f05c124c9e33f0187b5fb8bea8f4994a702 +size 103447 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00007.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00007.png new file mode 100644 index 0000000000000000000000000000000000000000..f39929b96afef017070e41133ce652ea3b3daf3d --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00007.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0949e200ccabd41a89a4dbd9d57c38e82069c53eb2e0434fa2721e899d4079a0 +size 105471 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00008.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00008.png new file mode 100644 index 0000000000000000000000000000000000000000..4f29ca6afeb6a569198e113f7bb3ec7f3c03c81b --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/raw/sample_00008.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc7bb767e151ec2603f3018039e23bf12065cf9befe1999626236b8df51d1ff0 +size 100173 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_0_1.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_0_1.pt new file mode 100644 index 0000000000000000000000000000000000000000..9c907c05e61b864701ad65d817787f11bc5ff8ec --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_0_1.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:012221db1ba6a9a252c9d96da6376c4df36038b3cba8d52de41b3e9b7e314955 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_1_2.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_1_2.pt new file mode 100644 index 0000000000000000000000000000000000000000..b85b42608b2b67656bd3d454b0c8d8364684794d --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_1_2.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ab718cf9099ac3ad33051a7bb0d8704b04ad6304e22eff9d927d5ec0b52db94 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_2_3.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_2_3.pt new file mode 100644 index 0000000000000000000000000000000000000000..5e7c0010b257e380228f0955dbd7aab19a426e36 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_2_3.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5528dd58ff27aba1cb8142ac32e8a82d76c16666df44b6c5c05e31efff293f13 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_3_4.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_3_4.pt new file mode 100644 index 0000000000000000000000000000000000000000..3af454d3b19a2ae59a238ea26def0a466fac2f88 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_3_4.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e90ef95f0eaaf67452dfd0583ad6bf12b17b5f1a36b7c2a50640b2918d21a95 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_4_5.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_4_5.pt new file mode 100644 index 0000000000000000000000000000000000000000..97df12a08f5e3aa1d9d49922660a04e31d222980 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_4_5.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8366bb17b26b475cee02a09dfa8d2186f707793fa0d5ea074cc056d2fa4de67 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_5_6.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_5_6.pt new file mode 100644 index 0000000000000000000000000000000000000000..d4db7f28d703d6d59691df39402da80dc2f0f44a --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_5_6.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87757d72b46eea9af90cf65db3cb14427bb07629da555971fbf1ebb9e5561c7f +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_6_7.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_6_7.pt new file mode 100644 index 0000000000000000000000000000000000000000..39a563ff0b1ced7676f1f0472d2616679efe7e80 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_6_7.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50336b35ef203d2f7c082bb8b329da28febaa3c77a7d756816582a509d06ef50 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_7_8.pt b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_7_8.pt new file mode 100644 index 0000000000000000000000000000000000000000..19392f1770b3d745b3de556814897db85a3cb3fa --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_7_8.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07f728c6998311bbfa0a6ad854e262472d6417a447f2fb939ca568815541af3a +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s0_e1_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s0_e1_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..b9994c5016ef7c77af0198a29b7d6211cb763e24 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s0_e1_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d23e8c13ad7a2045ec5b41311ff80e43a57a8cdf790fe5074acde7cb93f0d95 +size 500082 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s1_e2_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s1_e2_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..b3493203becbd028b3c9b3f6580a1b6763a01ef6 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s1_e2_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcb4677b3a51ae9d0d252860bf5bca4584b160fed50be8fea85fe25b9ced6d8c +size 461798 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s2_e3_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s2_e3_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..3eb6ed4138433f1613f1bcad63201ce618f58f9b --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s2_e3_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a10707f554f8ee096ccacc78300780f5b036421d746ab93c40d6e2e038bcc30 +size 412598 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s3_e4_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s3_e4_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..d9fd793134e83c010ae2abdd6b3ce4f40bb16633 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s3_e4_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9239b2f55d44b8e42fba5dd3946b0e318d4f198b5a57f027ab7dc46fa4433e8 +size 447962 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s4_e5_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s4_e5_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..8011aff1f3d3e8e550fb68f2403b8337b08fb09d --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s4_e5_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8861fabfeb0e0b5f96bfee9f3992bfa2fcc7447fee7e383c4c848fbf5e48e60b +size 414713 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s5_e6_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s5_e6_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..c251c0b015e127971a768af2c5357657dbae732b --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s5_e6_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c229e005700a2fe0bea924beb5d040afb9a1c81f915377a2fd0ce5059153f8c3 +size 503556 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s6_e7_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s6_e7_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..83c359dc56f16ade35a5cc58f59af3dc3dd45acf --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s6_e7_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ee9f50a1bd64cb4c3d5f01237cdebeddef0fba78f56ae587e55cf8dc72f4d24 +size 480420 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s7_e8_compare.png b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s7_e8_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..de8e8c1a4706b3f13d6a0cec2a9f1a418a1cd5cc --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/96/samples_c0_s7_e8_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:542fb4099072b47cc5cf3a98e1614683c29b09bfd16121c24d4fa2dcd0a00454 +size 520038 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/epoch_96.pth b/WWFDiff-PU/ckpt/synpu/dualrc/epoch_96.pth new file mode 100644 index 0000000000000000000000000000000000000000..2d339817ea2cba88933b8757778865e9b7ed3186 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/epoch_96.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c944de9b4b70e0a8c3e888084cf2649f6b8054ba29bb10f06d26c8441f0454db +size 167421582 diff --git a/WWFDiff-PU/ckpt/synpu/dualrc/fdu_synpu_128_big_v2.yaml b/WWFDiff-PU/ckpt/synpu/dualrc/fdu_synpu_128_big_v2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..db84abc918e75c2c282e7bf678497ff2b0294978 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/dualrc/fdu_synpu_128_big_v2.yaml @@ -0,0 +1,124 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigV2 + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNetV1 + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00001.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00001.png new file mode 100644 index 0000000000000000000000000000000000000000..85591a24cb6c365df9eb0b48186becf939afda24 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00001.png differ diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00002.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00002.png new file mode 100644 index 0000000000000000000000000000000000000000..2c390ed80b9e57344680125939bc4d738b7f39d8 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00002.png differ diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00003.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00003.png new file mode 100644 index 0000000000000000000000000000000000000000..60346529a52c33dc16f5e5e2a1238777eda37826 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00003.png differ diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00004.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00004.png new file mode 100644 index 0000000000000000000000000000000000000000..316d130cecd5a0eccb08ffa1d31351a4d7e187fc --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00004.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:402dc7e46738bf7a406082a8897e5dbcfbf8e52faf70afbcc94b90ca71866ab1 +size 101039 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00005.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00005.png new file mode 100644 index 0000000000000000000000000000000000000000..0e8a52b9ce3aaccd30ce22d15b7161fd433d06b4 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00005.png differ diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00006.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00006.png new file mode 100644 index 0000000000000000000000000000000000000000..c1d98d28b0f451b1736d19bc2d704d527661f88a --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00006.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d178d499a7ca26ded8d19b3200dfc5285ff665115a1f0730745c0d7c82ec5736 +size 102819 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00007.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00007.png new file mode 100644 index 0000000000000000000000000000000000000000..a2b966f490f070800f57bc0df8abc114c7be8fc3 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00007.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1990db5b8c91644629711f8c03b07cd29c5974c297eb0231ca70ca1e126e708d +size 104111 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00008.png b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00008.png new file mode 100644 index 0000000000000000000000000000000000000000..2bdd7bba8fc358b5448883fb4f20acba489f9466 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/no/95/raw/sample_00008.png differ diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_0_1.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_0_1.pt new file mode 100644 index 0000000000000000000000000000000000000000..d5ff5bd2ab0a968f4aa7a6ee0c42f8db2562f72e --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_0_1.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:081a8decb34e538f24c07ca431c599f4e912070d73eabfda2ec1a297cf09c118 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_1_2.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_1_2.pt new file mode 100644 index 0000000000000000000000000000000000000000..df685561f2d6a5def31e564491ba9383274fdb00 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_1_2.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a8bdd084850f52a91bc598fd14c30dcb00d091d37b5ee0af62b103409578773 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_2_3.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_2_3.pt new file mode 100644 index 0000000000000000000000000000000000000000..5ee3cb5eab3cb6be8852a6112bef0941694151b8 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_2_3.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8a6f5ad84f3455cefd053ea0bad087b387036a301244de5cbb9da986876fcb6 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_3_4.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_3_4.pt new file mode 100644 index 0000000000000000000000000000000000000000..d44345510a58412fd6707efd82c6d34ea249f945 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_3_4.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8cb3492df2823a110f34c0bc9e47d11b5c58bdc07639b616502b8454ecb3315 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_4_5.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_4_5.pt new file mode 100644 index 0000000000000000000000000000000000000000..124a6f94e23145342b548b8a2510b8216330156f --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_4_5.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b20f0ac1b0ff5497eae09192ed235742e49dbee963c1152e066a76b9153b8f4 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_5_6.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_5_6.pt new file mode 100644 index 0000000000000000000000000000000000000000..41f5610cdf2d89e0521a1caf063756f0648e507c --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_5_6.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:938cfd7619629c6a8555dda5eef7c9f6de111c81bf4962ffb843b4f954e8fb7b +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_6_7.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_6_7.pt new file mode 100644 index 0000000000000000000000000000000000000000..ad69759080fe27cdf0dab89c8e9eae1efdde87f8 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_6_7.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3058cf2472a248371dd763e33b9d70b728cc8c902e7141de9151ee675a420a72 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_7_8.pt b/WWFDiff-PU/ckpt/synpu/no/95/samples_7_8.pt new file mode 100644 index 0000000000000000000000000000000000000000..a15b3e4e5cc9b4e64e1c67dfdee6517983bf092f --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_7_8.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:952378283e8a208d4441104bed39eeeffa93518ee8412b711f629152e39e96f0 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s0_e1_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s0_e1_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..88dc89f39986d89b90757ce6938dd1c39ae9791c --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s0_e1_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02a143d31eedb0c69e75d9e26fd6cf981092ec9c2e4e7aeb1098114cee24aa46 +size 528279 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s1_e2_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s1_e2_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..1f59ab3df9b63b906b5e90fa5d1a45ec449b1912 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s1_e2_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62b5c197b0d4f6d122d78e4da63d9c0f8f3b39f8ea39dba95d004903a5af5124 +size 447985 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s2_e3_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s2_e3_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..da2e0a236176a31a4c8427f19dd67d9e620007ff --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s2_e3_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d379d54af817e19a185155f3ec9b2bde73d5cd5c00a885e5b5111cbfd38a020 +size 440991 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s3_e4_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s3_e4_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..b75d43fcaadd4dad8f1548ab3fa9ea26c0ddb524 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s3_e4_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23cdc40f7f4f5743051da13fecef1d4077c8c08118fed64070b79b27ce4ffea1 +size 436079 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s4_e5_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s4_e5_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..ada1f13ef030f18f6b19a9ee4f267a96c9ed4f0b --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s4_e5_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bc7926a451cc13f46224d1bce228649e1a01c77749d5b24381b2496fe7cee0a +size 431738 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s5_e6_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s5_e6_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..85039e4ccc0c30a926d76f9251740751c77392aa --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s5_e6_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57d4ece3b9eced000053cbbb1ee2e2ae90774a9d5cc04d379408d4b6545cd01d +size 498961 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s6_e7_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s6_e7_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..bce34b763d12a5ee0b805340c9e709639dfb5e6b --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s6_e7_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:479f6259226e515598bea1b30f5cc9e3e3cb1aa9f1972495af3ed3b44bec52c3 +size 488624 diff --git a/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s7_e8_compare.png b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s7_e8_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..8167d703568eaec91bb7c704a6d28362c6f79f1b --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/95/samples_c0_s7_e8_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73ee511305a68da7ff583e4412d3c6090a000ec38601f9944927839b280bfdd0 +size 514385 diff --git a/WWFDiff-PU/ckpt/synpu/no/epoch_95.pth b/WWFDiff-PU/ckpt/synpu/no/epoch_95.pth new file mode 100644 index 0000000000000000000000000000000000000000..c31bdea10174cfae626343630ba72dcabeebf711 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/epoch_95.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:945b980464f8e57a05ad07b72ba11c41c8951582c34b70ed89ea22162dcec11f +size 167407758 diff --git a/WWFDiff-PU/ckpt/synpu/no/fdu_synpu_128_big_v3.yaml b/WWFDiff-PU/ckpt/synpu/no/fdu_synpu_128_big_v3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..191acd95e36f7e553d5bae9fc130831d486d37ff --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/no/fdu_synpu_128_big_v3.yaml @@ -0,0 +1,125 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigV3 + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNetV1 + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 +# conditioning_channels: 2 + conditioning_channels: 1 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00001.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00001.png new file mode 100644 index 0000000000000000000000000000000000000000..7c306c1444692accffefb28b0ddf24257dca3fe0 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00001.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00002.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00002.png new file mode 100644 index 0000000000000000000000000000000000000000..0d6f8801a7d362eb117c4fade215b057fb030371 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00002.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00003.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00003.png new file mode 100644 index 0000000000000000000000000000000000000000..5b86900cb303aebfd34dbfc097f170d7a81d1894 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00003.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00004.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00004.png new file mode 100644 index 0000000000000000000000000000000000000000..1746e2369ebe6e81be569b7bcd0815265c927d8f --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00004.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dec1f44e283838108b67ee5976d01b3051d885a431150cf265a9e358244b4700 +size 100430 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00005.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00005.png new file mode 100644 index 0000000000000000000000000000000000000000..b4058c5d0197e05190553ab263239b8241a68049 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00005.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00006.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00006.png new file mode 100644 index 0000000000000000000000000000000000000000..bd63fdb42e7c7ce4a1b9876ed587be944789541c --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00006.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f46540d6ccfad64ac6eda27f59df1a1edee04621e583c93e596afa7021c0e5ff +size 102346 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00007.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00007.png new file mode 100644 index 0000000000000000000000000000000000000000..b744438e7cb4721a124c6f142c32dc2ac04727c2 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00007.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6342ed558f4911a5176f6c28a5528493bf0a9cd76b3846f125ac96f2bc08dbb7 +size 104355 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00008.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00008.png new file mode 100644 index 0000000000000000000000000000000000000000..82c5f20ca7a38695b2ed4ae301360abebf2b8e70 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/raw/sample_00008.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_0_1.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_0_1.pt new file mode 100644 index 0000000000000000000000000000000000000000..02a2fe1aec6b0618278e144a5b2b4c672b38d243 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_0_1.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c75d2ed31b644a6137c139e08105183a76c087247047d1adbe2e15a50750282 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_1_2.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_1_2.pt new file mode 100644 index 0000000000000000000000000000000000000000..65e685a5521ad98845d2a758aa074ff3a5de9c53 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_1_2.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5931622ec4c09b8f95ca497b878cef843cf575b388aa1161bda63731d155931 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_2_3.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_2_3.pt new file mode 100644 index 0000000000000000000000000000000000000000..02da640c0fbc18daf79b35ad8ef24d25b7e493c7 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_2_3.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7b87814102d4fff7fe0397ca6af44408b885c52161902c4e102fbcc121407d6 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_3_4.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_3_4.pt new file mode 100644 index 0000000000000000000000000000000000000000..7f7a78117120539a5e19a1bc53ad8027200e22b5 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_3_4.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91fbe94d5e46a00e60b24aec2cb2d7e84183ab3f6b85e032af4ed2e60f046915 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_4_5.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_4_5.pt new file mode 100644 index 0000000000000000000000000000000000000000..0f31c2c46a88f818cc8f751284a1a305c20953bd --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_4_5.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f191b56e808dce8531e401a7958326376151db0bd02b3b6ae72834cafb35446c +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_5_6.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_5_6.pt new file mode 100644 index 0000000000000000000000000000000000000000..81bf16339f74338f95c0a1e86e1a7d51816c6e79 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_5_6.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e59905a7393bbe845766d2154f31ede38158b95f19dc4062723972bf9592b77e +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_6_7.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_6_7.pt new file mode 100644 index 0000000000000000000000000000000000000000..b4cef69a4b7cca99f0c9c625dc72922f1337d3e5 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_6_7.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e499423b3a9da514480a5e04e2eb21cb3a382c1503ba0ac3ca4f28a89924e81d +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_7_8.pt b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_7_8.pt new file mode 100644 index 0000000000000000000000000000000000000000..c9575cf32efb7c8bc1f3ecf5cd0e2b2497a00c6d --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_7_8.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ea724ec67547b7053ee5e9f29c9104cd0a8426698887f4788553fbf5010e8c7 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s0_e1_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s0_e1_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..fb48acd1348e191902ac8267bac83b40b2ca06bb --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s0_e1_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7bb50e4da967f70735887ae6fb7806d33f991523d3b9ca0aafbe4fc35d5a0df +size 486468 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s1_e2_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s1_e2_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..932bcb1f01363c644c43e6c5be14464271768b07 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s1_e2_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e038cc4f91aa00891911fc99324b2438ee9b23c033a3d6fded9baef192a18b5 +size 455581 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s2_e3_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s2_e3_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..4e377ea7d594ce7521180e392eb0ade7d8439ce7 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s2_e3_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8354b47bda90ade300e42218a8c5a79a82b236604fb501dcda2d8a56c484897a +size 404474 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s3_e4_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s3_e4_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..b12c311492d78e7eecf8e931769b769588883968 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s3_e4_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ce47c9846e560cb175ada221ec9fd3d060515c4b9ca3db93d58af34de8c2a72 +size 474406 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s4_e5_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s4_e5_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..5196a0b3ec5be5d4154f3a5500d219af7c1732d0 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s4_e5_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b433eec4346f0bb046373216cbc63fda9082f5fda847fb71c7b2d0b13dcd05c +size 428275 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s5_e6_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s5_e6_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..ba03a93af2c4b62b980be83efe5a2be158ac3375 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s5_e6_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e4ffdde5b47afd7c00f03b11e6665b2e0b6b5701554c32dd6d71e067e17babd +size 510920 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s6_e7_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s6_e7_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..a14b00664b408bf237af41c6ed4977685768744a --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s6_e7_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20436846d42ecd4e6841d18eeb8b0b60b49dd97bb577867c8625097e01fabd52 +size 468104 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s7_e8_compare.png b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s7_e8_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..7bce93192b5baa54f8b1a58b0f1c667b921ae199 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/94/samples_c0_s7_e8_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f257c6aeccb8733a43962fe7baa8f01862efec591e54f5ac0cfcf851ae0ba5c +size 532695 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/epoch_94.pth b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/epoch_94.pth new file mode 100644 index 0000000000000000000000000000000000000000..9b19d9220d99ed5c0ccfd932d1a9392cbc78d2ab --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/epoch_94.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9612ac294aac86298a41f35bfe695de76e29c14c0a579091e54b9b6babd30658 +size 167421582 diff --git a/WWFDiff-PU/ckpt/synpu/wwf+dualrc/fdu_synpu_128_big.yaml b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/fdu_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..029a7b29e40dd507ede4364ee29627fda414ed3d --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf+dualrc/fdu_synpu_128_big.yaml @@ -0,0 +1,123 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: fasle + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00001.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00001.png new file mode 100644 index 0000000000000000000000000000000000000000..57b9ef22e1e4a15a152167ca1380fa11930caec1 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00001.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00002.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00002.png new file mode 100644 index 0000000000000000000000000000000000000000..1a0691d571202362f23cb5271122fbdf45c275ee Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00002.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00003.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00003.png new file mode 100644 index 0000000000000000000000000000000000000000..4f32c731d6d3841cb3478e9a15812232e20c1757 Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00003.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00004.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00004.png new file mode 100644 index 0000000000000000000000000000000000000000..081cdb1b3bf3837ca874c479d74526903282eac9 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00004.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:383b5a8e4f5a0a8c4e241f61c45d5c7d046cd32a2299b587658c60b5cc9af102 +size 100368 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00005.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00005.png new file mode 100644 index 0000000000000000000000000000000000000000..3271e6c768fb898c89f1e99bdbd3ce3a10bbeb4d Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00005.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00006.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00006.png new file mode 100644 index 0000000000000000000000000000000000000000..1cf7de10afa9a069df90afc160b1b3a19beb39d1 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00006.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:823faf45e2210da992cb72da571ad91ee773d65296636da25c8992b7ef6c693c +size 102718 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00007.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00007.png new file mode 100644 index 0000000000000000000000000000000000000000..5335906a8c1105de6954bb48127b3dada290a693 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00007.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8958b6950ddd6adf8d71741bc8068876c905f125aaac7eb9f37fe57f36e2730e +size 104753 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00008.png b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00008.png new file mode 100644 index 0000000000000000000000000000000000000000..94f4b087a552e3b57f81daa4a7f45bb22a6e177e Binary files /dev/null and b/WWFDiff-PU/ckpt/synpu/wwf/98/raw/sample_00008.png differ diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_0_1.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_0_1.pt new file mode 100644 index 0000000000000000000000000000000000000000..7b45f3668d3ad96c65abfd07ed58903a4b0b2f14 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_0_1.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:562d54de7b8f1f93e2a9cc0fc1dba06fb1d43204ad480bc715f590cc94447166 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_1_2.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_1_2.pt new file mode 100644 index 0000000000000000000000000000000000000000..0ebfedf5c83be20a3efad7938bbbe501dac21f27 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_1_2.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad5619167413698d4d51c422d7eb45be8f807160e59aad61b737be44a69fe55b +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_2_3.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_2_3.pt new file mode 100644 index 0000000000000000000000000000000000000000..cfb20bfb975dd6d371551c8b7d50e56f4bc421f1 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_2_3.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5c80ea1d3ca3d2202c7cfc51824f641f513fa9c99683deb534f3f43910482f7 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_3_4.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_3_4.pt new file mode 100644 index 0000000000000000000000000000000000000000..1ede2f9d75c591fb2625efeafaea1a0df23daa40 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_3_4.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8655bc7653a63f5fc5403a775dd5591b23cea7cc8bfbe298b2ed5f04a3dff27 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_4_5.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_4_5.pt new file mode 100644 index 0000000000000000000000000000000000000000..e392849947c7eb5c0fbe8fd90f727b9794bc3975 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_4_5.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:818d39bfc19fea72a3fa63a3b68200d2eba1e8c03e3d6183654bcf6f442457c0 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_5_6.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_5_6.pt new file mode 100644 index 0000000000000000000000000000000000000000..ce7505aa6e651c97bdee1fe45c8dea632824fadb --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_5_6.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aefbc9dad15ba1ceb523d6a0824d5e255262e864fcd99146e47948b1e7f938ce +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_6_7.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_6_7.pt new file mode 100644 index 0000000000000000000000000000000000000000..68862a570911ea3871c5af23141f396a0d241ba9 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_6_7.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf4f0c95f9359c7a39c468426f2b58dbf4eff9e5decc112f6a6c632339f70687 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_7_8.pt b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_7_8.pt new file mode 100644 index 0000000000000000000000000000000000000000..4e1bb5e596a39d9eba456d0b4f4e0c1a1c86f32d --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_7_8.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aff8de2f4091e806d84bf8d3114ca9de8e1352941367d9b0dda48719ea7d9fa0 +size 527600 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s0_e1_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s0_e1_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..79f291b89dc193094df8a659f0ca7159407228e0 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s0_e1_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d4a3811f7a47f8dfbc889c43096325b578d92ff4605837a49074e5b6fd93026 +size 498287 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s1_e2_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s1_e2_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..579bed6e375128873ce2e84803975ff00114000e --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s1_e2_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1be8237bf65f7d7d35ac88ae00f2352a350273e5b027e88e4fa654459f5135b +size 455649 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s2_e3_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s2_e3_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..d11797ed9afab99816a669dfbaf4f688229315fc --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s2_e3_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f416c3c87ae3a52ab3540eba5f71f294a9384a07a3e7eeaefa83c54fcabaafc +size 431887 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s3_e4_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s3_e4_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..a1bfa5a12f1d8acba1ad6a28d5428994f4d8d935 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s3_e4_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5669b2f5f9b0cb7a9b68ef8a8db46f11c84a4a4d113e15fcbf6b45a8a5131433 +size 477155 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s4_e5_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s4_e5_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..f7a108205487c39c0e5a69e6226eb7f5e2970743 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s4_e5_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cbf15d82b9cf52e9c1d06bc9b4986c583a2e37195aab3a814df85617efbf72b +size 418057 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s5_e6_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s5_e6_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..5ce9440e47dd17b40de85071423bb5ecdfb1ca76 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s5_e6_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de6bd85cfd6f6fffed908e3f3f0409a3e08911915971e5c8b0f5475b99216c0c +size 496756 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s6_e7_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s6_e7_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..59e94b11d4ef9f58dd72feee136b16b27352288f --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s6_e7_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ddd7b1d0724a4a0598f5abe0a66bca5de88603bbafcaa9161b2134b04cace4b +size 475820 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s7_e8_compare.png b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s7_e8_compare.png new file mode 100644 index 0000000000000000000000000000000000000000..61a509dd04da2a2956202da79050a6626a45442b --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/98/samples_c0_s7_e8_compare.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10569d1312c56437a820e33091de34730b1d67f1586cdb241132b1f61770efe8 +size 516081 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/epoch_98.pth b/WWFDiff-PU/ckpt/synpu/wwf/epoch_98.pth new file mode 100644 index 0000000000000000000000000000000000000000..fcfc49fe42ee6009bf39dfbdaa69dc8b77092ad0 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/epoch_98.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:736466da72e4306431ce1bf61fe2860092149aef85434865725bd27d035778b5 +size 167407758 diff --git a/WWFDiff-PU/ckpt/synpu/wwf/fdu_synpu_128_big_v1.yaml b/WWFDiff-PU/ckpt/synpu/wwf/fdu_synpu_128_big_v1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f0f5dd0de75b695f89cac1ef37871b142f106b5 --- /dev/null +++ b/WWFDiff-PU/ckpt/synpu/wwf/fdu_synpu_128_big_v1.yaml @@ -0,0 +1,126 @@ +seed: 42 + +loss_type: +# name: MchLoss + # name: Pure + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigV1 + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 +# conditioning_channels: 2 + conditioning_channels: 1 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/.gitkeep b/WWFDiff-PU/configs/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/WWFDiff-PU/configs/dlpu_dlpu_256_big.yaml b/WWFDiff-PU/configs/dlpu_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eae9f160568493ee34762077b67a5b6899878739 --- /dev/null +++ b/WWFDiff-PU/configs/dlpu_dlpu_256_big.yaml @@ -0,0 +1,86 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: + name: PUNetMeter + +mmodel: + name: DLPUMModel + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 0 + std: 0 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 4 +# batch_size: 32 + batch_size: 16 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false +# snapshot_val: true + snapshot_val: false +# snapshot_val_freq: 100 + snapshot_val_freq: 20 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 0.1 + +model: + name: DLPU +# sample_size: 128 + sample_size: 256 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false diff --git a/WWFDiff-PU/configs/dlpu_noise_synpu_128_big.yaml b/WWFDiff-PU/configs/dlpu_noise_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6a80dfb250032c970c91d52fd37b949a99a1acf2 --- /dev/null +++ b/WWFDiff-PU/configs/dlpu_noise_synpu_128_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: + name: PUNetMeter + +mmodel: + name: DLPUMModel + +data: + name: SyntheticPUMat128BigNoise + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 + noise_snr: 0 +# noise_snr: 5 +# noise_snr: 20 +# noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 8 +# batch_size: 128 +# batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: DLPU + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/dlpu_noise_synpu_128_mid.yaml b/WWFDiff-PU/configs/dlpu_noise_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..582d98583c1c00dc3aad324841ec40e3cbfbbfec --- /dev/null +++ b/WWFDiff-PU/configs/dlpu_noise_synpu_128_mid.yaml @@ -0,0 +1,82 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: + name: DLPUMeter + +mmodel: + name: DLPUMModel + +data: + name: SyntheticPUMat128Noise + image_size: 128 + color_channels: 1 + num_workers: 4 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_val: false + snapshot_val_freq: 50 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: DLPU + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/dlpu_synpu_128_big.yaml b/WWFDiff-PU/configs/dlpu_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c1d5bad09c1722dc0bf006ce45bf195c6f8a5d8e --- /dev/null +++ b/WWFDiff-PU/configs/dlpu_synpu_128_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: + name: PUNetMeter + +mmodel: + name: DLPUMModel + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 + noise_snr: 30 +# noise_snr: 5 +# noise_snr: 20 +# noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 8 +# batch_size: 128 +# batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: DLPU + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/dlpu_synpu_128_mid.yaml b/WWFDiff-PU/configs/dlpu_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c9c2861ed1f52a826e9a155dcb85bcfb16ee197f --- /dev/null +++ b/WWFDiff-PU/configs/dlpu_synpu_128_mid.yaml @@ -0,0 +1,83 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: DLPULoss + +meter: + name: DLPUMeter + +mmodel: + name: DLPUMModel + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav + image_size: 128 + color_channels: 1 + num_workers: 4 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 2 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: DLPU + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/dynamic_io.py b/WWFDiff-PU/configs/dynamic_io.py new file mode 100644 index 0000000000000000000000000000000000000000..fb4890fca97d7c40331e9645527f185e92ed4a7a --- /dev/null +++ b/WWFDiff-PU/configs/dynamic_io.py @@ -0,0 +1,389 @@ +import abc +import os +import glob +import re +import ml_collections +from functools import cached_property + + +class DynamicIOConfig(ml_collections.ConfigDict): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + @property + def out_asset_prefix(self): + return "assets" + + @property + def out_sample_suffix(self): + return "sample" + + @property + def out_val_suffix(self): + return "val" + + @property + def out_stat_suffix(self): + return "stat" + + @property + def out_sample_raw_suffix(self): + return "raw" + + @property + def out_sample_filename_prefix(self): + return 'sample' + + @property + def out_val_filename_prefix(self): + return 'val' + + @property + def out_ckpt_suffix(self): + return 'ckpt' + + @property + def out_hf_ckpt_suffix(self): + return 'hf_ckpt' + + @property + def out_vae_hf_ckpt_suffix(self): + return 'vae_hf_ckpt' + + @property + def out_ckpt_filename_prefix(self): + return 'epoch' + + @property + def tensorboard_path_suffix(self): + return 'tb' + + @property + def wandb_local_path_suffix(self): + return 'wandb' + + @property + @abc.abstractmethod + def in_dataset_path(self): + pass + + @property + @abc.abstractmethod + def in_dataset_stat_path(self): + pass + + @property + @abc.abstractmethod + def in_raw_dataset_path(self): + pass + + @property + @abc.abstractmethod + def out_asset_suffix(self): + pass + + @property + @abc.abstractmethod + def use_tensorboard(self): + pass + + @property + @abc.abstractmethod + def use_wandb(self): + pass + + @property + @abc.abstractmethod + def save_pth_to_wandb(self): + pass + + @cached_property + def out_ckpt_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_ckpt_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @cached_property + def out_hf_ckpt_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_hf_ckpt_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @cached_property + def out_vae_hf_ckpt_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_vae_hf_ckpt_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @property + def out_sample_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_sample_suffix, + str(self.sampling_epoch)) + if not os.path.exists(path): + os.makedirs(path) + return path + + @property + def out_val_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_val_suffix, + str(self.sampling_epoch)) + if not os.path.exists(path): + os.makedirs(path) + return path + + @property + def out_raw_sample_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_sample_suffix, + str(self.sampling_epoch), self.out_sample_raw_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @property + def out_raw_val_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_val_suffix, + str(self.sampling_epoch), self.out_sample_raw_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @cached_property + def out_stat_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.out_stat_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @cached_property + def out_fid_stat_path(self): + path = os.path.join(self.out_stat_path, 'fid_stats.npz') + if not os.path.exists(path): + os.makedirs(os.path.dirname(path), exist_ok=True) + return path + + @cached_property + def out_fid_png_path(self): + path = os.path.join(self.out_stat_path, 'fid_png') + if not os.path.exists(path): + os.makedirs(path) + return path + + @cached_property + def tensorboard_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.tensorboard_path_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @cached_property + def wandb_local_path(self): + path = os.path.join(self.out_asset_prefix, self.out_asset_suffix, self.wandb_local_path_suffix) + if not os.path.exists(path): + os.makedirs(path) + return path + + @staticmethod + def get_epoch_num(filename): + match = re.search(r'_(\d+)\.pth', filename) + return int(match.group(1)) if match else 0 + + @property + def latest_checkpoint_epoch(self): + pattern = os.path.join(self.out_ckpt_path, f'{self.out_ckpt_filename_prefix}_*.pth') + ckpt_files = glob.glob(pattern) + if not ckpt_files: + return None + latest_ckpt_file = max(ckpt_files, key=self.get_epoch_num) + epoch_num = self.get_epoch_num(latest_ckpt_file) + return epoch_num + + @property + def latest_checkpoint_file_path(self): + if self.latest_checkpoint_epoch is None: + return None + return os.path.join(self.out_ckpt_path, f'{self.out_ckpt_filename_prefix}_{self.latest_checkpoint_epoch}.pth') + + @property + def sampling_epoch(self): + if self.sampling_from_epoch is not None: + return self.sampling_from_epoch + else: + return self.latest_checkpoint_epoch + + @property + def sampling_ckpt_file_path(self): + if self.sampling_from_epoch is not None: + return os.path.join(self.out_ckpt_path, f'{self.out_ckpt_filename_prefix}_{self.sampling_from_epoch}.pth') + else: + return self.latest_checkpoint_file_path + + @property + def val_ckpt_file_path(self): + if self.sampling_from_epoch is not None: + return os.path.join(self.out_ckpt_path, f'{self.out_ckpt_filename_prefix}_{self.sampling_from_epoch}.pth') + else: + return self.latest_checkpoint_file_path + + def generated_sample_pt_file_path(self, start_image_count, end_image_count): + if self.latest_generated_sample_num is None: + return None + return os.path.join(self.out_sample_path, + f"{self.out_sample_filename_prefix}s_{start_image_count}_{end_image_count}.pt") + + def generated_compare_pt_file_path(self, start_image_count, end_image_count): + if self.latest_generated_sample_num is None: + return None + return os.path.join(self.out_sample_path, + f"{self.out_sample_filename_prefix}s_{start_image_count}_{end_image_count}.pt") + + def generated_val_batch_pt_file_path(self, batch_size, batch_idx, start_image_count, end_image_count): + return os.path.join(self.out_val_path, f"val_b{batch_size}_batch_{batch_idx}_{start_image_count+1}_{end_image_count}.pt") + + def generated_val_pt_file_path(self, epoch): + return os.path.join(self.out_val_path, f"val_epoch{epoch}.pt") + + # def val_pt_file_path(self, epoch): + # # if self.latest_generated_val_num is None: + # # return None + # return os.path.join(self.out_val_path, f"val_{epoch}.pt") + + def generated_sample_png_file_path(self, image_count): + if self.latest_generated_sample_num is None: + return None + return os.path.join(self.out_raw_sample_path, f"{self.out_sample_filename_prefix}_{image_count:05d}.png") + + def generated_compare_png_file_path(self, start_image_count, end_image_count, current_step): + if self.latest_generated_sample_num is None: + return None + return os.path.join(self.out_sample_path, f"{self.out_sample_filename_prefix}s_c{current_step}_s{start_image_count}_e{end_image_count}_compare.png") + + def generated_val_png_file_path(self, image_count): + if self.latest_generated_val_num is None: + return None + return os.path.join(self.out_raw_val_path, f"{self.out_val_filename_prefix}_{image_count:05d}.png") + + def sample_pdf_file_path(self, step): + return os.path.join(self.out_sample_path, f"{self.out_sample_filename_prefix}_{step}.pdf") + + def generated_sample_pdf_file_path(self, start_image_count, end_image_count, step): + if self.latest_generated_sample_num is None: + return None + return os.path.join(self.out_sample_path, + f"{self.out_sample_filename_prefix}s_{start_image_count}_{end_image_count}_{step}.pdf") + + def generated_val_pdf_file_path(self, start_image_count, end_image_count, step): + if self.latest_generated_val_num is None: + return None + return os.path.join(self.out_val_path, + f"{self.out_val_filename_prefix}s_{start_image_count}_{end_image_count}_{step}.pdf") + + @staticmethod + def get_sample_num(filename): + match = re.search(r'_(\d+)\.png', filename) + return int(match.group(1)) if match else 0 + + @property + def latest_generated_sample_num(self): + pattern = os.path.join(self.out_raw_sample_path, f'{self.out_sample_filename_prefix}_*.png') + sample_files = glob.glob(pattern) + if not sample_files: + return 0 + latest_sample_file = max(sample_files, key=self.get_sample_num) + latest_sample_num = self.get_sample_num(latest_sample_file) + return latest_sample_num + + @property + def latest_generated_val_num(self): + pattern = os.path.join(self.out_raw_val_path, f'{self.out_val_filename_prefix}_*.png') + sample_files = glob.glob(pattern) + if not sample_files: + return 0 + latest_sample_file = max(sample_files, key=self.get_sample_num) + latest_sample_num = self.get_sample_num(latest_sample_file) + return latest_sample_num + + @property + def latest_generated_sample_file_path(self): + if self.latest_generated_sample_num is None: + return None + return os.path.join(self.out_raw_sample_path, + f'{self.out_sample_filename_prefix}_{self.latest_generated_sample_num}.png') + + +class IOConfig(DynamicIOConfig): + + def __init__(self, config): + super().__init__() + self._in_dataset_path = config.iio.in_dataset_path + self._in_dataset_stat_path = config.iio.in_dataset_stat_path + self._in_raw_dataset_path = config.iio.in_raw_dataset_path + self._out_asset_suffix = config.iio.out_asset_suffix + self._use_tensorboard = config.iio.use_tensorboard + self._use_wandb = config.iio.use_wandb + self._save_pth_to_wandb = config.iio.save_pth_to_wandb + + @property + def in_dataset_path(self): return self._in_dataset_path + + # def in_dataset_path(self): return os.path.join("data", "SARBuD") + + @property + def in_dataset_stat_path(self): return self._in_dataset_stat_path + + # def in_dataset_stat_path(self): return os.path.join("data", "SARBuD.npz") + + @property + def in_raw_dataset_path(self): return self._in_raw_dataset_path + + # def in_raw_dataset_path(self): return os.path.join("data", "raw", "SARBuD") + + @property + def out_asset_suffix(self): return self._out_asset_suffix + + # def out_asset_suffix(self): return os.path.join("ve", "SARBuD_deponet_cont") + + @property + def use_tensorboard(self): return self._use_tensorboard + + # def use_tensorboard(self): return True + + @property + def use_wandb(self): return self._use_wandb + + # def use_wandb(self): return False + + @property + def save_pth_to_wandb(self): return self._save_pth_to_wandb + + # def save_pth_to_wandb(self): return False + + @in_dataset_path.setter + def in_dataset_path(self, value): + self._in_dataset_path = value + + @in_dataset_stat_path.setter + def in_dataset_stat_path(self, value): + self._in_dataset_stat_path = value + + @in_raw_dataset_path.setter + def in_raw_dataset_path(self, value): + self._in_raw_dataset_path = value + + @out_asset_suffix.setter + def out_asset_suffix(self, value): + self._out_asset_suffix = value + + @use_tensorboard.setter + def use_tensorboard(self, value): + self._use_tensorboard = value + + @use_wandb.setter + def use_wandb(self, value): + self._use_wandb = value + + @save_pth_to_wandb.setter + def save_pth_to_wandb(self, value): + self._save_pth_to_wandb = value \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_dlpu_256_big.yaml b/WWFDiff-PU/configs/fdu_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1cd74551b49b529a399237195dac8f87245be955 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_dlpu_256_big.yaml @@ -0,0 +1,89 @@ +seed: 42 + +loss_type: +# name: Pure + name: PureL1 + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 97 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 + batch_size: 16 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 64, 64, 64] + cross_attention_dim: 192 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 + use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_dlpu_256_big_e_pred.yaml b/WWFDiff-PU/configs/fdu_dlpu_256_big_e_pred.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9984d4fa3cc3dad5b82b82688f20792f76c4d584 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_dlpu_256_big_e_pred.yaml @@ -0,0 +1,117 @@ +seed: 42 + +loss_type: + name: Pure + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256BigEpred + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 7 +# k_max: 100 + k_max: 97 +# k_max: 83 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 8 +# batch_size: 16 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 +# cross_attention_dim: 96 # 32 * 3 + cross_attention_dim: 384 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 +# num_infer_timesteps: 5 +# num_infer_timesteps: 5 + num_infer_timesteps: 50 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false + use_patch_embedding: false +# prediction_type: "sample" +# prediction_type: "v_prediction" + prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda +# batch_size: 128 +# batch_size: 4 + batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_dlpu_256_big_test.yaml b/WWFDiff-PU/configs/fdu_dlpu_256_big_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..08e3c5b0aad32c7309df773e055b5973b278ea5e --- /dev/null +++ b/WWFDiff-PU/configs/fdu_dlpu_256_big_test.yaml @@ -0,0 +1,122 @@ +seed: 42 + +loss_type: + name: Pure + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256BigTest + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 7 +# k_max: 100 +# k_max: 97 + k_max: 41 +# k_max: 83 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 8 +# batch_size: 16 + batch_size: 2 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 10 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: +# name: FDUNetV2 + name: FDUNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] +# block_out_channels: [128, 128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 64, 128] +# block_out_channels: [64, 128, 256, 512] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 +# cross_attention_dim: 96 # 32 * 3 + cross_attention_dim: 384 # 32 * 3 +# cross_attention_dim: 1536 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 +# num_infer_timesteps: 5 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda +# batch_size: 128 +# batch_size: 4 + batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_dlpu_256_big_v1.yaml b/WWFDiff-PU/configs/fdu_dlpu_256_big_v1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bcc2a4eaf781d79b69e5123150866cbd7a8c1d84 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_dlpu_256_big_v1.yaml @@ -0,0 +1,89 @@ +seed: 42 + +loss_type: + name: PureL1 + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256BigV1 + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 97 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 + batch_size: 16 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: false + snapshot_val_freq: 50 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 64, 64, 64] + cross_attention_dim: 192 # 64 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 1 + repeat_channels: 1 + use_patch_embedding: false + use_controlnet: false + prediction_type: "sample" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 32 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_dlpu_256_big_v2.yaml b/WWFDiff-PU/configs/fdu_dlpu_256_big_v2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f494c185ab36991489367643dbe523d352b90474 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_dlpu_256_big_v2.yaml @@ -0,0 +1,116 @@ +seed: 42 + +loss_type: + name: Pure + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256BigV2 + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 7 +# k_max: 100 + k_max: 97 +# k_max: 83 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 8 +# batch_size: 16 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNetV1 + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 +# cross_attention_dim: 96 # 32 * 3 + cross_attention_dim: 384 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 +# num_infer_timesteps: 5 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda +# batch_size: 128 +# batch_size: 4 + batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_dlpu_256_big_v3.yaml b/WWFDiff-PU/configs/fdu_dlpu_256_big_v3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b4bae9d1f23a22336d6aa3017d3a8dab1761fcdb --- /dev/null +++ b/WWFDiff-PU/configs/fdu_dlpu_256_big_v3.yaml @@ -0,0 +1,116 @@ +seed: 42 + +loss_type: + name: Pure + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256BigV3 + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 7 +# k_max: 100 + k_max: 97 +# k_max: 83 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 8 +# batch_size: 16 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNetV1 + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 +# cross_attention_dim: 96 # 32 * 3 + cross_attention_dim: 384 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 +# num_infer_timesteps: 5 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda +# batch_size: 128 +# batch_size: 4 + batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_dlpu_256_big_v_pred.yaml b/WWFDiff-PU/configs/fdu_dlpu_256_big_v_pred.yaml new file mode 100644 index 0000000000000000000000000000000000000000..72863c1b8180089090c393d2c354b368886dc805 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_dlpu_256_big_v_pred.yaml @@ -0,0 +1,116 @@ +seed: 42 + +loss_type: + name: Pure + +meter: + name: WavMeter + +data: + name: InSARDLPUMat256BigVpred + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 7 +# k_max: 100 + k_max: 97 +# k_max: 83 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 8 +# batch_size: 16 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 +# cross_attention_dim: 96 # 32 * 3 + cross_attention_dim: 384 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 +# num_infer_timesteps: 5 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false + use_patch_embedding: false +# prediction_type: "sample" + prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda +# batch_size: 128 +# batch_size: 4 + batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_noise_synpu_128_big.yaml b/WWFDiff-PU/configs/fdu_noise_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..872dd868e60192b8defd56d586138edb7b466468 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_noise_synpu_128_big.yaml @@ -0,0 +1,124 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigNoise + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 + batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 32 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_noise_synpu_128_mid.yaml b/WWFDiff-PU/configs/fdu_noise_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..914f85082d02a279e082c0146712f4667e87db01 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_noise_synpu_128_mid.yaml @@ -0,0 +1,125 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav +# name: SyntheticPUMat128Mch +# name: SyntheticPUMat128Fdu + name: SyntheticPUMat128Noise +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 +# noise_snr: 30 + noise_snr: 100 +# noise_snr: 5 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 50 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: true +# snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] + block_out_channels: [64, 64, 64, 64] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_big.yaml b/WWFDiff-PU/configs/fdu_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e908b3fe6198c3d0033d5b4e795bfb9ea4836013 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_big.yaml @@ -0,0 +1,123 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: fasle + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_big_e_pred.yaml b/WWFDiff-PU/configs/fdu_synpu_128_big_e_pred.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8a31e106e8d88d693b3d87fdf5f6c3f636505c46 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_big_e_pred.yaml @@ -0,0 +1,126 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigEpred + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 +# num_infer_timesteps: 5 +# num_infer_timesteps: 50 + num_infer_timesteps: 1000 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false +# prediction_type: "sample" +# prediction_type: "v_prediction" + prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_big_test.yaml b/WWFDiff-PU/configs/fdu_synpu_128_big_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bdebdbe14ad50aedcd6c92e60d2abc8dd9dd66c6 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_big_test.yaml @@ -0,0 +1,124 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 32 + batch_size: 2 + use_all_data: false + amp: fasle + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_big_v1.yaml b/WWFDiff-PU/configs/fdu_synpu_128_big_v1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..03796dd75e4dc28c7a5a9ba1e62cfc33949157f3 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_big_v1.yaml @@ -0,0 +1,126 @@ +seed: 42 + +loss_type: +# name: MchLoss + # name: Pure + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigV1 + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 +# conditioning_channels: 2 + conditioning_channels: 1 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_big_v2.yaml b/WWFDiff-PU/configs/fdu_synpu_128_big_v2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..13c548f2143b2bbdba80e7099ed7106836a282a2 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_big_v2.yaml @@ -0,0 +1,124 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigV2 + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNetV1 + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_big_v3.yaml b/WWFDiff-PU/configs/fdu_synpu_128_big_v3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..414e25a0e63efc7edf19531989c75e3f855f372c --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_big_v3.yaml @@ -0,0 +1,125 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: PureL1 +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigV3 + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 1 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNetV1 + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 +# conditioning_channels: 2 + conditioning_channels: 1 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_big_v_pred.yaml b/WWFDiff-PU/configs/fdu_synpu_128_big_v_pred.yaml new file mode 100644 index 0000000000000000000000000000000000000000..704c06285c1c8b8ff9ed77aa3eb901cbf6c3e84d --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_big_v_pred.yaml @@ -0,0 +1,124 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: + name: SyntheticPUMat128BigVpred + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 +# noise_snr: 20 +# noise_snr: 10 +# noise_snr: 10 +# noise_snr: 5 +# noise_snr: 0 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 +# snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] + block_out_channels: [128, 128, 128, 128] +# block_out_channels: [64, 64, 64, 128] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 384 # 128 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 +# num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + use_patch_embedding: false +# use_patch_embedding: true + use_controlnet: false +# prediction_type: "sample" + prediction_type: "v_prediction" +# prediction_type: "epsilon" + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 +# batch_size: 256 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_mid.yaml b/WWFDiff-PU/configs/fdu_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..826dfa31e1d0ae6cdd537daec4d6200e973e46ad --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_mid.yaml @@ -0,0 +1,119 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav +# name: SyntheticPUMat128Mch + name: SyntheticPUMat128Fdu +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 + batch_size: 16 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] + block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 96 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_mid_v1.yaml b/WWFDiff-PU/configs/fdu_synpu_128_mid_v1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f7213bf99330087b84ccc672af4b8dbfd33ac68 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_mid_v1.yaml @@ -0,0 +1,121 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav +# name: SyntheticPUMat128Mch + name: SyntheticPUMat128Fdu +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 16 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 50 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: true +# snapshot_val: false +# snapshot_val_freq: 1 + snapshot_val_freq: 50 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] + block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 + cross_attention_dim: 192 # 64 * 3 +# cross_attention_dim: 96 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_mid_v2.yaml b/WWFDiff-PU/configs/fdu_synpu_128_mid_v2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4123bd5f013e809f6605900d6e7061a976babd0e --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_mid_v2.yaml @@ -0,0 +1,120 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav +# name: SyntheticPUMat128Mch + name: SyntheticPUMat128Fdu +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 16 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] + block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 + cross_attention_dim: 192 # 64 * 3 +# cross_attention_dim: 96 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 +# use_controlnet: true + use_controlnet: false +# use_patch_embedding: false + use_patch_embedding: true + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/fdu_synpu_128_mid_v3.yaml b/WWFDiff-PU/configs/fdu_synpu_128_mid_v3.yaml new file mode 100644 index 0000000000000000000000000000000000000000..09b754a2afc6893a9eacbae065ade65b9f0fcf18 --- /dev/null +++ b/WWFDiff-PU/configs/fdu_synpu_128_mid_v3.yaml @@ -0,0 +1,121 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav +# name: SyntheticPUMat128Mch + name: SyntheticPUMat128Fdu +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 + batch_size: 16 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false +# snapshot_sampling_freq: 100 + snapshot_sampling_freq: 50 + snapshot_val: true +# snapshot_val: false +# snapshot_val_freq: 1 + snapshot_val_freq: 50 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.03 + +model: + name: FDUNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] + block_out_channels: [32, 32, 32, 32] +# block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 +# cross_attention_dim: 320 +# cross_attention_dim: 768 # 64 * 3 * 4 +# cross_attention_dim: 192 # 64 * 3 + cross_attention_dim: 96 # 32 * 3 + +diffusion: + name: FduDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 + use_controlnet: true +# use_controlnet: false + use_patch_embedding: false + prediction_type: "sample" +# prediction_type: "v_prediction" +# prediction_type: "epsilon" + + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/hyper_config.yaml b/WWFDiff-PU/configs/hyper_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f984163aae99009338c4d8b90f356f3a31315867 --- /dev/null +++ b/WWFDiff-PU/configs/hyper_config.yaml @@ -0,0 +1,65 @@ +program: main.py +name: hyperparameter_sweep +method: bayes + +metric: + goal: minimize +# name: multi_train_per_epoch/UnwrappedMAE +# name: UnwrappedMAE + name: val_per_epoch/UnwrappedNRMSE +# name: val_per_epoch/UnwrappedNRMSE + +parameters: + loss_bleta1: +# distribution: uniform + distribution: log_uniform + min: 0.000001 +# min: 0.0 + max: 1.0 + + loss_bleta2: +# distribution: uniform + distribution: log_uniform + min: 0.000001 +# min: 0.0 + max: 1.0 + + loss_bleta3: + distribution: log_uniform + min: 0.000001 +# min: 0.0 + max: 1.0 + +#parameters: +# loss_type: +# parameters: +# bleta1: +# distribution: log_uniform +# min: 0.0 +# max: 1.0 +# +# bleta2: +# distribution: log_uniform +# min: 0.0 +# max: 0.2 +# +# bleta3: +# distribution: log_uniform +# min: 0.0 +# max: 0.1 + +early_terminate: + type: hyperband + min_iter: 5 + eta: 3 + +command: +# - CUDA_VISIBLE_DEVICES=0,1,2,3 + - ${env} + - accelerate + - launch + - ${program} + - "--config=wav_synpu_128_mid.yaml" + - "--mode=train_multi" + - "--training_from_scratch" + - "--hyper" diff --git a/WWFDiff-PU/configs/hyper_config_v1.yaml b/WWFDiff-PU/configs/hyper_config_v1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..95f90557ba1a37ebacabf5749e08b380f8a800f0 --- /dev/null +++ b/WWFDiff-PU/configs/hyper_config_v1.yaml @@ -0,0 +1,40 @@ +program: main.py +name: hyperparameter_sweep +method: bayes + +metric: + goal: minimize + name: multi_train_per_epoch/UnwrappedMAE + +parameters: + loss_type: + parameters: + bleta1: + distribution: log_uniform + min: 0.0 + max: 1.0 + + bleta2: + distribution: log_uniform + min: 0.0 + max: 0.2 + + bleta3: + distribution: log_uniform + min: 0.0 + max: 0.1 + + +early_terminate: + type: hyperband + min_iter: 5 + eta: 3 + +command: + - ${env} + - ${interpreter} + - ${program} + - "--config=wav_synpu_128_mid.yaml" + - "--mode=train_multi" + - "--training_from_scratch" + - "--hyper" diff --git a/WWFDiff-PU/configs/hyper_config_v2.yaml b/WWFDiff-PU/configs/hyper_config_v2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..214ee59831ca9e925c323bf2e2971b47814b60d3 --- /dev/null +++ b/WWFDiff-PU/configs/hyper_config_v2.yaml @@ -0,0 +1,59 @@ +program: main.py +name: hyperparameter_sweep +method: bayes + +metric: + goal: minimize +# name: multi_train_per_epoch/UnwrappedMAE + name: UnwrappedMAE +# name: val_per_epoch/UnwrappedNRMSE + +parameters: + loss_bleta1: + distribution: log_uniform + min: 0.000001 + max: 1.0 + + loss_bleta2: + distribution: log_uniform + min: 0.000001 + max: 1.0 + + loss_bleta3: + distribution: log_uniform + min: 0.000001 + max: 1.0 + +#parameters: +# loss_type: +# parameters: +# bleta1: +# distribution: log_uniform +# min: 0.0 +# max: 1.0 +# +# bleta2: +# distribution: log_uniform +# min: 0.0 +# max: 0.2 +# +# bleta3: +# distribution: log_uniform +# min: 0.0 +# max: 0.1 + +early_terminate: + type: hyperband + min_iter: 5 + eta: 3 + +command: +# - CUDA_VISIBLE_DEVICES=0,1,2,3 + - ${env} + - accelerate + - launch + - ${program} + - "--config=wav_synpu_128_mid.yaml" + - "--mode=train_multi" + - "--training_from_scratch" + - "--hyper" diff --git a/WWFDiff-PU/configs/old/cfg_synpu_128_mid.yaml b/WWFDiff-PU/configs/old/cfg_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6a05091b11ffbaf13e6c98eea41c940159dbf3a0 --- /dev/null +++ b/WWFDiff-PU/configs/old/cfg_synpu_128_mid.yaml @@ -0,0 +1,116 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss +# name: Pure +# name: WavLoss +# bleta1: 0.5 +# bleta2: 0.1 +# bleta3: 0.001 + bleta1: 2.47997 + bleta2: 1.73178 + bleta3: 2.07192 + + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 +# brand_new_epochs: 101 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: false +# snapshot_val: true + snapshot_val_freq: 1 + snapshot_batch_size: 128 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [64, 64, 64, 64] + cross_attention_dim: 1280 +# cross_attention_dim: 320 + +diffusion: + name: CfgDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 1000 + conditioning_channels: 2 + repeat_channels: 1 +# cfg_scale: 1.5 + cfg_scale: 0.4 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false +# use_wandb: true + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/cfg_wav_synpu_cut32_mid.yaml b/WWFDiff-PU/configs/old/cfg_wav_synpu_cut32_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0183e278a8c934c7ab131f25df62f07c1d25ab2c --- /dev/null +++ b/WWFDiff-PU/configs/old/cfg_wav_synpu_cut32_mid.yaml @@ -0,0 +1,83 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMatCut32Wav + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 2 + wavelet_type: db4 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 + batch_size: 128 +# batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: CfgDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + cfg_scale: 1.5 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/cfg_wav_synpu_cut32_test.yaml b/WWFDiff-PU/configs/old/cfg_wav_synpu_cut32_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8aad70e04de75ef40c30ed329b4d308e1f463370 --- /dev/null +++ b/WWFDiff-PU/configs/old/cfg_wav_synpu_cut32_test.yaml @@ -0,0 +1,84 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMatCut32Wav + name: SyntheticPUMatCut32WavTest + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 2 + wavelet_type: db4 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: CfgDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + cfg_scale: 1.5 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config.yaml b/WWFDiff-PU/configs/old/config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b21e9f33485cfb2bc97c968492ce667379f7dc9c --- /dev/null +++ b/WWFDiff-PU/configs/old/config.yaml @@ -0,0 +1,98 @@ +# Configuration for training and sampling +seed: 42 + +#method: +# diff_norm: true +# pca: false +# rwa: false + +data: + name: InSARDLPUMat + image_size: 256 + color_channels: 1 + num_workers: 1 + scale_k: 50 +# use_fp16: false + method: diff_norm +# random_flip: false +# centered: false +# uniform_dequantization: false +# is_fold: true +# fold: 0 +# num_folds: 5 + +model: + name: UNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: DFNDDPMDiffusion + custom_model: false + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + beta_start: 0.0001 + beta_end: 0.02 + loss_type: mse + +training: + batch_size: 2 + device: cuda + brand_new_epochs: 1000 + continue_training_epochs: 1000 + use_all_data: false + snapshot_freq: 100 + snapshot_batch_size: 2 + log_freq: 1 + eval_freq: 100 + eval_save_least_epoch: 50 + snapshot_sampling: false + amp: true + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 +# out_threshold: 0.5 + +optim: + optimizer: AdamW8bit + lr: 0.0001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +scheduler: + num_train_timesteps: 50 + +metrics: + l1: true + rmse: true + wrap_l1: false + wrap_rmse: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_aux_unet_128_big.yaml b/WWFDiff-PU/configs/old/config_aux_unet_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1c6836f4bf2e665665318055fae30c1f5371c5ae --- /dev/null +++ b/WWFDiff-PU/configs/old/config_aux_unet_128_big.yaml @@ -0,0 +1,79 @@ +seed: 42 + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +mmodel: + name: AuxUNetMModel + +model: + name: AuxUNet + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: UNetLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_aux_unet_test.yaml b/WWFDiff-PU/configs/old/config_aux_unet_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..01a69865e849fc3bdcd50983a91368c06a85a0e5 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_aux_unet_test.yaml @@ -0,0 +1,79 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +mmodel: + name: AuxUNetMModel + +model: + name: AuxUNet + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 50 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: UNetLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_diff_aux_unet_128_big.yaml b/WWFDiff-PU/configs/old/config_diff_aux_unet_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..783634563e32a09ed36c6f78d0d09e03e46bc542 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_diff_aux_unet_128_big.yaml @@ -0,0 +1,79 @@ +seed: 42 + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +mmodel: + name: DiffAuxUNetMModel + +model: + name: DiffAuxUNet + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: UNetLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_diff_aux_unet_test.yaml b/WWFDiff-PU/configs/old/config_diff_aux_unet_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f4141ae71dc8fa4e58a2c10e8aa9b57027f11531 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_diff_aux_unet_test.yaml @@ -0,0 +1,79 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +mmodel: + name: DiffAuxUNetMModel + +model: + name: DiffAuxUNet + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 50 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: UNetLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_insardlu_256.yaml b/WWFDiff-PU/configs/old/config_insardlu_256.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b21e9f33485cfb2bc97c968492ce667379f7dc9c --- /dev/null +++ b/WWFDiff-PU/configs/old/config_insardlu_256.yaml @@ -0,0 +1,98 @@ +# Configuration for training and sampling +seed: 42 + +#method: +# diff_norm: true +# pca: false +# rwa: false + +data: + name: InSARDLPUMat + image_size: 256 + color_channels: 1 + num_workers: 1 + scale_k: 50 +# use_fp16: false + method: diff_norm +# random_flip: false +# centered: false +# uniform_dequantization: false +# is_fold: true +# fold: 0 +# num_folds: 5 + +model: + name: UNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: DFNDDPMDiffusion + custom_model: false + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + beta_start: 0.0001 + beta_end: 0.02 + loss_type: mse + +training: + batch_size: 2 + device: cuda + brand_new_epochs: 1000 + continue_training_epochs: 1000 + use_all_data: false + snapshot_freq: 100 + snapshot_batch_size: 2 + log_freq: 1 + eval_freq: 100 + eval_save_least_epoch: 50 + snapshot_sampling: false + amp: true + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 +# out_threshold: 0.5 + +optim: + optimizer: AdamW8bit + lr: 0.0001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +scheduler: + num_train_timesteps: 50 + +metrics: + l1: true + rmse: true + wrap_l1: false + wrap_rmse: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_insardlu_64.yaml b/WWFDiff-PU/configs/old/config_insardlu_64.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b21e9f33485cfb2bc97c968492ce667379f7dc9c --- /dev/null +++ b/WWFDiff-PU/configs/old/config_insardlu_64.yaml @@ -0,0 +1,98 @@ +# Configuration for training and sampling +seed: 42 + +#method: +# diff_norm: true +# pca: false +# rwa: false + +data: + name: InSARDLPUMat + image_size: 256 + color_channels: 1 + num_workers: 1 + scale_k: 50 +# use_fp16: false + method: diff_norm +# random_flip: false +# centered: false +# uniform_dequantization: false +# is_fold: true +# fold: 0 +# num_folds: 5 + +model: + name: UNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: DFNDDPMDiffusion + custom_model: false + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + beta_start: 0.0001 + beta_end: 0.02 + loss_type: mse + +training: + batch_size: 2 + device: cuda + brand_new_epochs: 1000 + continue_training_epochs: 1000 + use_all_data: false + snapshot_freq: 100 + snapshot_batch_size: 2 + log_freq: 1 + eval_freq: 100 + eval_save_least_epoch: 50 + snapshot_sampling: false + amp: true + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 +# out_threshold: 0.5 + +optim: + optimizer: AdamW8bit + lr: 0.0001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +scheduler: + num_train_timesteps: 50 + +metrics: + l1: true + rmse: true + wrap_l1: false + wrap_rmse: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_latent_synpu_cut_32_test.yaml b/WWFDiff-PU/configs/old/config_latent_synpu_cut_32_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cee365fbfaee595cde2a7c80338ab0a7baa9ab1d --- /dev/null +++ b/WWFDiff-PU/configs/old/config_latent_synpu_cut_32_test.yaml @@ -0,0 +1,112 @@ +seed: 42 + +data: + name: SyntheticPUMatCut32Test + image_size: 32 + color_channels: 1 + num_workers: 1 + scale_k: 3 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion + name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: true + use_custom_vae: true + + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 64 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 + name: PHY1 +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_mch_synpu_32_mid.yaml b/WWFDiff-PU/configs/old/config_mch_synpu_32_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..acfccb00c5d8218fe5ffffe1d0b8a22318228a37 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_mch_synpu_32_mid.yaml @@ -0,0 +1,120 @@ +seed: 42 + +data: + name: SyntheticPUMatCut32Mch + image_size: 32 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion + name: MchDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + repeat_channels: 7 + +meter: + name: MchMeter + + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 128 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +val: + device: cuda + batch_size: 128 + +loss_type: +# name: PHY3 + name: PHY11 +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_pu_unet_128_big.yaml b/WWFDiff-PU/configs/old/config_pu_unet_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c4b6d73fa8589e3e2faff82e9da45d8a4b8ef4ed --- /dev/null +++ b/WWFDiff-PU/configs/old/config_pu_unet_128_big.yaml @@ -0,0 +1,79 @@ +seed: 42 + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +mmodel: + name: PuUNetMModel + +model: + name: PuUNet + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 128 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: UNetLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_pu_unet_test.yaml b/WWFDiff-PU/configs/old/config_pu_unet_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cae330c261abde15b5b601620ea86fea2b6cbe4c --- /dev/null +++ b/WWFDiff-PU/configs/old/config_pu_unet_test.yaml @@ -0,0 +1,79 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +mmodel: + name: PuUnetMModel + +model: + name: PUUNet + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: UNetLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_syn_64.yaml b/WWFDiff-PU/configs/old/config_syn_64.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d29d8cc60c9e2f6f9e2df040629fe6ec82529928 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_syn_64.yaml @@ -0,0 +1,79 @@ +# Configuration for training and sampling +seed: 42 + +data: + name: SyntheticData + image_size: 64 + color_channels: 1 + num_workers: 1 + scale_k: 1 + method: none + +model: + name: UNet + sample_size: 64 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: DDPMDiffusion + custom_model: false + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + +training: + batch_size: 32 + device: cuda + brand_new_epochs: 1000 + continue_training_epochs: 1000 + use_all_data: false + snapshot_freq: 100 + snapshot_batch_size: 2 + log_freq: 1 + eval_freq: 100 + eval_save_least_epoch: 50 + snapshot_sampling: false + amp: true + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 + +optim: + optimizer: AdamW8bit + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_synpu_128.yaml b/WWFDiff-PU/configs/old/config_synpu_128.yaml new file mode 100644 index 0000000000000000000000000000000000000000..38eca4b57ac4c7c1d2fce459ce289c1785cb623e --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128.yaml @@ -0,0 +1,81 @@ +# Configuration for training and sampling +seed: 42 + +data: + name: SyntheticPUMat + image_size: 128 + color_channels: 1 + num_workers: 1 + scale_k: 5 + method: none + +model: + name: UNet + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: DDPMDiffusion + custom_model: false + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + +training: + batch_size: 4 + device: cuda + brand_new_epochs: 1000 + continue_training_epochs: 1000 + use_all_data: false + snapshot_freq: 50 + snapshot_batch_size: 2 + log_freq: 1 + eval_freq: 1 + snapshot_sampling: false + amp: true + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +scheduler: + num_train_timesteps: 50 + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_synpu_128_big_delu.yaml b/WWFDiff-PU/configs/old/config_synpu_128_big_delu.yaml new file mode 100644 index 0000000000000000000000000000000000000000..008c66c30907cec235da97736505102133c74855 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_big_delu.yaml @@ -0,0 +1,124 @@ +seed: 42 + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion + name: ElucidatedDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: +# name: AuxUNet + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 2 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 +# name: PHY11 + name: GEWLOSS +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_big_phase.yaml b/WWFDiff-PU/configs/old/config_synpu_128_big_phase.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eedd0ad8dfae2da305b9f0628eb48f1997f522e2 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_big_phase.yaml @@ -0,0 +1,127 @@ +seed: 42 + +data: + name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf +# k_min: 0 +# k_max: 3 + mean : 9.60 + std: 5.43 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion +# name: ElucidatedDiffusion + name: PhaseDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: +# name: AuxUNet + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 10 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 +# name: PHY11 +# name: GEWLOSS +# name: PHY4 + name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_mid_phase.yaml b/WWFDiff-PU/configs/old/config_synpu_128_mid_phase.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1019c0604286618c70a192b9e19eec969fad718a --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_mid_phase.yaml @@ -0,0 +1,73 @@ +seed: 42 + +loss_type: + name: PURE + +data: + name: SyntheticPUMat128Mid + image_size: 128 + color_channels: 1 + num_workers: 1 + mean : 10.01 + std: 5.74 + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 2 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +diffusion: + name: PhaseDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +vae: + name: LatentVAE + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_synpu_128_small.yaml b/WWFDiff-PU/configs/old/config_synpu_128_small.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dea74effa03cb4fa94c769e67910e103cd13ac28 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_small.yaml @@ -0,0 +1,112 @@ +seed: 42 + +data: + name: SyntheticPUMat128Small + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion + name: MchNegNormDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 + name: PHY11 +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_small_dph.yaml b/WWFDiff-PU/configs/old/config_synpu_128_small_dph.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3881e7357b81050b1b5c7307b227df90b00279df --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_small_dph.yaml @@ -0,0 +1,122 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion + name: DphDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: + name: AuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 + name: PHY11 +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_small_dph_bak.yaml b/WWFDiff-PU/configs/old/config_synpu_128_small_dph_bak.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3881e7357b81050b1b5c7307b227df90b00279df --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_small_dph_bak.yaml @@ -0,0 +1,122 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion + name: DphDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: + name: AuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 + name: PHY11 +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_small_mch.yaml b/WWFDiff-PU/configs/old/config_synpu_128_small_mch.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dea74effa03cb4fa94c769e67910e103cd13ac28 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_small_mch.yaml @@ -0,0 +1,112 @@ +seed: 42 + +data: + name: SyntheticPUMat128Small + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion + name: MchNegNormDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 + name: PHY11 +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_test_delu.yaml b/WWFDiff-PU/configs/old/config_synpu_128_test_delu.yaml new file mode 100644 index 0000000000000000000000000000000000000000..20b44afdabd9c67096ab2b04bef25166540786fe --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_test_delu.yaml @@ -0,0 +1,124 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion + name: ElucidatedDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: +# name: AuxUNet + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 +# name: PHY11 + name: GEWLOSS +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_test_dph.yaml b/WWFDiff-PU/configs/old/config_synpu_128_test_dph.yaml new file mode 100644 index 0000000000000000000000000000000000000000..385337bcce296dc2489c0da7e7cb9031d720983c --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_test_dph.yaml @@ -0,0 +1,123 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion + name: DphDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: +# name: AuxUNet + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 2 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 + name: PHY11 +# name: PHY4 +# name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_test_phase.yaml b/WWFDiff-PU/configs/old/config_synpu_128_test_phase.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eedd0ad8dfae2da305b9f0628eb48f1997f522e2 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_test_phase.yaml @@ -0,0 +1,127 @@ +seed: 42 + +data: + name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf +# k_min: 0 +# k_max: 3 + mean : 9.60 + std: 5.43 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion +# name: ElucidatedDiffusion + name: PhaseDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: +# name: AuxUNet + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 10 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 +# name: PHY11 +# name: GEWLOSS +# name: PHY4 + name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_128_test_ucn.yaml b/WWFDiff-PU/configs/old/config_synpu_128_test_ucn.yaml new file mode 100644 index 0000000000000000000000000000000000000000..aa2a891a22a8cc05bb4f915ccb3535441188cdc9 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_128_test_ucn.yaml @@ -0,0 +1,124 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: LatentDDPMDiffusion +# name: NegNormDDPMDiffusion +# name: MchNegNormDDPMDiffusion +# name: DphDDPMDiffusion + name: UcnDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +sec_model: +# name: AuxUNet + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +vae: + name: LatentVAE +# latent_channels: 4 +# in_channels: 1 +# out_channels: 1 +# block_out_channels: [32,] +# hidden_channels: 32 +# num_res_blocks: 2 +# channel_multipliers: [1, 2, 4, 4] +# image_size: 32 +# z_size: 8 +# use_attention: true +# use_fp16: false + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 +# name: PHY11 +# name: PHY4 + name: PURE + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: false + rmse: false + wrap_l1: false + wrap_rmse: false diff --git a/WWFDiff-PU/configs/old/config_synpu_32_cut_mid_phase.yaml b/WWFDiff-PU/configs/old/config_synpu_32_cut_mid_phase.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bfa6cfaea044ec232573537fb02de0b987f10e8b --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_32_cut_mid_phase.yaml @@ -0,0 +1,74 @@ +seed: 42 + +loss_type: +# name: PURE + name: PHY11 + +data: + name: SyntheticPUMatCut32Mid + image_size: 32 + color_channels: 1 + num_workers: 1 + mean : 7.44 + std: 4.37 + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 128 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +diffusion: + name: PhaseCutDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +vae: + name: LatentVAE + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_synpu_32_cut_mid_test_phase.yaml b/WWFDiff-PU/configs/old/config_synpu_32_cut_mid_test_phase.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1feb38a2802e7bf802c63e5993830b9dbc0db72a --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_32_cut_mid_test_phase.yaml @@ -0,0 +1,84 @@ +seed: 42 + +loss_type: +# name: PURE2 + name: PHY11 + +meter: + name: PUREMeter + +data: + name: SyntheticPUMatCut32MidTest + image_size: 32 + color_channels: 1 + num_workers: 1 + mean : 9.69 + std: 5.58 + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 2 + +diffusion: + name: PhaseCutDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + +sampling: + device: cuda + batch_size: 8 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + +test: + device: cuda + batch_size: 8 + +optim: + optimizer: Adam + lr: 0.001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +vae: + name: LatentVAE + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_synpu_cut_32_big.yaml b/WWFDiff-PU/configs/old/config_synpu_cut_32_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7612246467505821a937b923c0bc755a6ff0089d --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_cut_32_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +data: + name: SyntheticPUMatCut32Big + image_size: 32 + color_channels: 1 + num_workers: 1 + scale_k: 6 + method: kdf + k_min: 0 + k_max: 6 + +diffusion: + name: KdfDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat + use_filter: false + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 128 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 1 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY3 + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_cut_32_test.yaml b/WWFDiff-PU/configs/old/config_synpu_cut_32_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0167b444ac8f30d3bece2d6ff915db9a582217de --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_cut_32_test.yaml @@ -0,0 +1,97 @@ +seed: 42 + +data: + name: SyntheticPUMatCut32Test + image_size: 32 + color_channels: 1 + num_workers: 1 + scale_k: 3 + method: kdf + k_min: 0 + k_max: 3 + +diffusion: +# name: KdfDDPMDiffusion +# name: DFNDDPMDiffusion +# name: NegNormDDPMDiffusion + name: MchNegNormDDPMDiffusion +# name: DDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + use_custom_model: false + on_conditioning: true + conditioning_channels: 1 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 1001 + batch_size: 64 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: +# name: PHY3 +# name: PHY1 +# name: PHY4 +# name: PHY13 + name: PHY13 + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true diff --git a/WWFDiff-PU/configs/old/config_synpu_cut_64.yaml b/WWFDiff-PU/configs/old/config_synpu_cut_64.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c514d1b9fa5027e459d948240284c49a223ead38 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_synpu_cut_64.yaml @@ -0,0 +1,81 @@ +# Configuration for training and sampling +seed: 42 + +data: + name: SyntheticPUMat + image_size: 32 + color_channels: 1 + num_workers: 1 + scale_k: 5 + method: none + +model: + name: UNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: DDPMDiffusion + custom_model: false + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 1000 + +training: + batch_size: 64 + device: cuda + brand_new_epochs: 1000 + continue_training_epochs: 1000 + use_all_data: false + snapshot_freq: 50 + snapshot_batch_size: 2 + log_freq: 1 + eval_freq: 1 + snapshot_sampling: false + amp: true + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +scheduler: + num_train_timesteps: 50 + +metrics: + l1: true + rmse: true + wrap_l1: true + wrap_rmse: true \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_test.yaml b/WWFDiff-PU/configs/old/config_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d9424e176349188d0f38ab7fdab2e2272c9a5524 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_test.yaml @@ -0,0 +1,98 @@ +# Configuration for training and sampling +seed: 42 + +#method: +# diff_norm: true +# pca: false +# rwa: false + +data: + name: InSARDLPUMat + image_size: 256 + color_channels: 1 + num_workers: 1 + scale_k: 50 +# use_fp16: false + method: diff_norm +# random_flip: false +# centered: false +# uniform_dequantization: false +# is_fold: true +# fold: 0 +# num_folds: 5 + +model: + name: UNet + sample_size: 256 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +controlnet_model: + name: ControlNet + in_channels: 1 + conditioning_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: DFNDDPMDiffusion + custom_model: false + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 10 + beta_start: 0.0001 + beta_end: 0.02 + loss_type: mse + +training: + batch_size: 2 + device: cuda + brand_new_epochs: 1000 + continue_training_epochs: 1000 + use_all_data: false + snapshot_freq: 100 + snapshot_batch_size: 2 + log_freq: 1 + eval_freq: 100 + eval_save_least_epoch: 50 + snapshot_sampling: false + amp: true + +sampling: + device: cuda + batch_size: 1 + eval: true + total_samples: 4 + record_freq: 1 + eps: 1e-5 +# out_threshold: 0.5 + +optim: + optimizer: AdamW8bit + lr: 0.0001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PHY + lam_phys: 0.5 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +scheduler: + num_train_timesteps: 50 + +metrics: + l1: true + rmse: true + wrap_l1: false + wrap_rmse: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/config_unet_test.yaml b/WWFDiff-PU/configs/old/config_unet_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b3a18bd426737462373ad6d1ecb22b9813d69f15 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_unet_test.yaml @@ -0,0 +1,79 @@ +seed: 42 + +data: + name: SyntheticPUMat128Test + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +mmodel: + name: UnetMModel + +model: + name: UNet + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: UNetLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_vae_test.yaml b/WWFDiff-PU/configs/old/config_vae_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5722c279ec9bbee5fd77fceb87d5613bb5f0fcb9 --- /dev/null +++ b/WWFDiff-PU/configs/old/config_vae_test.yaml @@ -0,0 +1,76 @@ +seed: 42 + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_max: 3 + k_min: 0 + +model: + name: LatentVAE + sample_size: 32 + latent_channels: 4 + in_channels: 1 + out_channels: 1 + block_out_channels: [ 32, 64, 128, 32] +# block_out_channels: [ 32, 64 ] +# block_out_channels: [ 32,] + +training: + device: cuda + brand_new_epochs: 1001 + continue_training_epochs: 10001 + batch_size: 128 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +test: + device: cuda + batch_size: 8 + total_samples: 8 + eps: 1e-5 + fix_seed: true + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.1 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: VAEKLLOSS + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +metrics: + l1: true diff --git a/WWFDiff-PU/configs/old/config_val_test.yaml b/WWFDiff-PU/configs/old/config_val_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..689d7fbb1284ec8569fcdc010cf0bd1211bd24ea --- /dev/null +++ b/WWFDiff-PU/configs/old/config_val_test.yaml @@ -0,0 +1,92 @@ +seed: 42 + +data: + name: SyntheticPUMatCut32Test + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 3 + +diffusion: + name: NegNormDDPMDiffusion +# name: ElucidatedDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + use_custom_model: false + on_conditioning: true + conditioning_channels: 2 + use_controlnet: false + fusion_type: concat +# use_cross_attention: false + use_filter: false + scaling_factor: 0.18215 + use_vae: false + use_custom_vae: true + + +model: + name: DiffAuxUNet + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +vae: + name: LatentVAE + +training: + device: cuda + brand_new_epochs: 10001 + continue_training_epochs: 1000001 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + eval_freq: 1 + snapshot_sampling: false + snapshot_batch_size: 2 + metric: ["loss", "l1", "rmse"] + +sampling: + device: cuda + batch_size: 8 + eval: true + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + metric: ["l1", "rmse"] + +optim: + optimizer: Adam + lr: 0.001 + weight_decay: 0 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +loss_type: + name: PURE + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false + +meter: + name: PUREMeter +# metric_list: ["l1", "rmse", "wrap_l1", "wrap_rmse"] \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/dfn_synpu_128_mid.yaml b/WWFDiff-PU/configs/old/dfn_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..25927c1c352cdcaeac833f8b705f3b2ed0a89a1f --- /dev/null +++ b/WWFDiff-PU/configs/old/dfn_synpu_128_mid.yaml @@ -0,0 +1,102 @@ +seed: 42 + +loss_type: + name: MchLoss +# name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav + name: SyntheticPUMat128Dfn +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 +# k_max: 8 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [32, 32, 32, 32] +# cross_attention_dim: 1280 + cross_attention_dim: 320 + +diffusion: + name: DfnDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 1 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/fdu_synpu_128_mid.yaml b/WWFDiff-PU/configs/old/fdu_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b395d32d31cfb1c9e42d4eb0b7be86ab5915e4aa --- /dev/null +++ b/WWFDiff-PU/configs/old/fdu_synpu_128_mid.yaml @@ -0,0 +1,90 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 3 + wavelet_type: db4 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 32 + batch_size: 32 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: +# name: UNet2DConditionModel + name: Uformer + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [32, 64] +# cross_attention_dim: 1280 + cross_attention_dim: 640 + +diffusion: + name: WavDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/hyper_config_old.yaml b/WWFDiff-PU/configs/old/hyper_config_old.yaml new file mode 100644 index 0000000000000000000000000000000000000000..53d1c30ab307de0b7baac32e09e50896db44ee12 --- /dev/null +++ b/WWFDiff-PU/configs/old/hyper_config_old.yaml @@ -0,0 +1,73 @@ +# This is a sample configuration file for training a model using a hyperparameter sweep with Weights & Biases (wandb). +#controller: +# type: local + +program: main.py +name: hyperparameter_sweep +method: bayes +#metric: +# goal: minimize +# name: training_loss +metric: + goal: minimize + name: UnwrappedMAE +parameters: +# learning_rate: +# min: 0.0001 +# max: 0.1 +# batch_size: +# values: [16, 32, 64] +# training.brand_new_epochs: +# values: [10, 30] +# optim.optimizer: +# values: ["Adam", "SGD"] +# optim.lr: +# values: [0.0001, 0.0002] + loss_type.bleta_1: + min: 0 + max: 1 + loss_type.bleta_2: + min: 0 + max: 0.2 + loss_type.bleta_3: + min: 0 + max: 0.1 + +#command: +# - ${env} +# - ${interpreter} +# - ${program} +# - "--config=config.yaml" +# - "--mode=train" +# - "--training_from_scratch" +# - "--hyper" + +command: + - ${env} + - ${interpreter} + - ${program} + - "--config=config.yaml" + - "--mode=train_multi" + - "--training_from_scratch" + - "--hyper" + +#early_terminate: +# type: hyperband +# min_iter: 10 +# eta: 5 + +#command: +# - ${env} +# - ${interpreter} + +#early_terminate: +# type: hyperband +# s: 0 +# eta: 0 +# max_iter: 0 + +#command: +#- ${Command macro} +#- ${Command macro} +#- ${Command macro} +#- ${Command macro} \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_dlpu_cut32_mid.yaml b/WWFDiff-PU/configs/old/mch_dlpu_cut32_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c7c0b447909df95b7defaddefd5286fbb549ffb2 --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_dlpu_cut32_mid.yaml @@ -0,0 +1,82 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: InSARDLPUMatCut32Small +# name: InSARDLPUMatCut32SmallTest + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 + batch_size: 128 +# batch_size: 32 +# batch_size: 64 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: MchDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 7 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_grad_synpu_cut32_test.yaml b/WWFDiff-PU/configs/old/mch_grad_synpu_cut32_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..93d343d80029f6f1da34509ef07e25c2960848c6 --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_grad_synpu_cut32_test.yaml @@ -0,0 +1,84 @@ +seed: 42 + +loss_type: +# name: PHY11 +# name: MchLoss + name: MchGradLoss + +meter: +# name: MchMeter + name: MchGradMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMatCut32MchGrad + name: SyntheticPUMatCut32MchGradTest + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 3 +# k_max: 6 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 2 + out_channels: 2 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: +# name: MchDDPMDiffusion + name: GradDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 7 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_grad_synpu_cut32_tid.yaml b/WWFDiff-PU/configs/old/mch_grad_synpu_cut32_tid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a8979414bb84532396efc1df56dadd0b5f3857f7 --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_grad_synpu_cut32_tid.yaml @@ -0,0 +1,84 @@ +seed: 42 + +loss_type: +# name: PHY11 +# name: MchLoss + name: MchGradLoss + +meter: +# name: MchMeter + name: MchGradMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMatCut32MchGrad +# name: SyntheticPUMatCut32MchGradTest + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 3 +# k_max: 6 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 + batch_size: 128 +# batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 2 + out_channels: 2 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: +# name: MchDDPMDiffusion + name: GradDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 7 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_synpu_128_big.yaml b/WWFDiff-PU/configs/old/mch_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..37600fafb64a2af04d85cabe8ce8b8513b01f2ec --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_synpu_128_big.yaml @@ -0,0 +1,92 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 3 + wavelet_type: db4 + mean: 13.8934 + std: 8.3059 + scale_alpha: 2 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [32, 32, 32, 32] +# cross_attention_dim: 1280 + cross_attention_dim: 320 + +diffusion: + name: MchDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 + num_infer_timesteps: 1000 + conditioning_channels: 2 + repeat_channels: 1 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_synpu_128_mid.yaml b/WWFDiff-PU/configs/old/mch_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76d9ebe8ad93d2c699de5e799da39ba8c25e5340 --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_synpu_128_mid.yaml @@ -0,0 +1,80 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch # tr_cut_32_mid_3200 +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Mid # tr_128_mid_3000 + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 10 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: MchDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_synpu_128_mid_v1.yaml b/WWFDiff-PU/configs/old/mch_synpu_128_mid_v1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3c0ddafd17238693941003bbcb8c0dcbac95caef --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_synpu_128_mid_v1.yaml @@ -0,0 +1,109 @@ +seed: 42 + +loss_type: +# name: MchLoss + name: Pure +# name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav + name: SyntheticPUMat128Mch +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 +# k_max: 8 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: true + snapshot_val: false + snapshot_val_freq: 50 + snapshot_batch_size: 128 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] +# block_out_channels: [64, 128, 256, 256] +# block_out_channels: [32, 32, 32, 32] + block_out_channels: [64, 64, 64, 64] +# cross_attention_dim: 1280 + cross_attention_dim: 320 + +diffusion: + name: MchDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 5 + conditioning_channels: 2 + repeat_channels: 1 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_synpu_cut32_mid.yaml b/WWFDiff-PU/configs/old/mch_synpu_cut32_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..61ac66a3217ef14e8db41f68461559a9c895650c --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_synpu_cut32_mid.yaml @@ -0,0 +1,79 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch + name: SyntheticPUMatCut32MchTest + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: MchDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/mch_synpu_cut32_test.yaml b/WWFDiff-PU/configs/old/mch_synpu_cut32_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..61ac66a3217ef14e8db41f68461559a9c895650c --- /dev/null +++ b/WWFDiff-PU/configs/old/mch_synpu_cut32_test.yaml @@ -0,0 +1,79 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch + name: SyntheticPUMatCut32MchTest + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: MchDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/wav_noise_synpu_128_mid.yaml b/WWFDiff-PU/configs/old/wav_noise_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..005aa452850ccd9a50322883304376eecba5b20b --- /dev/null +++ b/WWFDiff-PU/configs/old/wav_noise_synpu_128_mid.yaml @@ -0,0 +1,115 @@ +seed: 42 + +loss_type: +# name: PHY11 +# name: MchLoss +# name: Pure + name: WavLoss +# bleta1: 0.5 +# bleta2: 0.1 +# bleta3: 0.001 + bleta1: 2.47997 + bleta2: 1.73178 + bleta3: 2.07192 + + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 10 # 5db, 10db, 20db, 30db + +training: + device: cuda + brand_new_epochs: 100001 +# brand_new_epochs: 101 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: false +# snapshot_val: true + snapshot_val_freq: 1 + snapshot_batch_size: 128 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [64, 64, 64, 64] + cross_attention_dim: 1280 +# cross_attention_dim: 320 + +diffusion: + name: WavDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false +# use_wandb: true + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/wav_synpu_128_big.yaml b/WWFDiff-PU/configs/old/wav_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fb3d186770b72473bee518a9c1db62efde3889c1 --- /dev/null +++ b/WWFDiff-PU/configs/old/wav_synpu_128_big.yaml @@ -0,0 +1,94 @@ +seed: 42 + +loss_type: +# name: PHY11 +# name: MchLoss + name: WavLoss + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 3 + wavelet_type: db4 + mean: 13.8934 + std: 8.3059 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [32, 32, 32, 32] +# cross_attention_dim: 1280 + cross_attention_dim: 320 + +diffusion: + name: WavDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 + num_infer_timesteps: 1000 + conditioning_channels: 2 + repeat_channels: 1 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/wav_synpu_128_mid.yaml b/WWFDiff-PU/configs/old/wav_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..402810b7b08f5f7be01b765c0a68c57cba3a4a91 --- /dev/null +++ b/WWFDiff-PU/configs/old/wav_synpu_128_mid.yaml @@ -0,0 +1,124 @@ +seed: 42 + +loss_type: +# name: PHY11 +# name: MchLoss +# name: Pure + name: WavLoss +# bleta1: 0.5 +# bleta2: 0.1 +# bleta3: 0.001 +# bleta1: 2.47997 + bleta1: 2.09933 +# bleta2: 1.73178 + bleta2: 2.34282 + # bleta3: 2.07192 + bleta3: 2.06204 + + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav + name: SyntheticPUMat128Wav +# name: SyntheticPUMat128Noise +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 10 + +training: + device: cuda + brand_new_epochs: 100001 +# brand_new_epochs: 201 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_sampling: false + snapshot_sampling_freq: 100 +# snapshot_val: false + snapshot_val: true + snapshot_val_freq: 1 + snapshot_batch_size: 128 +# best_evaluate_loss: 0.02 +# snapshot_best_loss: false + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [64, 64, 64, 64] + cross_attention_dim: 1280 +# cross_attention_dim: 320 + +diffusion: + name: WavDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 1000 + conditioning_channels: 2 + repeat_channels: 1 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false +# use_wandb: true + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/wav_synpu_128_mid2.yaml b/WWFDiff-PU/configs/old/wav_synpu_128_mid2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9af423a2ed81bff59d866741b870145d47f4fdd3 --- /dev/null +++ b/WWFDiff-PU/configs/old/wav_synpu_128_mid2.yaml @@ -0,0 +1,113 @@ +seed: 42 + +loss_type: +# name: PHY11 +# name: MchLoss +# name: Pure + name: WavLoss +# bleta1: 0.5 +# bleta2: 0.1 +# bleta3: 0.001 + bleta1: 2.47997 + bleta2: 1.73178 + bleta3: 2.07192 + + +meter: +# name: MchMeter + name: WavMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav +# name: SyntheticPUMat128WavTest +# name: SyntheticPUMat128MidTest + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 +# brand_new_epochs: 101 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 +# batch_size: 256 +# batch_size: 64 +# batch_size: 16 +# batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 +# snapshot_freq: 50 + snapshot_sampling: false + snapshot_sampling_freq: 100 + snapshot_val: true + snapshot_val_freq: 1 + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 128 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] +# block_out_channels: [32, 128, 128] + block_out_channels: [64, 64, 64, 64] + cross_attention_dim: 1280 +# cross_attention_dim: 320 + +diffusion: + name: WavDDPMDiffusion + timesteps: 1000 +# num_train_timesteps: 1000 + num_train_timesteps: 1000 +# num_infer_timesteps: 100 +# num_infer_timesteps: 1000 + num_infer_timesteps: 10 + conditioning_channels: 2 + repeat_channels: 1 + +sampling: + device: cuda + batch_size: 1 + total_samples: 8 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false +# use_wandb: true + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/wav_synpu_cut32_mid.yaml b/WWFDiff-PU/configs/old/wav_synpu_cut32_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fdfc36c5637882dc50ad623e8faf55397b949b44 --- /dev/null +++ b/WWFDiff-PU/configs/old/wav_synpu_cut32_mid.yaml @@ -0,0 +1,84 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMatCut32Wav + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 2 + wavelet_type: db4 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 + batch_size: 128 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + block_out_channels: [32, 64] +# cross_attention_dim: 1280 + cross_attention_dim: 640 + +diffusion: + name: WavDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + +sampling: + device: cuda + batch_size: 8 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/old/wav_synpu_cut32_test.yaml b/WWFDiff-PU/configs/old/wav_synpu_cut32_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4b249974eda0def43122247dfc1918cb6887b8e3 --- /dev/null +++ b/WWFDiff-PU/configs/old/wav_synpu_cut32_test.yaml @@ -0,0 +1,83 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: MchLoss + +meter: + name: MchMeter + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMatCut32Wav + name: SyntheticPUMatCut32WavTest + image_size: 32 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 3 + wavelet_type: db4 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: UNet2DConditionModel + sample_size: 32 + in_channels: 1 + out_channels: 1 + layers_per_block: 2 + block_out_channels: [64, 128, 256, 512] + +diffusion: + name: WavDDPMDiffusion + timesteps: 1000 + num_train_timesteps: 1000 + num_infer_timesteps: 100 + conditioning_channels: 2 + repeat_channels: 6 + +sampling: + device: cuda + batch_size: 128 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/punet_dlpu_256_big.yaml b/WWFDiff-PU/configs/punet_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f835ed1997ae272e4eccbcb15a178b4b88539844 --- /dev/null +++ b/WWFDiff-PU/configs/punet_dlpu_256_big.yaml @@ -0,0 +1,85 @@ +seed: 42 + +loss_type: + name: PUNetLoss + +meter: + name: PUNetMeter + +mmodel: + name: PUNetMModel + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 0 + std: 0 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 4 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false +# snapshot_val: true + snapshot_val: false +# snapshot_val_freq: 100 + snapshot_val_freq: 20 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 0.1 + +model: + name: PUNet +# sample_size: 128 + sample_size: 256 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false diff --git a/WWFDiff-PU/configs/punet_noise_synpu_128_big.yaml b/WWFDiff-PU/configs/punet_noise_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..72a858f69d911e1f46a22fbdf77ac36e565a21c7 --- /dev/null +++ b/WWFDiff-PU/configs/punet_noise_synpu_128_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +loss_type: + name: PUNetLoss + +meter: + name: PUNetMeter + +mmodel: + name: PUNetMModel + +data: + name: SyntheticPUMat128BigNoise + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 +# noise_snr: 0 +# noise_snr: 5 +# noise_snr: 20 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: PUNet + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/punet_synpu_128_big.yaml b/WWFDiff-PU/configs/punet_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c8a798e394838b22b2bac373f49949678d1db0a9 --- /dev/null +++ b/WWFDiff-PU/configs/punet_synpu_128_big.yaml @@ -0,0 +1,83 @@ +seed: 42 + +loss_type: + name: PUNetLoss + +meter: + name: PUNetMeter + +mmodel: + name: PUNetMModel + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: PUNet + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/punet_synpu_128_mid.yaml b/WWFDiff-PU/configs/punet_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9a83ba201637eee907d5143b625f445fd2fae9b9 --- /dev/null +++ b/WWFDiff-PU/configs/punet_synpu_128_mid.yaml @@ -0,0 +1,89 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: PUNetLoss + +meter: + name: PUNetMeter + +mmodel: + name: PUNetMModel + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Fdu + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 10 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 +# batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false +# snapshot_val: true + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: PUNet + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/restormer_dlpu_256_big.yaml b/WWFDiff-PU/configs/restormer_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2a90b9bd36840d7482960b2619e5c27fa21a362e --- /dev/null +++ b/WWFDiff-PU/configs/restormer_dlpu_256_big.yaml @@ -0,0 +1,86 @@ +seed: 42 + +loss_type: + name: RestormerLoss + +meter: + name: PUNetMeter + +mmodel: + name: RestormerMModel + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 0 + std: 0 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 2 + batch_size: 4 +# batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false +# snapshot_val: true + snapshot_val: false +# snapshot_val_freq: 100 + snapshot_val_freq: 20 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 0.1 + +model: + name: Restormer +# sample_size: 128 + sample_size: 256 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false diff --git a/WWFDiff-PU/configs/restormer_noise_synpu_128_big.yaml b/WWFDiff-PU/configs/restormer_noise_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1c2b4499ea5872e6837339a4a12903e0c6481d9c --- /dev/null +++ b/WWFDiff-PU/configs/restormer_noise_synpu_128_big.yaml @@ -0,0 +1,88 @@ +seed: 42 + +loss_type: + name: RestormerLoss + +meter: + name: PUNetMeter + +mmodel: + name: RestormerMModel + +data: + name: SyntheticPUMat128BigNoise + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 + noise_snr: 0 +# noise_snr: 5 +# noise_snr: 20 +# noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 4 +# batch_size: 8 +# batch_size: 128 +# batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: Restormer + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/restormer_synpu_128_big.yaml b/WWFDiff-PU/configs/restormer_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..af2278c368733f7c6540963bfd115c73b3650d3f --- /dev/null +++ b/WWFDiff-PU/configs/restormer_synpu_128_big.yaml @@ -0,0 +1,88 @@ +seed: 42 + +loss_type: + name: RestormerLoss + +meter: + name: PUNetMeter + +mmodel: + name: RestormerMModel + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 + noise_snr: 0 +# noise_snr: 5 +# noise_snr: 20 +# noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 + batch_size: 4 +# batch_size: 8 +# batch_size: 128 +# batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: Restormer + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/restormer_synpu_128_mid.yaml b/WWFDiff-PU/configs/restormer_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6c9550df232adda0c860a3b756068f70a20e4452 --- /dev/null +++ b/WWFDiff-PU/configs/restormer_synpu_128_mid.yaml @@ -0,0 +1,84 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: RestormerLoss + +meter: + name: RestormerMeter + +mmodel: + name: RestormerMModel + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 2 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 + batch_size: 4 +# batch_size: 128 +# batch_size: 32 +# batch_size: 16 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: Restormer + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 8 + +test: + device: cuda + batch_size: 8 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/sqd_lstm_dlpu_256_big.yaml b/WWFDiff-PU/configs/sqd_lstm_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..064caa684335b45d326921152187cc9e3ccfce54 --- /dev/null +++ b/WWFDiff-PU/configs/sqd_lstm_dlpu_256_big.yaml @@ -0,0 +1,85 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: + name: PUNetMeter + +mmodel: + name: SqdLstmMModel + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 0 + std: 0 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 4 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false +# snapshot_val: true + snapshot_val: false +# snapshot_val_freq: 100 + snapshot_val_freq: 20 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 0.1 + +model: + name: SqdLstmNet +# sample_size: 128 + sample_size: 256 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false diff --git a/WWFDiff-PU/configs/sqd_lstm_noise_synpu_128_big.yaml b/WWFDiff-PU/configs/sqd_lstm_noise_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d41298fc7d7b22f81de2efcd73609eacc29fa5a2 --- /dev/null +++ b/WWFDiff-PU/configs/sqd_lstm_noise_synpu_128_big.yaml @@ -0,0 +1,88 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: + name: PUNetMeter + +mmodel: + name: SqdLstmMModel + +data: + name: SyntheticPUMat128BigNoise + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 +# noise_snr: 30 +# noise_snr: 5 + noise_snr: 0 +# noise_snr: 20 +# noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: SqdLstmNet + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/sqd_lstm_noise_synpu_128_mid.yaml b/WWFDiff-PU/configs/sqd_lstm_noise_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c121861277e0b0f5afb385a5ec99c2dbc5b739cb --- /dev/null +++ b/WWFDiff-PU/configs/sqd_lstm_noise_synpu_128_mid.yaml @@ -0,0 +1,89 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: +# name: SqdLstmMeter + name: SqdLstmMeter + +mmodel: +# name: SqdLstmMModel + name: SqdLstmMModel + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest +# name: SyntheticPUMat128Wav + name: SyntheticPUMat128Noise + image_size: 128 + color_channels: 1 + num_workers: 4 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 1024 +# batch_size: 256 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: true + snapshot_val_freq: 100 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 0.05 + +model: + name: SqdLstmNet + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/sqd_lstm_synpu_128_big.yaml b/WWFDiff-PU/configs/sqd_lstm_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6c36dee19f03cc063ac6278f7193a6b278cf7074 --- /dev/null +++ b/WWFDiff-PU/configs/sqd_lstm_synpu_128_big.yaml @@ -0,0 +1,83 @@ +seed: 42 + +loss_type: + name: DLPULoss + +meter: + name: PUNetMeter + +mmodel: + name: SqdLstmMModel + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: SqdLstmNet + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/sqd_lstm_synpu_128_mid.yaml b/WWFDiff-PU/configs/sqd_lstm_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dd5d736c757fa946644c1229d56ee921ed8d33a5 --- /dev/null +++ b/WWFDiff-PU/configs/sqd_lstm_synpu_128_mid.yaml @@ -0,0 +1,86 @@ +seed: 42 + +loss_type: +# name: PHY11 +# name: SqdLstmLoss + name: DLPULoss + +meter: +# name: SqdLstmMeter + name: SqdLstmMeter + +mmodel: +# name: SqdLstmMModel + name: SqdLstmMModel + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav + image_size: 128 + color_channels: 1 + num_workers: 4 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 1024 +# batch_size: 256 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: SqdLstmNet + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/u3net_dlpu_256_big.yaml b/WWFDiff-PU/configs/u3net_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6899cfe135c6032b8a6c91456fda61388ed4735b --- /dev/null +++ b/WWFDiff-PU/configs/u3net_dlpu_256_big.yaml @@ -0,0 +1,85 @@ +seed: 42 + +loss_type: + name: U3NetLoss + +meter: + name: PUNetMeter + +mmodel: + name: U3NetMModel + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 0 + std: 0 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 4 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false +# snapshot_val: true + snapshot_val: false +# snapshot_val_freq: 100 + snapshot_val_freq: 20 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 0.1 + +model: + name: U3Net +# sample_size: 128 + sample_size: 256 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false diff --git a/WWFDiff-PU/configs/u3net_noise_synpu_128_big.yaml b/WWFDiff-PU/configs/u3net_noise_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..63c110be5effd8c817d3db2148662defd98bb8de --- /dev/null +++ b/WWFDiff-PU/configs/u3net_noise_synpu_128_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +loss_type: + name: U3NetLoss + +meter: + name: PUNetMeter + +mmodel: + name: U3NetMModel + +data: + name: SyntheticPUMat128BigNoise + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 +# noise_snr: 0 +# noise_snr: 5 +# noise_snr: 20 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: U3Net + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/u3net_synpu_128_big.yaml b/WWFDiff-PU/configs/u3net_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..39dd684dff1512f5f0a733eb260d751de2a94123 --- /dev/null +++ b/WWFDiff-PU/configs/u3net_synpu_128_big.yaml @@ -0,0 +1,83 @@ +seed: 42 + +loss_type: + name: U3NetLoss + +meter: + name: PUNetMeter + +mmodel: + name: U3NetMModel + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: U3Net + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/u3net_synpu_128_mid.yaml b/WWFDiff-PU/configs/u3net_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5588b07adf7f078157c1259df804b845b3ab91ff --- /dev/null +++ b/WWFDiff-PU/configs/u3net_synpu_128_mid.yaml @@ -0,0 +1,90 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: U3NetLoss + +meter: + name: U3NetMeter + +mmodel: + name: U3NetMModel + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Fdu + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 +# k_max: 3 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 32 +# batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 50 + snapshot_sampling: false + snapshot_val: true +# snapshot_val: true + snapshot_val_freq: 50 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: U3Net + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/uformer_dlpu_256_big.yaml b/WWFDiff-PU/configs/uformer_dlpu_256_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..23c3f53b745c73f0e723a12d9556088640407a1d --- /dev/null +++ b/WWFDiff-PU/configs/uformer_dlpu_256_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +loss_type: + name: UformerLoss + +meter: + name: PUNetMeter + +mmodel: + name: UformerMModel + +data: + name: InSARDLPUMat256Big + image_size: 256 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 0 + std: 0 + scale_alpha: 1 + noise_snr: 100 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 4 +# batch_size: 32 +# batch_size: 8 + batch_size: 4 + use_all_data: false + amp: true + log_freq: 1 +# snapshot_freq: 100 + snapshot_freq: 20 + snapshot_sampling: false +# snapshot_val: true + snapshot_val: false +# snapshot_val_freq: 100 + snapshot_val_freq: 20 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 0.1 + +model: + name: Uformer +# sample_size: 128 + sample_size: 256 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false diff --git a/WWFDiff-PU/configs/uformer_noise_synpu_128_big.yaml b/WWFDiff-PU/configs/uformer_noise_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..57d43d6231102de6fcc6cb969b0196f88aec391e --- /dev/null +++ b/WWFDiff-PU/configs/uformer_noise_synpu_128_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +loss_type: + name: UformerLoss + +meter: + name: PUNetMeter + +mmodel: + name: UformerMModel + +data: + name: SyntheticPUMat128BigNoise + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 + noise_snr: 0 +# noise_snr: 5 +# noise_snr: 20 +# noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: Uformer + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/uformer_synpu_128_big.yaml b/WWFDiff-PU/configs/uformer_synpu_128_big.yaml new file mode 100644 index 0000000000000000000000000000000000000000..00989a255b28666145a02e51dd3fd48a932f9bed --- /dev/null +++ b/WWFDiff-PU/configs/uformer_synpu_128_big.yaml @@ -0,0 +1,87 @@ +seed: 42 + +loss_type: + name: UformerLoss + +meter: + name: PUNetMeter + +mmodel: + name: UformerMModel + +data: + name: SyntheticPUMat128Big + image_size: 128 + color_channels: 1 + num_workers: 1 + k_min: 0 + k_max: 7 + wavelet_level: 1 + wavelet_type: haar + mean: 10.0180 + std: 5.7466 + scale_alpha: 1 +# noise_snr: 10 +# noise_snr: 0 +# noise_snr: 5 +# noise_snr: 20 + noise_snr: 30 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 +# batch_size: 128 + batch_size: 8 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 20 + snapshot_sampling: false + snapshot_val: false + snapshot_val_freq: 1 + snapshot_batch_size: 32 + snapshot_best_loss: true + best_evaluate_loss: 9 + +model: + name: Uformer + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 10 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 32 + +test: + device: cuda + batch_size: 2 + total_samples: 30 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/configs/uformer_synpu_128_mid.yaml b/WWFDiff-PU/configs/uformer_synpu_128_mid.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4688ce2def5c0c42d10256a0d52ccf8e9f379e14 --- /dev/null +++ b/WWFDiff-PU/configs/uformer_synpu_128_mid.yaml @@ -0,0 +1,84 @@ +seed: 42 + +loss_type: +# name: PHY11 + name: UformerLoss + +meter: + name: UformerMeter + +mmodel: + name: UformerMModel + +data: +# name: SyntheticPUMatCut32Mch +# name: SyntheticPUMatCut32MchTest + name: SyntheticPUMat128Wav + image_size: 128 + color_channels: 1 + num_workers: 4 + k_min: 0 +# k_max: 3 + k_max: 6 + wavelet_level: 3 + wavelet_type: db4 + mean: 10.0180 + std: 5.7466 + scale_alpha: 2 + +training: + device: cuda + brand_new_epochs: 100001 + continue_training_epochs: 1000001 +# batch_size: 128 +# batch_size: 8 + batch_size: 32 +# batch_size: 128 +# batch_size: 32 +# batch_size: 16 + use_all_data: false + amp: true + log_freq: 1 + snapshot_freq: 100 + snapshot_sampling: false + snapshot_val: false + snapshot_batch_size: 32 + +model: + name: Uformer + sample_size: 128 +# in_channels: 1 +# out_channels: 1 +# layers_per_block: 2 +# block_out_channels: [64, 128, 256, 512] + +sampling: + device: cuda + batch_size: 1 + total_samples: 16 + record_freq: 1 + eps: 1e-5 + fix_seed: true + +val: + device: cuda + batch_size: 128 + +test: + device: cuda + batch_size: 128 + +optim: + optimizer: Adam + lr: 0.0001 + weight_decay: 0.0001 + beta1: 0.9 + eps: 1e-8 + warmup: 2 + grad_clip: 1.0 + momentum: 0.9 + +iio: + use_tensorboard: true + use_wandb: false + save_pth_to_wandb: false \ No newline at end of file diff --git a/WWFDiff-PU/data/.gitkeep b/WWFDiff-PU/data/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/WWFDiff-PU/dataset/InSARDLPUMat.py b/WWFDiff-PU/dataset/InSARDLPUMat.py new file mode 100644 index 0000000000000000000000000000000000000000..c27a52c5dfd19316a671c58f42984e8d0a2690a3 --- /dev/null +++ b/WWFDiff-PU/dataset/InSARDLPUMat.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- + +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + +from utils.util import multi_scale_wavelet + + +class InSARDLPUMat(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + k_min = 0, + k_max = 3, + wavelet_level = 3, + wavelet_type = 'db4', + mean = 10.01, + std = 5.74, + scale_alpha = 2, + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + self.scale_k = k_max - k_min + self.k_min = k_min + self.k_max = k_max + self.wavelet_level = wavelet_level + self.wavelet_type = wavelet_type + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_wrapped" + self.unwrapped_dir = self.data_root / f"{split}_absolute" + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['output'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + + # unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + # unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + # neg_norm_diffusion + unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + # wrapped_cond + # sin_wrapped = multi_scale_wavelet(torch.sin(wrapped), self.wavelet_type, level=self.wavelet_level) + # cos_wrapped = multi_scale_wavelet(torch.cos(wrapped), self.wavelet_type, level=self.wavelet_level) + sin_wrapped = torch.sin(wrapped) + cos_wrapped = torch.cos(wrapped) + wrapped_cond = torch.cat([sin_wrapped, cos_wrapped], dim=0) + + sample = { + "wrapped": wrapped, + "unwrapped": unwrapped, + "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_neg_norm": wrapped_neg_norm, + "wrapped_cond": wrapped_cond, + } + + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/InSARDLPUMatV1.py b/WWFDiff-PU/dataset/InSARDLPUMatV1.py new file mode 100644 index 0000000000000000000000000000000000000000..8a4506ef996904250e423b8c07d3b308acdcbbef --- /dev/null +++ b/WWFDiff-PU/dataset/InSARDLPUMatV1.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- + +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + +from utils.util import multi_scale_wavelet + + +class InSARDLPUMatV1(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + k_min = 0, + k_max = 3, + wavelet_level = 3, + wavelet_type = 'db4', + mean = 10.01, + std = 5.74, + scale_alpha = 2, + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + self.scale_k = k_max - k_min + self.k_min = k_min + self.k_max = k_max + self.wavelet_level = wavelet_level + self.wavelet_type = wavelet_type + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_wrapped" + self.unwrapped_dir = self.data_root / f"{split}_absolute" + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['output'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + + # unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + # unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + # neg_norm_diffusion + unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + # wrapped_cond + # sin_wrapped = multi_scale_wavelet(torch.sin(wrapped), self.wavelet_type, level=self.wavelet_level) + # cos_wrapped = multi_scale_wavelet(torch.cos(wrapped), self.wavelet_type, level=self.wavelet_level) + # sin_wrapped = torch.sin(wrapped) + # cos_wrapped = torch.cos(wrapped) + # wrapped_cond = torch.cat([sin_wrapped, cos_wrapped], dim=0) + + # #abla + wrapped_cond = wrapped / torch.pi + + + sample = { + "wrapped": wrapped, + "unwrapped": unwrapped, + "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_neg_norm": wrapped_neg_norm, + "wrapped_cond": wrapped_cond, + } + + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/old/InSARDLPUMatCut.py b/WWFDiff-PU/dataset/old/InSARDLPUMatCut.py new file mode 100644 index 0000000000000000000000000000000000000000..17f163ad90035edd658785e20766645bc5a3ec5e --- /dev/null +++ b/WWFDiff-PU/dataset/old/InSARDLPUMatCut.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- + +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + + +class InSARDLPUMatCut(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + k_max=3, + k_min=0 + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + self.scale_k = k_max - k_min + self.k_min = k_min + self.k_max = k_max + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_wrapped" + self.unwrapped_dir = self.data_root / f"{split}_absolute" + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['output'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + + sample = { + "wrapped": wrapped, + "unwrapped": unwrapped, + "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_neg_norm": wrapped_neg_norm, + "wrapped_cond": wrapped_cond, + } + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/old/InSARDLPUPng.py b/WWFDiff-PU/dataset/old/InSARDLPUPng.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/WWFDiff-PU/dataset/old/SyntheticData.py b/WWFDiff-PU/dataset/old/SyntheticData.py new file mode 100644 index 0000000000000000000000000000000000000000..d9c9f33b8f8d48f39ba5c1a02847d7a1033c6217 --- /dev/null +++ b/WWFDiff-PU/dataset/old/SyntheticData.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- + +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + + +class SyntheticData(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + scale_k=5 + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + self.K = scale_k + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_wrapped" + self.unwrapped_dir = self.data_root / f"{split}_unwrapped" + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['wrapped'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['unwrapped'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + K = self.K # k range 3-5 + # wrapped = wrapped + torch.pi + # wrapped_norm = wrapped / torch.pi + unwrapped_neg_norm = unwrapped / (torch.pi * K) + unwrapped_neg_norm = torch.clamp(unwrapped_neg_norm, -1, 1) + unwrapped_norm = (unwrapped_neg_norm + 1) / 2 + # wrapped_cond = torch.stack([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + # wrapped_cond = wrapped / (2 * torch.pi) + wrapped_cond = wrapped / torch.pi + + unwrapped_sub_wrapped = unwrapped - wrapped + unwrapped_sub_wrapped_norm = unwrapped_sub_wrapped / (torch.pi * K) + unwrapped_sub_wrapped_norm = torch.clamp(unwrapped_sub_wrapped_norm, 0, 1) + + sample = { + "wrapped": wrapped, + # "wrapped_fp16": wrapped.to(torch.float16), + "unwrapped": unwrapped, + # "unwrapped_fp16": unwrapped.to(torch.float16), + # "wrapped_norm": wrapped_norm, + # "wrapped_norm_fp16": wrapped_norm.to(torch.float16), + "unwrapped_norm": unwrapped_norm, + "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_cond": wrapped_cond, + # "wrapped_cond_fp16": wrapped_cond.to(torch.float16), + "unwrapped_sub_wrapped": unwrapped_sub_wrapped, + # "unwrapped_sub_wrapped_fp16": unwrapped_sub_wrapped.to(torch.float16), + "unwrapped_sub_wrapped_norm": unwrapped_sub_wrapped_norm, + # "unwrapped_sub_wrapped_norm_fp16": unwrapped_sub_wrapped_norm.to(torch.float16) + } + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/old/SyntheticPUMatCut.py b/WWFDiff-PU/dataset/old/SyntheticPUMatCut.py new file mode 100644 index 0000000000000000000000000000000000000000..76103d543890eca00f75bb60452034499f0d83bc --- /dev/null +++ b/WWFDiff-PU/dataset/old/SyntheticPUMatCut.py @@ -0,0 +1,151 @@ +# -*- coding: utf-8 -*- + +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + + +class SyntheticPUMatCut(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + k_min = 0, + k_max = 3, + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + self.scale_k = k_max - k_min + self.k_min = k_min + self.k_max = k_max + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_in" + self.unwrapped_dir = self.data_root / f"{split}_gt" + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['gt'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + # k_mat_cont = (unwrapped - wrapped) / (2 * torch.pi) # [-0.5, inf] + # k_mat_cont_plus_one = k_mat_cont + 1.0 # [0.5, inf] + # k_mat_cont_neg_norm = ((k_mat_cont_plus_one - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-2, 1], problematic + # k_mat_cont_neg_norm = ((k_mat_cont - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-2, 1], problematic + # k_mat_cont_neg_norm = torch.clamp(k_mat_cont_neg_norm, min= -1, max= 1) # [-1, 1] + # k_mat_disc = torch.round(k_mat_cont) # [0, inf] + # k_mat_disc_plus_one = torch.round(k_mat_cont_plus_one) + # k_mat_disc_neg_norm = ((k_mat_disc - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-1, 1] + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + # wrapped = wrapped + torch.pi + # wrapped_norm = wrapped / torch.pi + + # wrapped_cond = torch.stack([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + # wrapped_cond = wrapped / (2 * torch.pi) + # wrapped_cond = wrapped / torch.pi + + # neg_norm_diffusion + unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + # dfn_diffusion + # unwrapped_sub_wrapped = unwrapped - wrapped + # unwrapped_sub_wrapped_norm = unwrapped_sub_wrapped / (2 * torch.pi * self.scale_k) + # unwrapped_sub_wrapped_norm = torch.clamp(unwrapped_sub_wrapped_norm, 0, 1) + # unwrapped_sub_wrapped_neg_norm = unwrapped_sub_wrapped_norm * 2 - 1 + + # wrapped_cond + # wrapped_cond = wrapped_neg_norm + # wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped), wrapped], dim=0) + # wrapped_cond = unwrapped + # wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped), wrapped_neg_norm], dim=0) + # wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped), k_mat_disc_neg_norm], dim=0) + # one_mat = torch.ones_like(wrapped_neg_norm) + # cond_one_mat = [one_mat, one_mat, one_mat, one_mat, one_mat, one_mat, -one_mat] + # # wrapped_cond = torch.cat([wrapped_neg_norm, *cond_one_mat], dim=0) + # zero_mat = torch.zeros_like(wrapped_neg_norm) + # cond_zero_mat = [zero_mat, zero_mat, zero_mat, zero_mat, zero_mat, zero_mat, zero_mat] + # wrapped_cond = torch.cat([wrapped_neg_norm, *cond_one_mat, *cond_zero_mat], dim=0) + wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + # wrapped_cond = torch.cat([unwrapped_neg_norm, -unwrapped_neg_norm], dim=0) + # wrapped_cond = torch.cat([k_mat_cont_neg_norm, -k_mat_cont_neg_norm], dim=0) + # wrapped_cond = torch.cat([k_mat_cont_neg_norm, -k_mat_cont_neg_norm], dim=0) + + + sample = { + "wrapped": wrapped, + # "wrapped_fp16": wrapped.to(torch.float16), + "unwrapped": unwrapped, + # "k_mat_cont": k_mat_cont, + # "k_mat_cont_neg_norm": k_mat_cont_neg_norm, + # "k_mat_disc": k_mat_disc, + # "k_mat_disc_neg_norm": k_mat_disc_neg_norm, + # "unwrapped_fp16": unwrapped.to(torch.float16), + # "wrapped_norm": wrapped_norm, + # "wrapped_norm_fp16": wrapped_norm.to(torch.float16), + # "unwrapped_norm": unwrapped_norm, + "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_neg_norm": wrapped_neg_norm, + "wrapped_cond": wrapped_cond, + # "wrapped_cond_fp16": wrapped_cond.to(torch.float16), + # "unwrapped_sub_wrapped": unwrapped_sub_wrapped, + # "unwrapped_sub_wrapped_fp16": unwrapped_sub_wrapped.to(torch.float16), + # "unwrapped_sub_wrapped_norm": unwrapped_sub_wrapped_norm, + # "unwrapped_sub_wrapped_neg_norm": unwrapped_sub_wrapped_neg_norm, + # "unwrapped_sub_wrapped_norm_fp16": unwrapped_sub_wrapped_norm.to(torch.float16) + } + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/old/SyntheticPUMatCutGrad.py b/WWFDiff-PU/dataset/old/SyntheticPUMatCutGrad.py new file mode 100644 index 0000000000000000000000000000000000000000..777cebbdd95d0c3f9b4d4fd88ba88b806edb81dd --- /dev/null +++ b/WWFDiff-PU/dataset/old/SyntheticPUMatCutGrad.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +import os +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset +import torch.nn.functional as F + +class SyntheticPUMatCutGrad(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + k_min = 0, + k_max = 3, + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + self.scale_k = k_max - k_min + self.k_min = k_min + self.k_max = k_max + + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_in" + self.unwrapped_dir = self.data_root / f"{split}_gt" + + # print(os.listdir(self.wrapped_dir)) + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + # print(wrapped_files) + # print(unwrapped_files) + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def phase_gradient_torch(self, phase): + """ + Args: + phase: torch.Tensor, shape (H, W) or (B, 1, H, W) + + Returns: + gx, gy: real-valued gradients + """ + + # gx = phase[..., :, 1:] - phase[..., :, :-1] + # gy = phase[..., 1:, :] - phase[..., :-1, :] + phase.unsqueeze(0) + + kx = torch.tensor( + [[0, 0, 0], + [-1, 1, 0], + [0, 0, 0]], + device=phase.device, dtype=phase.dtype + ).view(1, 1, 3, 3) + + gx = F.conv2d(phase, kx, padding=1, groups=1, stride=1) + gx[..., :, 0] = gx[..., :, 1] - (gx[..., :, 2] - gx[..., :, 1]) + + ky = torch.tensor( + [[0, -1, 0], + [0, 1, 0], + [0, 0, 0]], + device=phase.device, dtype=phase.dtype + ).view(1, 1, 3, 3) + gy = F.conv2d(phase, ky, padding=1, groups=1, stride=1) + gy[..., 0, :] = gy[..., 1, :] - (gy[..., 2, :] - gy[..., 1, :]) + + return gx, gy + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['gt'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + unwrapped_grad_x , unwrapped_grad_y = self.phase_gradient_torch(unwrapped_neg_norm) # [-2,2] + # unwrapped_grad_x_neg_norm = unwrapped_grad_x / 2 # [-1,1] + # unwrapped_grad_y_neg_norm = unwrapped_grad_y / 2 # [-1,1] + unwrapped_grad_neg_norm = torch.cat([unwrapped_grad_x, unwrapped_grad_y], dim=0) * 8 + # unwrapped_grad_neg_norm = torch.cat([unwrapped_grad_x, unwrapped_grad_y], dim=0) + # print(f"unwrapped_grad_x shape: {unwrapped_grad_x.shape}, unwrapped_grad_y shape: {unwrapped_grad_y.shape}") + # unwrapped_grad_neg_norm = torch.cat([unwrapped_grad_x, unwrapped_grad_y], dim=0) / 2 + + wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + + sample = { + "wrapped": wrapped, + "unwrapped": unwrapped, + "wrapped_neg_norm": wrapped_neg_norm, + "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_cond": wrapped_cond, + "unwrapped_grad_neg_norm": unwrapped_grad_neg_norm + } + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/old/SyntheticPUMatCutMid.py b/WWFDiff-PU/dataset/old/SyntheticPUMatCutMid.py new file mode 100644 index 0000000000000000000000000000000000000000..ca9e8b4f9113ae62b9d5e583d23ccd00f07f8d36 --- /dev/null +++ b/WWFDiff-PU/dataset/old/SyntheticPUMatCutMid.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +import os +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + + +class SyntheticPUMatCutMid(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + # k_min = 0, + # k_max = 3, + mean = 0, + std = 1 + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + # self.scale_k = k_max - k_min + # self.k_min = k_min + # self.k_max = k_max + self.mean = mean + self.std = std + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_in" + self.unwrapped_dir = self.data_root / f"{split}_gt" + + # print(os.listdir(self.wrapped_dir)) + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + # print(wrapped_files) + # print(unwrapped_files) + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['gt'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + + unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + # unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + # unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + # k_mat_cont = (unwrapped - wrapped) / (2 * torch.pi) # [-0.5, inf] + # k_mat_cont_plus_one = k_mat_cont + 1.0 # [0.5, inf] + # k_mat_cont_neg_norm = ((k_mat_cont_plus_one - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-2, 1], problematic + # k_mat_cont_neg_norm = ((k_mat_cont - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-2, 1], problematic + # k_mat_cont_neg_norm = torch.clamp(k_mat_cont_neg_norm, min= -1, max= 1) # [-1, 1] + # k_mat_disc = torch.round(k_mat_cont) # [0, inf] + # k_mat_disc_plus_one = torch.round(k_mat_cont_plus_one) + # k_mat_disc_neg_norm = ((k_mat_disc - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-1, 1] + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + + # wrapped = wrapped + torch.pi + # wrapped_norm = wrapped / torch.pi + + # wrapped_cond = torch.stack([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + # wrapped_cond = wrapped / (2 * torch.pi) + # wrapped_cond = wrapped / torch.pi + + # neg_norm_diffusion + # unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + unwrapped_norm = unwrapped / (2 * torch.pi * 3) + unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + # unwrapped_std_norm = (unwrapped - self.mean) / self.std # normalize + + # wrapped_cond + # wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped), wrapped], dim=0) + # wrapped_cond = unwrapped + # wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped), wrapped_neg_norm], dim=0) + wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + # wrapped_cond = torch.cat([torch.sin(unwrapped), torch.cos(unwrapped)], dim=0) + # wrapped_cond = torch.cat([unwrapped_neg_norm, -unwrapped_neg_norm], dim=0) + # wrapped_cond = wrapped_neg_norm + + # dfn_diffusion + # unwrapped_sub_wrapped = unwrapped - wrapped + # unwrapped_sub_wrapped_norm = unwrapped_sub_wrapped / (2 * torch.pi * self.scale_k) + # unwrapped_sub_wrapped_norm = torch.clamp(unwrapped_sub_wrapped_norm, 0, 1) + # unwrapped_sub_wrapped_neg_norm = unwrapped_sub_wrapped_norm * 2 - 1 + + sample = { + "wrapped": wrapped, + # "wrapped_fp16": wrapped.to(torch.float16), + "unwrapped": unwrapped, + # "k_mat_cont": k_mat_cont, + # "k_mat_cont_neg_norm": k_mat_cont_neg_norm, + # "k_mat_disc": k_mat_disc, + # "k_mat_disc_neg_norm": k_mat_disc_neg_norm, + "wrapped_neg_norm": wrapped_neg_norm, + # "unwrapped_fp16": unwrapped.to(torch.float16), + # "wrapped_norm": wrapped_norm, + # "wrapped_norm_fp16": wrapped_norm.to(torch.float16), + # "unwrapped_norm": unwrapped_norm, + # "unwrapped_std_norm": unwrapped_std_norm, + "unwrapped_std_norm": unwrapped_neg_norm, + # "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_cond": wrapped_cond, + # "wrapped_cond_fp16": wrapped_cond.to(torch.float16), + # "unwrapped_sub_wrapped": unwrapped_sub_wrapped, + # "unwrapped_sub_wrapped_fp16": unwrapped_sub_wrapped.to(torch.float16), + # "unwrapped_sub_wrapped_norm": unwrapped_sub_wrapped_norm, + # "unwrapped_sub_wrapped_neg_norm": unwrapped_sub_wrapped_neg_norm, + # "unwrapped_sub_wrapped_norm_fp16": unwrapped_sub_wrapped_norm.to(torch.float16) + } + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/old/SyntheticPUMatCutWav.py b/WWFDiff-PU/dataset/old/SyntheticPUMatCutWav.py new file mode 100644 index 0000000000000000000000000000000000000000..c2759efb8cfa694303901eabc7094b059f17300c --- /dev/null +++ b/WWFDiff-PU/dataset/old/SyntheticPUMatCutWav.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- + +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + +from utils.util import multi_scale_wavelet + + +class SyntheticPUMatCutWav(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + k_min = 0, + k_max = 3, + wavelet_level = 3, + wavelet_type = 'db4' + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + self.scale_k = k_max - k_min + self.k_min = k_min + self.k_max = k_max + self.wavelet_level = wavelet_level + self.wavelet_type = wavelet_type + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_in" + self.unwrapped_dir = self.data_root / f"{split}_gt" + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['gt'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + # neg_norm_diffusion + unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + # wrapped_cond + sin_wrapped = multi_scale_wavelet(torch.sin(wrapped), self.wavelet_type, level=self.wavelet_level) + cos_wrapped = multi_scale_wavelet(torch.cos(wrapped), self.wavelet_type, level=self.wavelet_level) + wrapped_cond = torch.cat([sin_wrapped, cos_wrapped], dim=0) + + sample = { + "wrapped": wrapped, + "unwrapped": unwrapped, + "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_neg_norm": wrapped_neg_norm, + "wrapped_cond": wrapped_cond, + } + return sample \ No newline at end of file diff --git a/WWFDiff-PU/dataset/old/SyntheticPUMatMid.py b/WWFDiff-PU/dataset/old/SyntheticPUMatMid.py new file mode 100644 index 0000000000000000000000000000000000000000..0225ecc79f086a4cb41221c08d3b66d95aa85b70 --- /dev/null +++ b/WWFDiff-PU/dataset/old/SyntheticPUMatMid.py @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- + +from pathlib import Path +from typing import Dict +import scipy.io as sio +import torch +from torch.utils.data import Dataset + + +class SyntheticPUMatMid(Dataset): + """ + InSARDLPU 数据集,Mat文件格式 + """ + + def __init__( + self, + root, + split='train', + transform=None, + target_transform=None, + joint_transform=None, + # k_min = 0, + # k_max = 3, + mean = 0, + std = 1 + ): + """ + Args: + root (str): 数据集根目录 + split (str): 'train' 或 'test' + transform (callable, optional): 对图像的变换 + target_transform (callable, optional): + joint_transform (callable, optional): + """ + # super().__init__(root, transform=transform, target_transform=target_transform) + super().__init__() + + assert split in ['train', 'test'], "split 必须是 'train' 或 'test'" + + # self.scale_k = k_max - k_min + # self.k_min = k_min + # self.k_max = k_max + self.mean = mean + self.std = std + + self.transform = transform + self.target_transform = target_transform + self.joint_transform = joint_transform + + self.data_root = Path(root) + + self.wrapped_dir = self.data_root / f"{split}_in" + self.unwrapped_dir = self.data_root / f"{split}_gt" + + wrapped_files = {p.stem: p for p in self.wrapped_dir.glob("*.mat")} + unwrapped_files = {p.stem: p for p in self.unwrapped_dir.glob("*.mat")} + self.keys = sorted(set(wrapped_files).intersection(unwrapped_files)) + if not self.keys: + raise FileNotFoundError(f"No paired files found under {self.data_root} for split {split}") + + self.paths = { + "wrapped": wrapped_files, + "unwrapped": unwrapped_files, + } + + def __len__(self) -> int: + return len(self.keys) + + def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]: + key = self.keys[idx] + wrapped = sio.loadmat(str(self.paths["wrapped"][key]))['input'] + unwrapped = sio.loadmat(str(self.paths["unwrapped"][key]))['gt'] + wrapped = torch.as_tensor(wrapped).unsqueeze(0) + unwrapped = torch.as_tensor(unwrapped).unsqueeze(0) + + if self.joint_transform: + wrapped, unwrapped = self.joint_transform(wrapped, unwrapped) + if self.transform: + wrapped = self.transform(wrapped) + if self.target_transform: + unwrapped = self.target_transform(unwrapped) + + # unwrapped = unwrapped - (torch.min(unwrapped) // (torch.pi * 2)) * (torch.pi * 2) + # unwrapped = torch.clamp(unwrapped, min=0.0) # [0, inf] + # k_mat_cont = (unwrapped - wrapped) / (2 * torch.pi) # [-0.5, inf] + # k_mat_cont_plus_one = k_mat_cont + 1.0 # [0.5, inf] + # k_mat_cont_neg_norm = ((k_mat_cont_plus_one - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-2, 1], problematic + # k_mat_cont_neg_norm = ((k_mat_cont - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-2, 1], problematic + # k_mat_cont_neg_norm = torch.clamp(k_mat_cont_neg_norm, min= -1, max= 1) # [-1, 1] + # k_mat_disc = torch.round(k_mat_cont) # [0, inf] + # k_mat_disc_plus_one = torch.round(k_mat_cont_plus_one) + # k_mat_disc_neg_norm = ((k_mat_disc - self.k_min) / (self.k_max - self.k_min)) * 2 - 1 # [-1, 1] + + wrapped_neg_norm = wrapped / torch.pi + wrapped_neg_norm = torch.clamp(wrapped_neg_norm, -1, 1) + + + # wrapped = wrapped + torch.pi + # wrapped_norm = wrapped / torch.pi + + # wrapped_cond = torch.stack([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + # wrapped_cond = wrapped / (2 * torch.pi) + # wrapped_cond = wrapped / torch.pi + + # neg_norm_diffusion + # unwrapped_norm = unwrapped / (2 * torch.pi * self.scale_k) + # unwrapped_norm = torch.clamp(unwrapped_norm, 0, 1) + # unwrapped_neg_norm = unwrapped_norm * 2 - 1 + + unwrapped_std_norm = (unwrapped - self.mean) / self.std # normalize + + # wrapped_cond + # wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped), wrapped], dim=0) + # wrapped_cond = unwrapped + # wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped), wrapped_neg_norm], dim=0) + wrapped_cond = torch.cat([torch.sin(wrapped), torch.cos(wrapped)], dim=0) + # wrapped_cond = torch.cat([torch.sin(unwrapped), torch.cos(unwrapped)], dim=0) + # wrapped_cond = torch.cat([unwrapped_neg_norm, -unwrapped_neg_norm], dim=0) + # wrapped_cond = wrapped_neg_norm + + # dfn_diffusion + # unwrapped_sub_wrapped = unwrapped - wrapped + # unwrapped_sub_wrapped_norm = unwrapped_sub_wrapped / (2 * torch.pi * self.scale_k) + # unwrapped_sub_wrapped_norm = torch.clamp(unwrapped_sub_wrapped_norm, 0, 1) + # unwrapped_sub_wrapped_neg_norm = unwrapped_sub_wrapped_norm * 2 - 1 + + sample = { + "wrapped": wrapped, + # "wrapped_fp16": wrapped.to(torch.float16), + "unwrapped": unwrapped, + # "k_mat_cont": k_mat_cont, + # "k_mat_cont_neg_norm": k_mat_cont_neg_norm, + # "k_mat_disc": k_mat_disc, + # "k_mat_disc_neg_norm": k_mat_disc_neg_norm, + "wrapped_neg_norm": wrapped_neg_norm, + # "unwrapped_fp16": unwrapped.to(torch.float16), + # "wrapped_norm": wrapped_norm, + # "wrapped_norm_fp16": wrapped_norm.to(torch.float16), + # "unwrapped_norm": unwrapped_norm, + "unwrapped_std_norm": unwrapped_std_norm, + # "unwrapped_neg_norm": unwrapped_neg_norm, + "wrapped_cond": wrapped_cond, + # "wrapped_cond_fp16": wrapped_cond.to(torch.float16), + # "unwrapped_sub_wrapped": unwrapped_sub_wrapped, + # "unwrapped_sub_wrapped_fp16": unwrapped_sub_wrapped.to(torch.float16), + # "unwrapped_sub_wrapped_norm": unwrapped_sub_wrapped_norm, + # "unwrapped_sub_wrapped_neg_norm": unwrapped_sub_wrapped_neg_norm, + # "unwrapped_sub_wrapped_norm_fp16": unwrapped_sub_wrapped_norm.to(torch.float16) + } + return sample \ No newline at end of file diff --git a/upload_3.py b/upload_3.py new file mode 100644 index 0000000000000000000000000000000000000000..3e08440e0dfc8de43cfc8ce412493cb85b31d797 --- /dev/null +++ b/upload_3.py @@ -0,0 +1,7 @@ +from huggingface_hub import login, upload_folder + +# (optional) Login with your Hugging Face credentials +login() + +# Push your model files +upload_folder(folder_path=".", repo_id="lighta/WWFDiff-PU", repo_type="model")