ndeutschmann / zunis

Normalizing flows for neural importance sampling
https://zunis.readthedocs.io
MIT License
32 stars 6 forks source link

Added new masking option following arXiv:2001.05486 #2

Closed NGoetz closed 4 years ago

NGoetz commented 4 years ago

I have added the masking strategy proposed in arXiv:2001.05486, and included it in 2 benchmark examples. The performance and functionality of these examples is preserved. The number of cells is in this strategy set to 2*log_2(D), and repetition argument allows to add sets of identically masked coupling cells.

ndeutschmann commented 4 years ago

Hi Niklas,

Do you have any data from your benchmarks?

NGoetz commented 4 years ago

Hi Niklas,

Do you have any data from your benchmarks?

Benchmark hypersphere with i-flow masking: value target value_std target_std sigma_cutoff ... speedup d r c reg 0 0.754088 0.754297 0.000818 0.0 2 ... 2.785295 2 0.49 0.5 0.000001 1 0.286146 0.284483 0.000486 0.0 2 ... 8.577611 4 0.49 0.5 0.000001 2 0.071677 0.071529 0.000180 0.0 2 ... 20.363934 6 0.49 0.5 0.000001 3 0.013481 0.013489 0.000051 0.0 2 ... 49.705926 8 0.49 0.5 0.000001 4 0.002040 0.002036 0.000012 0.0 2 ... 129.981848 10 0.49 0.5 0.000001

Benchmark gaussian with i-flow masking: dimension width value target value_std target_std ... optim_cls betas eps lr 2 0.5 5.577567e-01 5.575404e-01 2.221498e-04 8.359633e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 2 0.3 2.723841e-01 2.723742e-01 4.376990e-04 9.748145e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 2 0.1 3.109701e-02 3.142427e-02 2.127714e-04 2.278089e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 4 0.5 3.115023e-01 3.110504e-01 2.293071e-04 6.942217e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 4 0.3 7.400700e-02 7.420915e-02 2.585070e-04 3.626953e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 4 0.1 9.839381e-04 9.870184e-04 2.967715e-05 1.188340e-06 ... Adam (0.9, 0.999) 1.000000e-08 0.001 6 0.5 1.734837e-01 1.735540e-01 1.822775e-04 4.936023e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 6 0.3 2.021666e-02 2.020924e-02 7.633849e-05 1.442572e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 6 0.1 2.976714e-05 3.094405e-05 4.552276e-06 7.877567e-08 ... Adam (0.9, 0.999) 1.000000e-08 0.001 8 0.5 9.708910e-02 9.680826e-02 1.804474e-04 3.403602e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 8 0.3 5.573777e-03 5.498473e-03 2.811268e-05 4.974291e-06 ... Adam (0.9, 0.999) 1.000000e-08 0.001 8 0.1 1.835977e-07 9.766677e-07 4.949604e-08 6.465756e-09 ... Adam (0.9, 0.999) 1.000000e-08 0.001 10 0.5 5.399647e-02 5.399064e-02 1.184546e-04 2.301625e-05 ... Adam (0.9, 0.999) 1.000000e-08 0.001 10 0.3 1.492440e-03 1.500714e-03 1.250116e-05 1.685500e-06 ... Adam (0.9, 0.999) 1.000000e-08 0.001 10 0.1 4.567210e-09 3.042838e-08 4.172988e-09 4.621964e-10 ... Adam (0.9, 0.999) 1.000000e-08 0.001

I can create more if needed! So far it looks to me for these cases quite similar to the behaviour with the checkerboard masking.

NGoetz commented 4 years ago

Here are some figures! The mean was taken over 5 runs for the i-flow and checkerboard masking, and the relative speedup is shown. bench_hyp_masking benchmark_hyp_iflow_checker bench_gauss_01_iflow_checker bench_gauss_03_iflow_checker bench_gauss_05_iflow_checker