reflectorch 1.3.0__tar.gz → 1.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflectorch might be problematic. Click here for more details.
- reflectorch-1.4.0/CONTRIBUTING.md +28 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/PKG-INFO +3 -2
- {reflectorch-1.3.0 → reflectorch-1.4.0}/README.md +2 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/pyproject.toml +3 -3
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/__init__.py +2 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/parametric_models.py +1 -1
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/q_generator.py +70 -36
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/utils.py +1 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/inference_model.py +711 -188
- reflectorch-1.4.0/reflectorch/inference/loading_data.py +37 -0
- reflectorch-1.4.0/reflectorch/inference/plotting.py +517 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/preprocess_exp/interpolation.py +5 -2
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/scipy_fitter.py +19 -5
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/trainers.py +9 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/__init__.py +1 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/encoders/__init__.py +2 -0
- reflectorch-1.4.0/reflectorch/models/encoders/integral_kernel_embedding.py +390 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/networks/mlp_networks.py +10 -4
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/runs/utils.py +5 -2
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/utils.py +30 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch.egg-info/PKG-INFO +3 -2
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch.egg-info/SOURCES.txt +3 -0
- reflectorch-1.3.0/reflectorch/inference/plotting.py +0 -98
- {reflectorch-1.3.0 → reflectorch-1.4.0}/.dockerignore +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/.github/workflows/ci.yml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/.github/workflows/draft-pdf.yml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/.gitignore +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/CODE_OF_CONDUCT.md +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/Dockerfile +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/LICENSE.txt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/MANIFEST.in +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/a_base_point_neutron_conv_standard.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/a_base_point_xray_conv_absorption.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/a_base_point_xray_conv_standard.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L1_InputDq.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L1_InputQDq.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L1_comp.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L2_InputDq.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L2_InputQDq.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L2_comp.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L3_InputDq.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L3_InputQDq.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L3_comp.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L4_comp.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_neutron_conv_standard_L5_comp.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/b_mc_point_xray_conv_standard_L2_InputQ.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c1_trained.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_L10_d100_s150_r30_ws5_q03_nq256.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_L3_d200_s150_r60_ws5_q03_nq128.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_L5_d200_s150_r60_ws5_q03_nq256.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_absorption.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_absorption_L2_d500_s150_is30_r60_ws5_q03_nq256.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_absorption_L5_d200_s150_is30_r60_ws5_q03_nq256.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_ae.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_fno.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_model_with_shifts.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_repeating_multilayer.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/c_repeating_multilayer_trained1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/e_mc_point_neutron_conv_standard_L1_InputQDq_n128_size1024.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/e_mc_point_neutron_conv_standard_L1_InputQDq_n256_size1024.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q109_exp_1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_absorption_1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_exp_2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_exp_3.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_exp_3_02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_exp_4.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_exp_5.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_exp_sm_2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q256_new_1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l2q64_new_sub_1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/l5q256_new_sub_1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o10.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o11.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o12.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o13.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o14.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o15.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o16.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o3.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o4.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o5.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o7.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o8.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc-o9.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc10.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc11.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc12.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc13.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc14.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc15.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc16.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc17.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc18.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc19.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc20.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc21.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc22.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc23.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc24.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc25.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc26.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc27.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc28.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc29.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc3.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc30.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc31.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc32.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc33.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc34.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc35.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc36.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc37.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc38.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc39.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc4.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc40.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc41.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc42.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc43.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc44.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc45.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc46.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc47.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc48.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc49.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc5.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc50.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc51.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc52.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc53.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc54.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc55.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc56.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc57.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc58.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc59.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc6.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc60.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc61.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc62.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc63.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc64.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc65.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc66.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc67.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc7.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc8.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/mc9.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/multilayer_test_1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/multilayer_test_1_1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/multilayer_test_2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/multilayer_test_2_2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/multilayer_test_3.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/time_val_exp_L2_q128-015_d500_r60_s25n_bs4_budist_noise-poisson02-sh03-sc002-qs1e3-qn1e3.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/time_val_sim_L5_q256_d300_r60_s25_bs4_budist_noise-poisson02_LONGER.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q128-015_d500_r60_s25n_bs4_budist_noise-poisson02-sh03-sc002-qs1e3-qn1e3.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q128_d300_r60_s25_bs4_budist_noise-poisson02-various-noises.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q128_d300_r60_s25_bs4_budist_noise-poisson02-various-noises2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q256_d300_r60_s25_bs4_budist_noise-poisson01.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q256_d300_r60_s25_bs4_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q256_d300_r60_s25_bs4_budist_noise-poisson03.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q64_d300_r60_s25_bs25_budist_noise-poisson03_scale002.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q64_d300_r60_s25_bs4_blogdist_noise-poisson04.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_exp_L2_q64_d300_r60_s25_bs4_budist_noise-poisson04.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_multilayer_V1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_multilayer_V2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_FNO_L2_q256_d300_r60_s25_bs4_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_FNO_L2_q256_d300_r60_s25_bs4_budist_noise-poisson02_V2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_FNO_L2_q256_d300_r60_s25_bs4_budist_noise-poisson02_varyQ.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_FNO_L2_q64-512_015-05_d300_r60_s25_bs4_budist_noise-poisson02_varyall.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_FNO_L2_q64-512_015-05_d500_r60_s25n_bs4_budist_noise-poisson02_varyall_V2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_br20_bs4_budist_noise-none.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_bs25_budist_noise-none.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_bs25_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_bs4_blogdist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_bs4_budist_noise-none.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_bs4_budist_noise-poisson02-hz512.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_bs4_budist_noise-poisson02-rb10.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L2_q256_d300_r60_s25_bs4_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L3_q256_d300_r60_s25_bs25_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L3_q256_d300_r60_s25_bs4_budist_noise-none.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L3_q256_d300_r60_s25_bs4_budist_noise-poisson02-TRY2.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L3_q256_d300_r60_s25_bs4_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L5_q1024_d300_r60_s25_bs4_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L5_q256_d300_r60_s25_bs25_budist_noise-poisson02.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L5_q256_d300_r60_s25_bs4_budist_noise-poisson02-Copy1.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/configs/val_sim_L5_q256_d300_r60_s25_bs4_budist_noise-poisson02_LONGER.yaml +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/debug.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/33a.dat +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/D17_SiO.dat +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/DIP-nSi_34a.dat +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/Ni500.dat +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/Ni_on_glass.dat +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/ORSO_example.ort +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/data_C60.pt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/data_C60.txt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/data_PTCDI-C3.pt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/exp_data/data_PTCDI-C3.txt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/dataset.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/likelihoods.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/noise.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/base.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/exp_subprior_sampler.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/independent_priors.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/multilayer_models.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/multilayer_structures.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/no_constraints.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/parametric_subpriors.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/params.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/sampler_strategies.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/scaler_mixin.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/subprior_sampler.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/utils.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/process_data.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/reflectivity/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/reflectivity/abeles.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/reflectivity/kinematical.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/reflectivity/memory_eff.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/reflectivity/numpy_implementations.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/reflectivity/smearing.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/reflectivity/smearing_pointwise.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/scale_curves.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/smearing.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/extensions/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/extensions/jupyter/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/extensions/jupyter/callbacks.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/extensions/matplotlib/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/extensions/matplotlib/losses.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/extensions/refnx/refnx_conversion.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/multilayer_fitter.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/multilayer_inference_model.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/preprocess_exp/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/preprocess_exp/attenuation.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/preprocess_exp/cut_with_q_ratio.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/preprocess_exp/footprint.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/preprocess_exp/normalize.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/preprocess_exp/preprocess.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/query_matcher.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/record_time.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/sampler_solution.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/inference/torch_fitter.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/basic_trainer.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/callbacks.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/dataloaders.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/loggers.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/schedulers.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/ml/utils.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/activations.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/encoders/conv_encoder.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/encoders/conv_res_net.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/encoders/fno.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/networks/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/models/networks/residual_net.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/paths.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/runs/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/runs/config.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/runs/slurm_utils.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/runs/train.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/test_config.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/train.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/train_on_cluster.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch.egg-info/dependency_links.txt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch.egg-info/requires.txt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch.egg-info/top_level.txt +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/setup.cfg +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/conftest.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/data/demo_scan.csv +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/fixtures/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/fixtures/data.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/__init__.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/test_dataloader.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/test_embedding_networks.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/test_mlp.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/test_preprocessing.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/test_prior_sampler.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/test_q_generator.py +0 -0
- {reflectorch-1.3.0 → reflectorch-1.4.0}/tests/unit/test_reflectivity.py +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Contributing to Reflectorch
|
|
2
|
+
|
|
3
|
+
## 1. Reporting Issues
|
|
4
|
+
|
|
5
|
+
If you encounter bugs, want to suggest features, or have questions, please open an issue using the [GitHub issue tracker](https://github.com/schreiber-lab/reflectorch/issues).
|
|
6
|
+
|
|
7
|
+
When reporting a bug, please include:
|
|
8
|
+
- A clear description of the issue
|
|
9
|
+
- Steps to reproduce the bug (if applicable)
|
|
10
|
+
- Any relevant error messages or screenshots
|
|
11
|
+
|
|
12
|
+
## 2. Contributing Code
|
|
13
|
+
|
|
14
|
+
To contribute code:
|
|
15
|
+
|
|
16
|
+
1. **Fork** the repository.
|
|
17
|
+
2. Make your changes in a new branch.
|
|
18
|
+
3. Ensure your code is clear and well-documented.
|
|
19
|
+
4. If applicable, add or update tests.
|
|
20
|
+
5. Submit a [pull request](https://github.com/schreiber-lab/reflectorch/pulls) with a description of your changes.
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
If your changes affect user-facing features, please update the documentation accordingly. Documentation is built using [Jupyter Book](https://jupyterbook.org/). You can build it locally using:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
jupyter-book build documentation
|
|
28
|
+
```
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reflectorch
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: A Pytorch-based package for the analysis of reflectometry data
|
|
5
5
|
Author-email: Vladimir Starostin <vladimir.starostin@uni-tuebingen.de>, Valentin Munteanu <valentin.munteanu@uni-tuebingen.de>
|
|
6
6
|
Maintainer-email: Valentin Munteanu <valentin.munteanu@uni-tuebingen.de>, Vladimir Starostin <vladimir.starostin@uni-tuebingen.de>, Alexander Hinderhofer <alexander.hinderhofer@uni-tuebingen.de>
|
|
7
|
-
License-Expression: MIT
|
|
8
7
|
Project-URL: Source, https://github.com/schreiber-lab/reflectorch/
|
|
9
8
|
Project-URL: Issues, https://github.com/schreiber-lab/reflectorch/issues
|
|
10
9
|
Project-URL: Documentation, https://schreiber-lab.github.io/reflectorch/
|
|
@@ -106,6 +105,8 @@ Configuration files and the corresponding pretrained model weights are hosted on
|
|
|
106
105
|
<!-- [](https://hub.docker.com/)
|
|
107
106
|
Docker images for reflectorch *will* be hosted on Dockerhub. -->
|
|
108
107
|
|
|
108
|
+
## Contributing
|
|
109
|
+
If you'd like to contribute to the package, please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
|
|
109
110
|
|
|
110
111
|
## Citation
|
|
111
112
|
If you find our work useful in your research, please cite as follows:
|
|
@@ -64,6 +64,8 @@ Configuration files and the corresponding pretrained model weights are hosted on
|
|
|
64
64
|
<!-- [](https://hub.docker.com/)
|
|
65
65
|
Docker images for reflectorch *will* be hosted on Dockerhub. -->
|
|
66
66
|
|
|
67
|
+
## Contributing
|
|
68
|
+
If you'd like to contribute to the package, please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
|
|
67
69
|
|
|
68
70
|
## Citation
|
|
69
71
|
If you find our work useful in your research, please cite as follows:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "reflectorch"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.4.0"
|
|
8
8
|
authors = [{name = "Vladimir Starostin", email = "vladimir.starostin@uni-tuebingen.de"},
|
|
9
9
|
{name = "Valentin Munteanu", email = "valentin.munteanu@uni-tuebingen.de"}
|
|
10
10
|
]
|
|
@@ -17,14 +17,14 @@ maintainers = [
|
|
|
17
17
|
description = "A Pytorch-based package for the analysis of reflectometry data"
|
|
18
18
|
keywords = ["reflectometry", "machine learning"]
|
|
19
19
|
readme = "README.md"
|
|
20
|
-
license = "
|
|
20
|
+
license = {file = "LICENSE"}
|
|
21
21
|
classifiers = [
|
|
22
22
|
"Programming Language :: Python :: 3",
|
|
23
23
|
"Operating System :: OS Independent",
|
|
24
24
|
"Environment :: GPU :: NVIDIA CUDA",
|
|
25
25
|
"Development Status :: 4 - Beta",
|
|
26
26
|
"Topic :: Scientific/Engineering :: Physics",
|
|
27
|
-
"Intended Audience :: Science/Research"
|
|
27
|
+
"Intended Audience :: Science/Research",
|
|
28
28
|
]
|
|
29
29
|
requires-python = ">=3.7"
|
|
30
30
|
dependencies = [
|
|
@@ -29,6 +29,7 @@ from reflectorch.data_generation.q_generator import (
|
|
|
29
29
|
ConstantQ,
|
|
30
30
|
VariableQ,
|
|
31
31
|
EquidistantQ,
|
|
32
|
+
MaskedVariableQ,
|
|
32
33
|
)
|
|
33
34
|
from reflectorch.data_generation.noise import (
|
|
34
35
|
QNoiseGenerator,
|
|
@@ -78,6 +79,7 @@ __all__ = [
|
|
|
78
79
|
"ConstantQ",
|
|
79
80
|
"VariableQ",
|
|
80
81
|
"EquidistantQ",
|
|
82
|
+
"MaskedVariableQ",
|
|
81
83
|
"QNoiseGenerator",
|
|
82
84
|
"IntensityNoiseGenerator",
|
|
83
85
|
"MultiplicativeLogNormalNoiseGenerator",
|
{reflectorch-1.3.0 → reflectorch-1.4.0}/reflectorch/data_generation/priors/parametric_models.py
RENAMED
|
@@ -37,7 +37,7 @@ class ParametricModel(object):
|
|
|
37
37
|
self.max_num_layers = max_num_layers
|
|
38
38
|
self._sampler_strategy = self._init_sampler_strategy(**kwargs)
|
|
39
39
|
|
|
40
|
-
def _init_sampler_strategy(self, **kwargs):
|
|
40
|
+
def _init_sampler_strategy(self, nuisance_params_dim: int = 0, **kwargs):
|
|
41
41
|
return BasicSamplerStrategy(**kwargs)
|
|
42
42
|
|
|
43
43
|
@property
|
|
@@ -16,6 +16,7 @@ __all__ = [
|
|
|
16
16
|
"VariableQ",
|
|
17
17
|
"EquidistantQ",
|
|
18
18
|
"ConstantAngle",
|
|
19
|
+
"MaskedVariableQ",
|
|
19
20
|
]
|
|
20
21
|
|
|
21
22
|
|
|
@@ -124,6 +125,11 @@ class VariableQ(QGenerator):
|
|
|
124
125
|
q = torch.linspace(0, 1, n_q, device=self.device, dtype=self.dtype)
|
|
125
126
|
elif self.mode == 'random':
|
|
126
127
|
q = torch.rand(n_q, device=self.device, dtype=self.dtype).sort().values
|
|
128
|
+
elif self.mode == 'logspace':
|
|
129
|
+
q = torch.logspace(
|
|
130
|
+
start=torch.log10(torch.tensor(1e-4, dtype=self.dtype, device=self.device)),
|
|
131
|
+
end=torch.log10(torch.tensor(1.0, dtype=self.dtype, device=self.device)),
|
|
132
|
+
steps=n_q, dtype=self.dtype, device=self.device)
|
|
127
133
|
|
|
128
134
|
q = q_min[:, None] + q * (q_max - q_min)[:, None]
|
|
129
135
|
|
|
@@ -198,49 +204,77 @@ class EquidistantQ(QGenerator):
|
|
|
198
204
|
return qs
|
|
199
205
|
|
|
200
206
|
|
|
201
|
-
class
|
|
207
|
+
class MaskedVariableQ:
|
|
202
208
|
def __init__(self,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
self.
|
|
209
|
+
q_min_range=(0.01, 0.03),
|
|
210
|
+
q_max_range=(0.1, 0.5),
|
|
211
|
+
n_q_range=(64, 256),
|
|
212
|
+
mode='equidistant',
|
|
213
|
+
shuffle_mask=False,
|
|
214
|
+
total_thickness_constraint=True,
|
|
215
|
+
min_points_per_fringe=4,
|
|
216
|
+
device=DEFAULT_DEVICE,
|
|
217
|
+
dtype=DEFAULT_DTYPE):
|
|
218
|
+
self.q_min_range = q_min_range
|
|
219
|
+
self.q_max_range = q_max_range
|
|
220
|
+
self.n_q_range = n_q_range
|
|
213
221
|
self.device = device
|
|
214
222
|
self.dtype = dtype
|
|
215
|
-
|
|
216
|
-
|
|
223
|
+
self.mode = mode
|
|
224
|
+
self.shuffle_mask = shuffle_mask
|
|
225
|
+
self.total_thickness_constraint = total_thickness_constraint
|
|
226
|
+
self.min_points_per_fringe = min_points_per_fringe
|
|
227
|
+
|
|
228
|
+
def get_batch(self, batch_size, context):
|
|
217
229
|
assert context is not None
|
|
218
230
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
assert total_thickness.shape[0] == batch_size
|
|
223
|
-
|
|
224
|
-
min_dqs = torch.clamp(
|
|
225
|
-
2 * np.pi / total_thickness / self.min_dq_ratio, self._dq_range[0], self._dq_range[1] * 0.9
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
dqs = torch.rand_like(min_dqs) * (self._dq_range[1] - min_dqs) + min_dqs
|
|
229
|
-
|
|
230
|
-
num_q_values = torch.clamp(self.q_max // dqs, *self._num_values).to(torch.int)
|
|
231
|
+
q_min = torch.rand(batch_size, device=self.device, dtype=self.dtype) * (self.q_min_range[1] - self.q_min_range[0]) + self.q_min_range[0]
|
|
232
|
+
q_max = torch.rand(batch_size, device=self.device, dtype=self.dtype) * (self.q_max_range[1] - self.q_max_range[0]) + self.q_max_range[0]
|
|
231
233
|
|
|
232
|
-
|
|
234
|
+
max_n_q = self.n_q_range[1]
|
|
233
235
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
+
if self.mode == 'equidistant':
|
|
237
|
+
positions = torch.linspace(0, 1, max_n_q, device=self.device, dtype=self.dtype).expand(batch_size, max_n_q)
|
|
238
|
+
elif self.mode == 'random':
|
|
239
|
+
positions = torch.rand(batch_size, max_n_q, device=self.device, dtype=self.dtype)
|
|
240
|
+
positions, _ = positions.sort(dim=-1)
|
|
241
|
+
elif self.mode == 'mixed':
|
|
242
|
+
positions = torch.empty(batch_size, max_n_q, device=self.device, dtype=self.dtype)
|
|
243
|
+
|
|
244
|
+
half = batch_size // 2 # half batch gets equidistant
|
|
245
|
+
eq_pos = torch.linspace(0, 1, max_n_q, device=self.device, dtype=self.dtype).expand(half, max_n_q)
|
|
246
|
+
positions[:half] = eq_pos
|
|
247
|
+
|
|
248
|
+
rand_pos = torch.rand(batch_size - half, max_n_q, device=self.device, dtype=self.dtype) # other half gets sorted random
|
|
249
|
+
rand_pos, _ = rand_pos.sort(dim=-1)
|
|
250
|
+
positions[half:] = rand_pos
|
|
251
|
+
else:
|
|
252
|
+
raise ValueError(f"Unknown spacing mode: {self.mode}")
|
|
253
|
+
|
|
254
|
+
q = q_min[:, None] + positions * (q_max - q_min)[:, None]
|
|
255
|
+
|
|
256
|
+
n_qs = torch.randint(self.n_q_range[0], self.n_q_range[1] + 1, (batch_size,), device=self.device)
|
|
257
|
+
|
|
258
|
+
if 'params' in context and self.total_thickness_constraint: ### N_points > 1 + (Q_spread * total_thickness * min_np_per_kiessing_fringe) / (2*pi)
|
|
259
|
+
d_total = context['params'].thicknesses.sum(-1)
|
|
260
|
+
limit = 1 + ((q_max - q_min) * d_total * self.min_points_per_fringe) / (2*np.pi)
|
|
261
|
+
limit = limit.ceil().int()
|
|
262
|
+
n_qs = torch.maximum(n_qs, limit)
|
|
263
|
+
n_qs = torch.clamp(n_qs, max=self.n_q_range[1])
|
|
264
|
+
|
|
265
|
+
indices = torch.arange(max_n_q, device=self.device).expand(batch_size, max_n_q)
|
|
266
|
+
valid_mask = indices < n_qs[:, None] # right side padding
|
|
267
|
+
|
|
268
|
+
if self.shuffle_mask: # shuffle valid positions (inter-spread padding)
|
|
269
|
+
perm = torch.argsort(torch.rand(batch_size, max_n_q, device=self.device), dim=-1)
|
|
270
|
+
valid_mask = torch.gather(valid_mask, dim=1, index=perm)
|
|
236
271
|
|
|
237
|
-
|
|
272
|
+
context['key_padding_mask'] = valid_mask
|
|
273
|
+
context['n_points'] = valid_mask.sum(dim=-1)
|
|
238
274
|
|
|
275
|
+
return q
|
|
276
|
+
|
|
277
|
+
def scale_q(self, q):
|
|
278
|
+
scaled_q_01 = (q - self.q_min_range[0]) / (self.q_max_range[1] - self.q_min_range[0])
|
|
239
279
|
|
|
240
|
-
|
|
241
|
-
batch_size = num_q_values.shape[0]
|
|
242
|
-
dqs = (q_max / num_q_values)[:, None]
|
|
243
|
-
q_values = torch.arange(1, num_q_values.max().item() + 1)[None].repeat(batch_size, 1) * dqs
|
|
244
|
-
mask = (q_values > q_max + dqs / 2)
|
|
245
|
-
q_values[mask] = 0.
|
|
246
|
-
return q_values, mask
|
|
280
|
+
return 2.0 * (scaled_q_01 - 0.5)
|
|
@@ -163,6 +163,7 @@ def get_density_profiles(
|
|
|
163
163
|
else:
|
|
164
164
|
if ambient_sld.ndim == 1:
|
|
165
165
|
ambient_sld = ambient_sld.unsqueeze(-1)
|
|
166
|
+
ambient_sld = ambient_sld.expand(bs, 1)
|
|
166
167
|
|
|
167
168
|
slds_all = torch.cat([ambient_sld, slds], dim=-1) # new dimension: n+2
|
|
168
169
|
d_rhos = torch.diff(slds_all, dim=-1) # (bs, n+1)
|