diff --git a/extra_tests/regression_checks.py b/extra_tests/regression_checks.py index 54f2b2e6cd..855c398fd5 100644 --- a/extra_tests/regression_checks.py +++ b/extra_tests/regression_checks.py @@ -27,7 +27,6 @@ "no_lagrange": 27, "no_csr": 613, "polarized_evol": 34, - "multi_dense": 316, "t0theoryid": 100, } diff --git a/extra_tests/regression_fits/multi_dense.weights.h5 b/extra_tests/regression_fits/multi_dense.weights.h5 deleted file mode 100644 index 219dbdce8b..0000000000 Binary files a/extra_tests/regression_fits/multi_dense.weights.h5 and /dev/null differ diff --git a/extra_tests/regression_fits/multi_dense.yml b/extra_tests/regression_fits/multi_dense.yml deleted file mode 100644 index b1a1f1ab75..0000000000 --- a/extra_tests/regression_fits/multi_dense.yml +++ /dev/null @@ -1,82 +0,0 @@ -# -# Configuration file for n3fit regression tests -# This runcard includes two DIS datasets, one Hadronic dataset -# and two positivity datasets -# - -############################################################ -description: n3fit regression test - -############################################################ -# frac: training fraction -# ewk: apply ewk k-factors -# sys: systematics treatment (see systypes) -dataset_inputs: - - {dataset: NMC_NC_NOTFIXED_P_EM-SIGMARED, frac: 0.5, variant: legacy} - - {dataset: SLAC_NC_NOTFIXED_P_EM-F2, frac: 0.5, variant: legacy} - - {dataset: CMS_Z0J_8TEV_PT-Y, frac: 0.5, cfac: [QCD], variant: legacy_10} - - {dataset: ATLAS_TTBAR_8TEV_TOT_X-SEC, frac: 1.0, cfac: [QCD], variant: legacy} - -############################################################ -datacuts: - t0pdfset: NNPDF40_nnlo_as_01180 # PDF set to generate t0 covmat - q2min : 3.49 # Q2 minimum - w2min : 12.5 # W2 minimum - -############################################################ -theory: - theoryid: 399 # database id - -############################################################ -genrep: False # on = generate MC replicas, False = use real data -trvlseed: 3 -nnseed: 2 -mcseed: 1 - -# checks both that can be loaded and saved -save: "multi_dense.weights.h5" -load: "multi_dense.weights.h5" - -parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 8] - activation_per_layer: ['sigmoid', 'tanh', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'RMSprop' - learning_rate: 0.00001 - clipnorm: 1.0 - epochs: 1100 - positivity: - multiplier: 1.05 - initial: 1.5 - stopping_patience: 0.10 # percentage of the number of epochs - layer_type: 'multidense' - dropout: 0.0 - threshold_chi2: 10.0 - -fitting: - savepseudodata: False - fitbasis: EVOL - basis: - - {fl: sng, trainable: false, smallx: [1.094, 1.118], largex: [1.46, 3.003]} - - {fl: g, trainable: false, smallx: [0.8189, 1.044], largex: [2.791, 5.697]} - - {fl: v, trainable: false, smallx: [0.457, 0.7326], largex: [1.56, 3.431]} - - {fl: v3, trainable: false, smallx: [0.1462, 0.4061], largex: [1.745, 3.452]} - - {fl: v8, trainable: false, smallx: [0.5401, 0.7665], largex: [1.539, 3.393]} - - {fl: t3, trainable: false, smallx: [-0.4401, 0.9163], largex: [1.773, 3.333]} - - {fl: t8, trainable: false, smallx: [0.5852, 0.8537], largex: [1.533, 3.436]} - - {fl: t15, trainable: false, smallx: [1.082, 1.142], largex: [1.461, 3.1]} - -############################################################ -positivity: - posdatasets: - - {dataset: NNPDF_POS_2P24GEV_F2U, maxlambda: 1e6} - - {dataset: NNPDF_POS_2P24GEV_DYS, maxlambda: 1e5} - -integrability: - integdatasets: - - {dataset: NNPDF_INTEG_3GEV_XT8, maxlambda: 1e2} - -############################################################ -debug: true -double_precision: false diff --git a/extra_tests/regression_fits/multi_dense_316.exportgrid b/extra_tests/regression_fits/multi_dense_316.exportgrid deleted file mode 100644 index a161e60a73..0000000000 --- a/extra_tests/regression_fits/multi_dense_316.exportgrid +++ /dev/null @@ -1,633 +0,0 @@ -labels: [TBAR, BBAR, CBAR, SBAR, UBAR, DBAR, GLUON, D, U, S, C, B, T, PHT] -pdfgrid: -- [0.0, 0.0, -2.414679527282715, 0.03293878957629204, 0.006518306210637093, 0.006565739866346121, - -16.949363708496094, 0.0067194681614637375, 0.006673568394035101, 0.03269035741686821, - -2.414679527282715, 0.0, 0.0, 0.0] -- [0.0, 0.0, -2.3386006355285645, 0.03616023808717728, 0.00868224911391735, 0.008736195042729378, - -16.960275650024414, 0.008906127884984016, 0.008854025974869728, 0.03588767722249031, - -2.3386001586914062, 0.0, 0.0, 0.0] -- [0.0, 0.0, -2.2649219036102295, 0.039529409259557724, 0.01095039676874876, 0.011011715978384018, - -16.969711303710938, 0.011199597269296646, 0.011140499264001846, 0.03923040255904198, - -2.2649219036102295, 0.0, 0.0, 0.0] -- [0.0, 0.0, -2.1935689449310303, 0.0430491603910923, 0.013323646038770676, 0.013393392786383629, - -16.97756004333496, 0.013601153157651424, 0.013534080237150192, 0.042721159756183624, - -2.193568468093872, 0.0, 0.0, 0.0] -- [0.0, 0.0, -2.124467611312866, 0.04672133922576904, 0.01580185443162918, 0.01588115654885769, - -16.98371696472168, 0.016110945492982864, 0.016034862026572227, 0.04636155068874359, - -2.124467372894287, 0.0, 0.0, 0.0] -- [0.0, 0.0, -2.057546615600586, 0.05054865777492523, 0.018385661765933037, 0.018475783988833427, - -16.988061904907227, 0.018729982897639275, 0.018643738701939583, 0.05015401914715767, - -2.057546854019165, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.9927366971969604, 0.05453399196267128, 0.021075593307614326, 0.02117806114256382, - -16.99046516418457, 0.02145932801067829, 0.021361524239182472, 0.05410115793347359, - -1.9927366971969604, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.9299705028533936, 0.05868043750524521, 0.02387244813144207, 0.0239889994263649, - -16.990795135498047, 0.024300267919898033, 0.024189334362745285, 0.058205731213092804, - -1.9299705028533936, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.8691833019256592, 0.06299151480197906, 0.02677728980779648, 0.02690979838371277, - -16.988903045654297, 0.027254348620772362, 0.02712860330939293, 0.06247091665863991, - -1.8691833019256592, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.8103121519088745, 0.06747134029865265, 0.02979160286486149, 0.029942283406853676, - -16.984638214111328, 0.030323756858706474, 0.030181216076016426, 0.06690045446157455, - -1.8103123903274536, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.7532963752746582, 0.07212381064891815, 0.03291649743914604, 0.033087775111198425, - -16.977827072143555, 0.03351021558046341, 0.033348727971315384, 0.07149776071310043, - -1.7532963752746582, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.6980764865875244, 0.07695323973894119, 0.03615342825651169, 0.03634817525744438, - -16.968305587768555, 0.03681608662009239, 0.036633118987083435, 0.07626678049564362, - -1.6980767250061035, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.644595742225647, 0.08196473121643066, 0.039504315704107285, 0.039725761860609055, - -16.95587158203125, 0.04024416208267212, 0.040036898106336594, 0.08121205866336823, - -1.644595742225647, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.5927979946136475, 0.08716338127851486, 0.04297106713056564, 0.043222811073064804, - -16.94032859802246, 0.04379728063941002, 0.04356259107589722, 0.08633815497159958, - -1.5927979946136475, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.5426300764083862, 0.09255480021238327, 0.0465557798743248, 0.04684197157621384, - -16.921445846557617, 0.047478724271059036, 0.047213055193424225, 0.09165003150701523, - -1.5426300764083862, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.4940401315689087, 0.09814433008432388, 0.050260160118341446, 0.05058550462126732, - -16.89901351928711, 0.05129144713282585, 0.05099080130457878, 0.09715243428945541, - -1.4940403699874878, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.446977972984314, 0.10393846780061722, 0.05408677086234093, 0.05445661395788193, - -16.87276840209961, 0.05523946136236191, 0.05489932745695114, 0.10285105556249619, - -1.4469777345657349, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.4013936519622803, 0.10994366556406021, 0.058037951588630676, 0.0584583654999733, - -16.842443466186523, 0.05932670831680298, 0.058942027390003204, 0.10875158756971359, - -1.4013938903808594, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.3572406768798828, 0.11616702377796173, 0.062116339802742004, 0.0625942274928093, - -16.807756423950195, 0.06355765461921692, 0.06312274187803268, 0.11486026644706726, - -1.3572406768798828, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.3144729137420654, 0.12261560559272766, 0.0663243755698204, 0.06686751544475555, - -16.768396377563477, 0.06793669611215591, 0.06744524091482162, 0.12118315696716309, - -1.314473271369934, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.2730463743209839, 0.12929712235927582, 0.07066468894481659, 0.07128199189901352, - -16.724042892456055, 0.0724688395857811, 0.0719136893749237, 0.12772689759731293, - -1.273046612739563, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.2329175472259521, 0.13621975481510162, 0.07514015585184097, 0.07584169507026672, - -16.674335479736328, 0.07715948671102524, 0.07653268426656723, 0.13449856638908386, - -1.2329175472259521, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.194044589996338, 0.14339163899421692, 0.07975316047668457, 0.08055033534765244, - -16.61890983581543, 0.08201392740011215, 0.0813065841794014, 0.1415049284696579, - -1.194044589996338, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.1563873291015625, 0.15082183480262756, 0.08450668305158615, 0.08541245758533478, - -16.557355880737305, 0.08703836053609848, 0.08624061197042465, 0.14875368773937225, - -1.1563873291015625, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.1199060678482056, 0.15851940214633942, 0.08940327167510986, 0.09043233096599579, - -16.489246368408203, 0.09223905205726624, 0.09133981913328171, 0.1562524139881134, - -1.1199063062667847, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.0845637321472168, 0.16649383306503296, 0.09444530308246613, 0.09561428427696228, - -16.41412353515625, 0.09762246906757355, 0.09660947322845459, 0.16400878131389618, - -1.0845637321472168, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.0503222942352295, 0.1747552752494812, 0.09963551163673401, 0.1009632796049118, - -16.33148193359375, 0.10319598019123077, 0.1020556390285492, 0.17203116416931152, - -1.0503222942352295, 0.0, 0.0, 0.0] -- [0.0, 0.0, -1.0171470642089844, 0.18331389129161835, 0.1049758568406105, 0.10648374259471893, - -16.240808486938477, 0.10896670073270798, 0.10768397897481918, 0.1803276240825653, - -1.0171470642089844, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.9850026369094849, 0.1921803057193756, 0.11046834290027618, 0.11218048632144928, - -16.141530990600586, 0.11494246870279312, 0.11350075155496597, 0.18890643119812012, - -0.9850026369094849, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.953855574131012, 0.20136524736881256, 0.11611434817314148, 0.11805812269449234, - -16.033048629760742, 0.1211312934756279, 0.11951227486133575, 0.19777600467205048, - -0.9538556933403015, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.9236738681793213, 0.21088038384914398, 0.12191538512706757, 0.12412163615226746, - -15.914717674255371, 0.12754195928573608, 0.12572559714317322, 0.20694498717784882, - -0.9236738681793213, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.8944254517555237, 0.2207367867231369, 0.12787175178527832, 0.13037535548210144, - -15.785850524902344, 0.13418301939964294, 0.132147416472435, 0.21642160415649414, - -0.8944253325462341, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.8660800457000732, 0.23094648122787476, 0.1339837610721588, 0.13682405650615692, - -15.645709037780762, 0.14106398820877075, 0.13878534734249115, 0.22621440887451172, - -0.8660800457000732, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.8386080265045166, 0.2415207326412201, 0.14025011658668518, 0.14347147941589355, - -15.493518829345703, 0.14819394052028656, 0.1456463783979416, 0.2363310009241104, - -0.8386080265045166, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.8119808435440063, 0.2524719536304474, 0.14666953682899475, 0.15032193064689636, - -15.328446388244629, 0.15558312833309174, 0.15273886919021606, 0.2467796355485916, - -0.8119808435440063, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.786170244216919, 0.2638110816478729, 0.1532384753227234, 0.15737806260585785, - -15.14961051940918, 0.16324082016944885, 0.16007015109062195, 0.2575667202472687, - -0.7861703634262085, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.7611503601074219, 0.2755499482154846, 0.15995293855667114, 0.16464291512966156, - -14.956077575683594, 0.17117753624916077, 0.16764894127845764, 0.26869913935661316, - -0.7611502408981323, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.7368948459625244, 0.287699431180954, 0.1668069064617157, 0.17211808264255524, - -14.74686050415039, 0.17940309643745422, 0.17548352479934692, 0.2801821529865265, - -0.7368948459625244, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.7133787870407104, 0.30027011036872864, 0.1737927794456482, 0.17980441451072693, - -14.520919799804688, 0.18792769312858582, 0.18358281254768372, 0.2920202612876892, - -0.7133787870407104, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.6905781030654907, 0.3132714033126831, 0.18090055882930756, 0.1877012699842453, - -14.277168273925781, 0.19676095247268677, 0.1919558346271515, 0.30421605706214905, - -0.6905781030654907, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.6684698462486267, 0.3267114758491516, 0.18811772763729095, 0.1958063244819641, - -14.014459609985352, 0.20591218769550323, 0.20061178505420685, 0.3167704939842224, - -0.6684698462486267, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.647031843662262, 0.34059688448905945, 0.19542880356311798, 0.20411522686481476, - -13.73161506652832, 0.21538963913917542, 0.20955996215343475, 0.3296818435192108, - -0.647031843662262, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.6262431740760803, 0.3549323081970215, 0.20281526446342468, 0.21262134611606598, - -13.427421569824219, 0.2252011001110077, 0.21881045401096344, 0.3429458439350128, - -0.626242995262146, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.606083333492279, 0.36971980333328247, 0.2102547287940979, 0.2213151454925537, - -13.100627899169922, 0.23535272479057312, 0.22837339341640472, 0.35655462741851807, - -0.606083333492279, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.5865340828895569, 0.3849577009677887, 0.21772044897079468, 0.230183407664299, - -12.74997615814209, 0.2458486258983612, 0.23825915157794952, 0.37049606442451477, - -0.5865340828895569, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.5675773024559021, 0.40064045786857605, 0.2251809537410736, 0.2392089068889618, - -12.374227523803711, 0.25669074058532715, 0.2484787404537201, 0.38475301861763, - -0.5675773024559021, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.5491966009140015, 0.4167572259902954, 0.232599675655365, 0.2483695149421692, - -11.972164154052734, 0.26787784695625305, 0.25904354453086853, 0.3993021249771118, - -0.5491966009140015, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.5313771963119507, 0.43329092860221863, 0.23993411660194397, 0.2576374113559723, - -11.542655944824219, 0.27940478920936584, 0.2699655592441559, 0.4141131639480591, - -0.5313771963119507, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.5141056776046753, 0.4502164423465729, 0.2471356838941574, 0.2669782042503357, - -11.08466911315918, 0.2912616729736328, 0.28125736117362976, 0.42914730310440063, - -0.5141056776046753, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.49737030267715454, 0.4674994647502899, 0.25414910912513733, 0.2763496935367584, - -10.597359657287598, 0.3034323453903198, 0.29293230175971985, 0.444355845451355, - -0.49737030267715454, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.48116177320480347, 0.4850946068763733, 0.26091268658638, 0.2857013940811157, - -10.08011531829834, 0.31589365005493164, 0.3050045073032379, 0.45967885851860046, - -0.48116177320480347, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.46547219157218933, 0.5029428005218506, 0.26735788583755493, 0.2949731647968292, - -9.532658576965332, 0.3286134898662567, 0.31748905777931213, 0.4750435948371887, - -0.46547219157218933, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.45029693841934204, 0.5209696888923645, 0.27341026067733765, 0.3040944039821625, - -8.955163955688477, 0.3415497839450836, 0.3304019570350647, 0.4903629720211029, - -0.45029693841934204, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.43563327193260193, 0.5390827655792236, 0.27899062633514404, 0.3129839301109314, - -8.34835147857666, 0.35464799404144287, 0.34375980496406555, 0.5055339336395264, - -0.43563327193260193, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.421481728553772, 0.5571693778038025, 0.2840162515640259, 0.32154911756515503, - -7.713669776916504, 0.36784034967422485, 0.3575795292854309, 0.5204371809959412, - -0.421481728553772, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.40784531831741333, 0.5750944018363953, 0.2884041666984558, 0.32968682050704956, - -7.053407192230225, 0.3810436427593231, 0.3718774616718292, 0.5349359512329102, - -0.40784531831741333, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.39473026990890503, 0.5926997661590576, 0.29207468032836914, 0.3372846841812134, - -6.370861530303955, 0.3941592276096344, 0.38666868209838867, 0.5488783121109009, - -0.3947303593158722, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.38214465975761414, 0.6098032593727112, 0.294955849647522, 0.3442234396934509, - -5.670494556427002, 0.40707191824913025, 0.401964396238327, 0.562097430229187, -0.38214465975761414, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.3700992465019226, 0.6262015700340271, 0.29698991775512695, 0.35038119554519653, - -4.957949161529541, 0.4196520745754242, 0.41777029633522034, 0.5744184255599976, - -0.3700992465019226, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.35860469937324524, 0.641674280166626, 0.2981394827365875, 0.35563868284225464, - -4.240100383758545, 0.43175870180130005, 0.4340831935405731, 0.5856636166572571, - -0.35860469937324524, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.3476720154285431, 0.6559918522834778, 0.2983936667442322, 0.3598858118057251, - -3.5248966217041016, 0.4432443380355835, 0.4508879780769348, 0.5956616997718811, - -0.34767207503318787, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.33730998635292053, 0.66892409324646, 0.2977723777294159, 0.3630277216434479, - -2.8211047649383545, 0.4539617896080017, 0.46815335750579834, 0.6042582392692566, - -0.33730992674827576, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.32752349972724915, 0.6802546381950378, 0.29633018374443054, 0.3649933636188507, - -2.1378865242004395, 0.4637731611728668, 0.48583003878593445, 0.611327588558197, - -0.32752349972724915, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.3183116614818573, 0.6897926330566406, 0.29415473341941833, 0.36573848128318787, - -1.4842779636383057, 0.4725586473941803, 0.5038487911224365, 0.61678147315979, -0.3183116018772125, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.30966728925704956, 0.6973851919174194, 0.2913627028465271, 0.3652504086494446, - -0.8685911893844604, 0.4802248775959015, 0.5221216082572937, 0.6205780506134033, - -0.3096673786640167, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.30157580971717834, 0.7029258608818054, 0.28809139132499695, 0.3635460138320923, - -0.2979136109352112, 0.48670968413352966, 0.5405435562133789, 0.6227225065231323, - -0.30157575011253357, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.2940152883529663, 0.7063591480255127, 0.2844897508621216, 0.36066967248916626, - 0.22229154407978058, 0.49198484420776367, 0.5589973330497742, 0.6232659220695496, - -0.2940152883529663, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.28695768117904663, 0.7076795101165771, 0.28070688247680664, 0.35668712854385376, - 0.6884336471557617, 0.4960547983646393, 0.5773591995239258, 0.6222991943359375, - -0.2869577407836914, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.2803705334663391, 0.706926167011261, 0.27688321471214294, 0.3516794741153717, - 1.098759412765503, 0.4989517331123352, 0.5955039262771606, 0.6199434399604797, -0.2803705334663391, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.2742176651954651, 0.7041764855384827, 0.2731427550315857, 0.345736563205719, - 1.4532420635223389, 0.5007297396659851, 0.6133098602294922, 0.616339385509491, -0.2742176353931427, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.2684618830680847, 0.6995350122451782, 0.269589364528656, 0.33895212411880493, - 1.753298282623291, 0.5014582872390747, 0.6306637525558472, 0.6116384863853455, -0.2684618830680847, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.2630656957626343, 0.6931268572807312, 0.26630350947380066, 0.3314189314842224, - 2.0014731884002686, 0.501214861869812, 0.6474618315696716, 0.6059936881065369, -0.2630656659603119, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.25799286365509033, 0.6850878596305847, 0.2633435130119324, 0.32322660088539124, - 2.20111083984375, 0.5000800490379333, 0.663612425327301, 0.5995532870292664, -0.25799286365509033, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.25320884585380554, 0.6755591034889221, 0.2607463300228119, 0.31445980072021484, - 2.3560757637023926, 0.4981333911418915, 0.6790358424186707, 0.5924570560455322, - -0.25320884585380554, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.24868150055408478, 0.6646813750267029, 0.25853031873703003, 0.3051976263523102, - 2.4704957008361816, 0.4954501688480377, 0.6936639547348022, 0.5848329067230225, - -0.2486814707517624, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.24438157677650452, 0.6525923013687134, 0.2566981017589569, 0.2955133616924286, - 2.5485785007476807, 0.49209973216056824, 0.7074400186538696, 0.5767958760261536, - -0.24438153207302094, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.24028196930885315, 0.6394234299659729, 0.2552396059036255, 0.2854752540588379, - 2.5944578647613525, 0.4881443977355957, 0.7203169465065002, 0.5684483051300049, - -0.24028198421001434, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.23635895550251007, 0.625298798084259, 0.2541346549987793, 0.2751462757587433, - 2.6121022701263428, 0.48363980650901794, 0.7322568893432617, 0.5598794221878052, - -0.23635895550251007, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.23259097337722778, 0.6103348135948181, 0.2533561587333679, 0.26458531618118286, - 2.6052491664886475, 0.4786348342895508, 0.7432308793067932, 0.5511667728424072, - -0.2325909435749054, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.22895894944667816, 0.5946387648582458, 0.25287124514579773, 0.253846675157547, - 2.5773539543151855, 0.4731718599796295, 0.7532162070274353, 0.5423766374588013, - -0.22895893454551697, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.22544637322425842, 0.578309953212738, 0.25264430046081543, 0.242981418967247, - 2.5315887928009033, 0.467288076877594, 0.7621975541114807, 0.5335658192634583, -0.22544637322425842, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.22203849256038666, 0.5614392757415771, 0.25263792276382446, 0.2320370376110077, - 2.470823287963867, 0.46101537346839905, 0.7701650261878967, 0.5247818231582642, - -0.22203849256038666, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.21872249245643616, 0.5441099405288696, 0.2528146803379059, 0.22105780243873596, - 2.3976387977600098, 0.4543820917606354, 0.7771143317222595, 0.5160648226737976, - -0.21872250735759735, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.21548742055892944, 0.5263974666595459, 0.2531376779079437, 0.210084930062294, - 2.3143365383148193, 0.4474131464958191, 0.7830460667610168, 0.5074477791786194, - -0.21548740565776825, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.21232379972934723, 0.5083707571029663, 0.25357159972190857, 0.1991567462682724, - 2.2229504585266113, 0.44013041257858276, 0.787964940071106, 0.49895742535591125, - -0.21232379972934723, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.20922325551509857, 0.4900921881198883, 0.25408345460891724, 0.18830864131450653, - 2.1252753734588623, 0.43255406618118286, 0.7918800711631775, 0.49061572551727295, - -0.20922322571277618, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.20617911219596863, 0.4716187119483948, 0.25464215874671936, 0.17757326364517212, - 2.022878646850586, 0.4247024655342102, 0.7948036193847656, 0.48243972659111023, - -0.20617911219596863, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.20318518579006195, 0.4530014097690582, 0.25522056221961975, 0.1669802963733673, - 1.9171241521835327, 0.41659292578697205, 0.7967516183853149, 0.47444280982017517, - -0.20318515598773956, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.20023654401302338, 0.43428733944892883, 0.2557932138442993, 0.15655680000782013, - 1.8091917037963867, 0.40824174880981445, 0.7977426052093506, 0.46663418412208557, - -0.20023657381534576, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.19732901453971863, 0.41551873087882996, 0.2563380300998688, 0.14632709324359894, - 1.7000946998596191, 0.3996649384498596, 0.7977978587150574, 0.4590207040309906, - -0.19732901453971863, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.19445906579494476, 0.39673441648483276, 0.25683584809303284, 0.13631288707256317, - 1.5907045602798462, 0.3908781409263611, 0.7969410419464111, 0.45160630345344543, - -0.19445903599262238, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1916234940290451, 0.37797021865844727, 0.257269948720932, 0.1265333741903305, - 1.481760859489441, 0.38189709186553955, 0.7951983213424683, 0.4443930685520172, - -0.1916234940290451, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1888197958469391, 0.3592589795589447, 0.2576264441013336, 0.11700531840324402, - 1.3738880157470703, 0.3727373778820038, 0.7925969958305359, 0.4373804032802582, - -0.1888197958469391, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.18604595959186554, 0.3406311273574829, 0.2578935921192169, 0.10774314403533936, - 1.2676128149032593, 0.3634149134159088, 0.7891663908958435, 0.4305666983127594, - -0.18604598939418793, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.18329988420009613, 0.3221152424812317, 0.2580612301826477, 0.09875885397195816, - 1.1633787155151367, 0.35394585132598877, 0.7849370241165161, 0.4239482581615448, - -0.18329991400241852, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1805800348520279, 0.3037382662296295, 0.25812169909477234, 0.09006281197071075, - 1.0615497827529907, 0.34434670209884644, 0.7799404859542847, 0.41752058267593384, - -0.1805800497531891, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.17788496613502502, 0.2855258584022522, 0.2580685019493103, 0.08166324347257614, - 0.9624306559562683, 0.3346344828605652, 0.7742093205451965, 0.4112780690193176, - -0.17788496613502502, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.17521318793296814, 0.26750248670578003, 0.25789642333984375, 0.07356635481119156, - 0.86626797914505, 0.3248261511325836, 0.7677769064903259, 0.4052133560180664, -0.17521315813064575, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1725633144378662, 0.24969197809696198, 0.25760143995285034, 0.06577716767787933, - 0.773262083530426, 0.3149394989013672, 0.7606770396232605, 0.3993193805217743, -0.1725633144378662, - 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.16993433237075806, 0.2321174293756485, 0.25718069076538086, 0.05829882621765137, - 0.6835684180259705, 0.3049924075603485, 0.7529438734054565, 0.3935874104499817, - -0.16993434727191925, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.16732487082481384, 0.21480116248130798, 0.25663140416145325, 0.05113333836197853, - 0.5973159074783325, 0.2950030267238617, 0.7446117401123047, 0.3880085051059723, - -0.16732491552829742, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1647336781024933, 0.1977653205394745, 0.25595176219940186, 0.04428121820092201, - 0.5146008133888245, 0.28498974442481995, 0.7357153296470642, 0.38257306814193726, - -0.1647336781024933, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.16215962171554565, 0.18103167414665222, 0.25514036417007446, 0.03774213790893555, - 0.4354868233203888, 0.27497121691703796, 0.7262886762619019, 0.37727102637290955, - -0.16215965151786804, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.15960143506526947, 0.1646212488412857, 0.254195898771286, 0.031514719128608704, - 0.3600277006626129, 0.2649660110473633, 0.7163660526275635, 0.37209197878837585, - -0.15960140526294708, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.15705759823322296, 0.1485552191734314, 0.2531176209449768, 0.025596626102924347, - 0.2882521152496338, 0.25499266386032104, 0.7059815526008606, 0.3670251667499542, - -0.15705759823322296, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.15452703833580017, 0.1328538954257965, 0.25190460681915283, 0.01998462714254856, - 0.22017037868499756, 0.24506992101669312, 0.6951687932014465, 0.36205965280532837, - -0.15452708303928375, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1520085632801056, 0.1175369918346405, 0.25055640935897827, 0.014674974605441093, - 0.15578249096870422, 0.23521579802036285, 0.6839606761932373, 0.3571844696998596, - -0.1520085334777832, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.14950060844421387, 0.10262398421764374, 0.2490723580121994, 0.009663325734436512, - 0.09507022798061371, 0.22544847428798676, 0.672389566898346, 0.3523882329463959, - -0.14950063824653625, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1470022052526474, 0.08813343197107315, 0.24745216965675354, 0.004944719839841127, - 0.038009896874427795, 0.21578547358512878, 0.6604877710342407, 0.3476601243019104, - -0.1470022201538086, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.14451172947883606, 0.07408275455236435, 0.24569545686244965, 0.0005134244565851986, - -0.015436285175383091, 0.2062438428401947, 0.6482860445976257, 0.34298884868621826, - -0.14451172947883606, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.14202837646007538, 0.06048884615302086, 0.24380239844322205, -0.0036361366510391235, - -0.06531542539596558, 0.1968400478363037, 0.6358152627944946, 0.33836376667022705, - -0.14202837646007538, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.13955086469650269, 0.04736722260713577, 0.24177289009094238, -0.007510400842875242, - -0.11168130487203598, 0.18758979439735413, 0.6231046915054321, 0.3337743878364563, - -0.13955089449882507, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1370781809091568, 0.0347321592271328, 0.2396073043346405, -0.011116042733192444, - -0.15459954738616943, 0.17850802838802338, 0.6101834177970886, 0.3292102813720703, - -0.1370781511068344, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.13460931181907654, 0.022596536204218864, 0.23730619251728058, -0.014459909871220589, - -0.19413931667804718, 0.16960863769054413, 0.5970790982246399, 0.3246617317199707, - -0.13460932672023773, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1321435570716858, 0.010971801355481148, 0.23487041890621185, -0.01754925213754177, - -0.23037885129451752, 0.16090472042560577, 0.5838191509246826, 0.3201195001602173, - -0.1321435272693634, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1296800673007965, -0.00013218521780800074, 0.2323012351989746, -0.02039133571088314, - -0.26340070366859436, 0.15240825712680817, 0.5704290866851807, 0.31557464599609375, - -0.12968005239963531, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.1272183507680893, -0.01070727314800024, 0.2296002358198166, -0.022994039580225945, - -0.29329714179039, 0.1441301554441452, 0.5569344162940979, 0.31101909279823303, - -0.1272183358669281, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.12475799024105072, -0.020747235044836998, 0.2267693430185318, -0.025364957749843597, - -0.3201621472835541, 0.13608010113239288, 0.5433591604232788, 0.30644533038139343, - -0.12475800514221191, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.12229868769645691, -0.0302471574395895, 0.22381086647510529, -0.027512064203619957, - -0.3440954089164734, 0.1282668113708496, 0.5297262668609619, 0.3018464148044586, - -0.12229867279529572, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.11984028667211533, -0.039204586297273636, 0.22072774171829224, -0.029443558305501938, - -0.365201860666275, 0.12069761008024216, 0.516058087348938, 0.2972164750099182, - -0.11984027177095413, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.11738285422325134, -0.04761829599738121, 0.2175232321023941, -0.03116750717163086, - -0.3835882544517517, 0.11337874829769135, 0.5023757815361023, 0.29255008697509766, - -0.11738284677267075, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.11492656916379929, -0.05548929423093796, 0.2142009437084198, -0.03269224986433983, - -0.39936622977256775, 0.10631521791219711, 0.48869946599006653, 0.28784266114234924, - -0.11492657661437988, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.11247164756059647, -0.0628199353814125, 0.21076497435569763, -0.034025948494672775, - -0.4126499593257904, 0.09951107949018478, 0.47504815459251404, 0.2830904424190521, - -0.11247166246175766, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.11001866310834885, -0.06961486488580704, 0.20721988379955292, -0.03517698869109154, - -0.42355450987815857, 0.0929688885807991, 0.46144014596939087, 0.27829045057296753, - -0.11001868546009064, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.10756823420524597, -0.07587987929582596, 0.20357069373130798, -0.036153681576251984, - -0.43219760060310364, 0.08669023215770721, 0.4478927254676819, 0.2734404504299164, - -0.10756821930408478, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.10512100905179977, -0.08162259310483932, 0.19982247054576874, -0.03696437552571297, - -0.43869730830192566, 0.08067584782838821, 0.434422105550766, 0.26853910088539124, - -0.10512101650238037, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.10267793387174606, -0.0868520438671112, 0.19598107039928436, -0.03761734440922737, - -0.443172812461853, 0.07492523640394211, 0.42104387283325195, 0.2635855972766876, - -0.10267794132232666, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.10023992508649826, -0.09157867729663849, 0.19205214083194733, -0.03812064975500107, - -0.4457431137561798, 0.06943705677986145, 0.40777212381362915, 0.25857990980148315, - -0.10023994743824005, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.09780805557966232, -0.09581409394741058, 0.18804217875003815, -0.038482554256916046, - -0.4465263783931732, 0.06420915573835373, 0.39462098479270935, 0.2535229027271271, - -0.09780807048082352, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.09538345038890839, -0.09957119077444077, 0.1839572787284851, -0.03871100768446922, - -0.4456414580345154, 0.059238363057374954, 0.38160282373428345, 0.24841566383838654, - -0.09538345038890839, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.09296738356351852, -0.10286371409893036, 0.1798042505979538, -0.038813915103673935, - -0.44320371747016907, 0.05452105030417442, 0.36873000860214233, 0.2432602494955063, - -0.09296739846467972, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.09056109935045242, -0.10570652037858963, 0.17558977007865906, -0.03879900649189949, - -0.4393283724784851, 0.0500526949763298, 0.3560134172439575, 0.23805904388427734, - -0.09056108444929123, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.08816588670015335, -0.1081150472164154, 0.1713205873966217, -0.038673870265483856, - -0.4341282546520233, 0.045828286558389664, 0.3434634506702423, 0.2328149825334549, - -0.08816586434841156, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.08578316122293472, -0.11010551452636719, 0.16700370609760284, -0.03844599798321724, - -0.42771464586257935, 0.041842270642519, 0.33109018206596375, 0.2275315672159195, - -0.08578316867351532, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.08341436088085175, -0.11169470846652985, 0.16264608502388, -0.03812260553240776, - -0.4201951026916504, 0.0380886010825634, 0.31890222430229187, 0.22221256792545319, - -0.08341434597969055, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.0810607522726059, -0.11289959400892258, 0.15825442969799042, -0.03771074116230011, - -0.4116749167442322, 0.034560929983854294, 0.3069080710411072, 0.2168620228767395, - -0.08106076717376709, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.07872384041547775, -0.11373785138130188, 0.15383590757846832, -0.03721724823117256, - -0.4022563099861145, 0.031252458691596985, 0.2951153516769409, 0.21148456633090973, - -0.07872384041547775, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.07640501856803894, -0.11422710120677948, 0.1493971198797226, -0.036648835986852646, - -0.3920385241508484, 0.028156191110610962, 0.2835310995578766, 0.20608478784561157, - -0.07640501856803894, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.07410566508769989, -0.114385224878788, 0.14494487643241882, -0.03601190075278282, - -0.381117045879364, 0.025264907628297806, 0.2721618413925171, 0.20066779851913452, - -0.07410568743944168, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.07182716578245163, -0.11423008888959885, 0.1404857635498047, -0.03531266376376152, - -0.3695845305919647, 0.022571144625544548, 0.26101332902908325, 0.19523845613002777, - -0.07182717323303223, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.06957082450389862, -0.11377950012683868, 0.13602620363235474, -0.034557145088911057, - -0.3575287163257599, 0.020067479461431503, 0.2500910460948944, 0.18980221450328827, - -0.06957080960273743, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.06733796745538712, -0.11305126547813416, 0.13157251477241516, -0.03375106677412987, - -0.3450348377227783, 0.017746249213814735, 0.23939968645572662, 0.18436431884765625, - -0.06733796745538712, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.0651298388838768, -0.11206288635730743, 0.1271309107542038, -0.03290001302957535, - -0.332183837890625, 0.015599890612065792, 0.22894367575645447, 0.1789301335811615, - -0.0651298463344574, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.06294765323400497, -0.11083173751831055, 0.12270718067884445, -0.03200928866863251, - -0.3190528154373169, 0.013620753772556782, 0.2187267243862152, 0.173505038022995, - -0.06294765323400497, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.06079258769750595, -0.10937485843896866, 0.11830725520849228, -0.03108396753668785, - -0.30571457743644714, 0.011801201850175858, 0.20875218510627747, 0.1680944412946701, - -0.060792580246925354, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.058665767312049866, -0.10770904272794724, 0.11393653601408005, -0.03012896329164505, - -0.29223909974098206, 0.010133718140423298, 0.19902299344539642, 0.1627037227153778, - -0.05866575986146927, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.056568216532468796, -0.10585056990385056, 0.10960041731595993, -0.029148900881409645, - -0.27869144082069397, 0.008610888384282589, 0.1895417422056198, 0.15733817219734192, - -0.0565682090818882, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.05450095981359482, -0.10381542146205902, 0.10530412197113037, -0.02814820595085621, - -0.2651328444480896, 0.00722529087215662, 0.18031033873558044, 0.1520029455423355, - -0.05450095608830452, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.05246498063206673, -0.10161922872066498, 0.10105250775814056, -0.02713112346827984, - -0.25162115693092346, 0.0059697749093174934, 0.17133064568042755, 0.14670327305793762, - -0.05246497318148613, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.05046110227704048, -0.09927701950073242, 0.09685029834508896, -0.026101673021912575, - -0.23820994794368744, 0.004837158136069775, 0.16260379552841187, 0.14144404232501984, - -0.05046110972762108, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.04849018156528473, -0.09680342674255371, 0.0927019938826561, -0.025063637644052505, - -0.22494883835315704, 0.0038205564487725496, 0.1541307270526886, 0.13623014092445374, - -0.04849018156528473, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.046553004533052444, -0.09421265125274658, 0.08861187845468521, -0.024020662531256676, - -0.21188384294509888, 0.0029131972696632147, 0.14591218531131744, 0.13106629252433777, - -0.04655300825834274, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.044650282710790634, -0.0915183499455452, 0.08458412438631058, -0.022976133972406387, - -0.19905740022659302, 0.002108403015881777, 0.13794831931591034, 0.12595710158348083, - -0.044650282710790634, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.042782679200172424, -0.08873371034860611, 0.0806225836277008, -0.021933292970061302, - -0.18650764226913452, 0.001399761880747974, 0.1302390694618225, 0.12090696394443512, - -0.042782679200172424, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.04095079377293587, -0.08587145060300827, 0.07673094421625137, -0.020895229652523994, - -0.17426970601081848, 0.0007810458773747087, 0.1227841004729271, 0.11592015624046326, - -0.04095078632235527, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.039155151695013046, -0.08294370770454407, 0.07291273772716522, -0.019864777103066444, - -0.16237473487854004, 0.00024608770036138594, 0.11558260768651962, 0.11100063472986221, - -0.039155151695013046, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.037396304309368134, -0.07996218651533127, 0.06917132437229156, -0.018844623118638992, - -0.15085050463676453, -0.0002109346241923049, 0.10863377898931503, 0.10615246742963791, - -0.03739631175994873, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.03567468374967575, -0.07693813741207123, 0.06550978869199753, -0.01783733442425728, - -0.1397213637828827, -0.0005957469111308455, 0.10193624347448349, 0.10137931257486343, - -0.03567468002438545, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.033990681171417236, -0.07388222962617874, 0.061931125819683075, -0.01684526354074478, - -0.12900838255882263, -0.0009139083558693528, 0.0954885482788086, 0.09668472409248352, - -0.03399067744612694, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.03234465420246124, -0.07080470770597458, 0.05843814089894295, -0.015870671719312668, - -0.1187293753027916, -0.0011707053054124117, 0.08928896486759186, 0.09207212179899216, - -0.032344650477170944, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.030736954882740974, -0.06771533191204071, 0.055033452808856964, -0.014915564097464085, - -0.10889898240566254, -0.0013713135849684477, 0.08333539217710495, 0.08754473179578781, - -0.030736956745386124, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.029167838394641876, -0.0646233931183815, 0.05171952024102211, -0.013981861993670464, - -0.09952874481678009, -0.0015207086689770222, 0.07762560248374939, 0.08310560882091522, - -0.029167838394641876, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.027637552469968796, -0.06153778359293938, 0.04849862679839134, -0.013071372173726559, - -0.09062736481428146, -0.0016236603260040283, 0.0721571147441864, 0.07875771075487137, - -0.027637552469968796, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.026146303862333298, -0.05846688896417618, 0.04537295550107956, -0.012185714207589626, - -0.082200787961483, -0.0016847813967615366, 0.06692724674940109, 0.07450374960899353, - -0.026146305724978447, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.024694284424185753, -0.05541865527629852, 0.04234447702765465, -0.01132640615105629, - -0.07425208389759064, -0.0017084775026887655, 0.061933085322380066, 0.07034636288881302, - -0.024694284424185753, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.023281635716557503, -0.05240066349506378, 0.039415065199136734, -0.010494772344827652, - -0.06678187102079391, -0.0016990604344755411, 0.057171471416950226, 0.06628800183534622, - -0.023281633853912354, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.0219084732234478, -0.049420066177845, 0.03658636286854744, -0.00969208125025034, - -0.05978817865252495, -0.0016605538548901677, 0.052639104425907135, 0.06233101710677147, - -0.0219084732234478, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.020574919879436493, -0.04648364707827568, 0.0338599719107151, -0.008919419720768929, - -0.053266819566488266, -0.0015968976076692343, 0.048332471400499344, 0.05847766622900963, - -0.020574921742081642, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.019281055778265, -0.0435977466404438, 0.031237252056598663, -0.00817779265344143, - -0.047211337834596634, -0.001511824899353087, 0.04424788057804108, 0.054729994386434555, - -0.019281059503555298, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.018026940524578094, -0.04076840355992317, 0.02871946431696415, -0.007468039635568857, - -0.0416131354868412, -0.0014089138712733984, 0.040381453931331635, 0.0510900504887104, - -0.018026938661932945, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.016812639310956, -0.03800126537680626, 0.026307733729481697, -0.006790905259549618, - -0.036461785435676575, -0.001291578053496778, 0.03672916814684868, 0.0475597009062767, - -0.016812639310956, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.015638193115592003, -0.03530164435505867, 0.024002976715564728, -0.0061470079235732555, - -0.03174496442079544, -0.0011630641529336572, 0.03328676521778107, 0.044140756130218506, - -0.015638193115592003, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.014503653161227703, -0.032674528658390045, 0.021806033328175545, -0.005536847747862339, - -0.027448732405900955, -0.0010264499578624964, 0.030049912631511688, 0.04083495959639549, - -0.014503651298582554, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.013409052975475788, -0.03012460470199585, 0.019717538729310036, -0.004960797261446714, - -0.023557614535093307, -0.0008846784476190805, 0.027014048770070076, 0.03764396905899048, - -0.013409054838120937, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.012354443781077862, -0.027656234800815582, 0.01773800700902939, -0.004419115837663412, - -0.020054759457707405, -0.000740516057703644, 0.024174485355615616, 0.0345693901181221, - -0.012354443781077862, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.01133987307548523, -0.02527349442243576, 0.01586775854229927, -0.003911940380930901, - -0.01692206971347332, -0.0005965532036498189, 0.021526388823986053, 0.03161277621984482, - -0.01133987307548523, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.010365398600697517, -0.02298020012676716, 0.014106973074376583, -0.0034392813686281443, - -0.01414039358496666, -0.0004552392929326743, 0.01906476728618145, 0.028775662183761597, - -0.010365398600697517, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.009431103244423866, -0.020779896527528763, 0.012455654330551624, -0.0030010356567800045, - -0.011689653620123863, -0.000318867911119014, 0.016784464940428734, 0.026059528812766075, - -0.009431102313101292, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.008537079207599163, -0.018675873056054115, 0.010913628153502941, -0.0025969622656702995, - -0.009548990987241268, -0.00018953351536765695, 0.014680217020213604, 0.023465869948267937, - -0.008537078276276588, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.007683467585593462, -0.016671206802129745, 0.009480525739490986, -0.0022267024032771587, - -0.007696948014199734, -6.918366852914914e-05, 0.012746590189635754, 0.02099619247019291, - -0.007683467585593462, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.006870414596050978, -0.014768702909350395, 0.008155771531164646, -0.0018897556001320481, - -0.006111583672463894, 4.042461659992114e-05, 0.01097799465060234, 0.018651971593499184, - -0.006870413664728403, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.006098132114857435, -0.012971017509698868, 0.006938599515706301, -0.0015854892553761601, - -0.004770693369209766, 0.00013769946235697716, 0.009368709288537502, 0.016434770077466965, - -0.0060981339775025845, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.005366886965930462, -0.011280582286417484, 0.005828007124364376, -0.0013131203595548868, - -0.0036519295535981655, 0.00022125912073533982, 0.007912857457995415, 0.014346182346343994, - -0.005366886500269175, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.004676992539316416, -0.00969964824616909, 0.004822746850550175, -0.001071725506335497, - -0.0027329789008945227, 0.00028992959414608777, 0.006604413036257029, 0.012387866154313087, - -0.00467699347063899, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.004028866533190012, -0.008230329491198063, 0.003921313211321831, -0.0008602149900980294, - -0.0019917432218790054, 0.00034275054349564016, 0.005437195301055908, 0.01056160219013691, - -0.004028866067528725, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.0034230093006044626, -0.006874586455523968, 0.003121896181255579, - -0.0006773378700017929, -0.0014064906863495708, 0.0003790171176660806, 0.0044048563577234745, - 0.008869281969964504, -0.0034230095334351063, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.002860055072233081, -0.005634271074086428, 0.0024223709478974342, - -0.0005216567660681903, -0.0009560498874634504, 0.0003982947382610291, 0.0035008839331567287, - 0.007312977686524391, -0.002860055072233081, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.0023407945409417152, -0.004511154722422361, 0.001820240868255496, - -0.00039154590922407806, -0.0006199859781190753, 0.0004004681250080466, 0.0027185967192053795, - 0.005894975736737251, -0.0023407945409417152, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.0018662263173609972, -0.003506954526528716, 0.001312580076046288, - -0.0002851658791769296, -0.0003787866735365242, 0.0003857949050143361, 0.0020511294715106487, - 0.004617841448634863, -0.0018662259681150317, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.0014376264298334718, -0.0026234155520796776, 0.0008959679398685694, - -0.000200449358089827, -0.00021406479936558753, 0.00035498844226822257, 0.0014914474450051785, - 0.003484538523480296, -0.0014376264298334718, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.001056644250638783, -0.0018623523646965623, 0.0005663650226779282, - -0.00013507322000805289, -0.00010875849693547934, 0.0003093429550062865, 0.0010323312599211931, - 0.0024985310155898333, -0.001056644250638783, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.000725491379853338, -0.0012258137576282024, 0.00031896322616375983, - -8.64374014781788e-05, -4.7362176701426506e-05, 0.000250936602242291, 0.0006664295797236264, - 0.001664054929278791, -0.0007254912634380162, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.00044723693281412125, -0.0007162851397879422, 0.00014790390559937805, - -5.164206959307194e-05, -1.616621193534229e-05, 0.00018298540089745075, 0.00038632520590908825, - 0.0009864955209195614, -0.00044723693281412125, 0.0, 0.0, 0.0] -- [0.0, 0.0, -0.00022644895943813026, -0.0003371459024492651, 4.577590152621269e-05, - -2.7496598704601638e-05, -3.538160626703757e-06, 0.0001105607661884278, 0.00018478826677892357, - 0.00047320645535364747, -0.00022644895943813026, 0.0, 0.0, 0.0] -- [0.0, 0.0, -7.08760489942506e-05, -9.38794546527788e-05, 2.4477451461279998e-06, - -1.0705648492148612e-05, -2.616207268602011e-07, 4.2420706449775025e-05, 5.566438630921766e-05, - 0.00013565934204962105, -7.087604171829298e-05, 0.0, 0.0, 0.0] -- [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] -q20: 2.7224999999999997 -replica: 316 -xgrid: [1e-09, 1.29708482343957e-09, 1.68242903474257e-09, 2.18225315420583e-09, 2.83056741739819e-09, - 3.67148597892941e-09, 4.76222862935315e-09, 6.1770142737618e-09, 8.01211109898438e-09, - 1.03923870607245e-08, 1.34798064073805e-08, 1.74844503691778e-08, 2.26788118881103e-08, - 2.94163370300835e-08, 3.81554746595878e-08, 4.94908707232129e-08, 6.41938295708371e-08, - 8.32647951986859e-08, 1.08001422993829e-07, 1.4008687308113e-07, 1.81704331793772e-07, - 2.35685551545377e-07, 3.05703512595323e-07, 3.96522309841747e-07, 5.1432125723657e-07, - 6.67115245136676e-07, 8.65299922973143e-07, 1.12235875241487e-06, 1.45577995547683e-06, - 1.88824560514613e-06, 2.44917352454946e-06, 3.17671650028717e-06, 4.12035415232797e-06, - 5.3442526575209e-06, 6.93161897806315e-06, 8.99034258238145e-06, 1.16603030112258e-05, - 1.51228312288769e-05, 1.96129529349212e-05, 2.54352207134502e-05, 3.29841683435992e-05, - 4.27707053972016e-05, 5.54561248105849e-05, 7.18958313632514e-05, 9.31954227979614e-05, - 0.00012078236773133, 0.000156497209466554, 0.000202708936328495, 0.000262459799331951, - 0.000339645244168985, 0.000439234443000422, 0.000567535660104533, 0.000732507615725537, - 0.000944112105452451, 0.00121469317686978, 0.00155935306118224, 0.00199627451141338, - 0.00254691493736552, 0.00323597510213126, 0.00409103436509565, 0.00514175977083962, - 0.00641865096062317, 0.00795137940306351, 0.009766899996241, 0.0118876139251364, - 0.0143298947643919, 0.0171032279460271, 0.0202100733925079, 0.0236463971369542, - 0.0274026915728357, 0.0314652506132444, 0.0358174829282429, 0.0404411060163317, - 0.0453171343973807, 0.0504266347950069, 0.0557512610084339, 0.0612736019390519, - 0.0669773829498255, 0.0728475589986517, 0.0788703322292727, 0.0850331197801452, - 0.0913244910278679, 0.0977340879783772, 0.104252538208639, 0.110871366547237, 0.117582909372878, - 0.124380233801599, 0.131257062945031, 0.138207707707289, 0.145227005135651, 0.152310263065985, - 0.159453210652156, 0.166651954293987, 0.173902938455578, 0.181202910873333, 0.188548891679097, - 0.195938145999193, 0.203368159629765, 0.210836617429103, 0.218341384106561, 0.225880487124065, - 0.233452101459503, 0.241054536011681, 0.248686221452762, 0.256345699358723, 0.264031612468684, - 0.271742695942783, 0.279477769504149, 0.287235730364833, 0.295015546847664, 0.302816252626866, - 0.310636941519503, 0.318476762768082, 0.326334916761672, 0.334210651149156, 0.342103257303627, - 0.350012067101685, 0.357936449985571, 0.365875810279643, 0.373829584735962, 0.381797240286494, - 0.389778271981947, 0.397772201099286, 0.40577857340234, 0.413796957540671, 0.421826943574548, - 0.429868141614175, 0.437920180563205, 0.44598270695699, 0.454055383887562, 0.462137890007651, - 0.470229918607142, 0.478331176755675, 0.486441384506059, 0.494560274153348, 0.502687589545177, - 0.510823085439086, 0.518966526903235, 0.527117688756998, 0.535276355048428, 0.543442318565661, - 0.551615380379768, 0.559795349416641, 0.5679820420558, 0.576175281754088, 0.584374898692498, - 0.59258072944444, 0.60079261666395, 0.609010408792398, 0.61723395978245, 0.625463128838069, - 0.633697780169485, 0.641937782762089, 0.650183010158361, 0.658433340251944, 0.666688655093089, - 0.674948840704708, 0.683213786908386, 0.691483387159697, 0.699757538392251, 0.708036140869916, - 0.716319098046733, 0.724606316434025, 0.732897705474271, 0.741193177421404, 0.749492647227008, - 0.757796032432224, 0.766103253064927, 0.774414231541921, 0.782728892575836, 0.791047163086478, - 0.799368972116378, 0.807694250750291, 0.816022932038457, 0.824354950923382, 0.832690244169987, - 0.841028750298844, 0.8493704095226, 0.857715163684985, 0.866062956202683, 0.874413732009721, - 0.882767437504206, 0.891124020497459, 0.899483430165226, 0.907845617001021, 0.916210532771399, - 0.924578130473112, 0.932948364292029, 0.941321189563734, 0.949696562735755, 0.958074441331298, - 0.966454783914439, 0.974837550056705, 0.983222700304978, 0.991610196150662, 1.0] diff --git a/extra_tests/regression_fits/multi_dense_316.json b/extra_tests/regression_fits/multi_dense_316.json deleted file mode 100644 index d1ff7d0767..0000000000 --- a/extra_tests/regression_fits/multi_dense_316.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "preprocessing": [ - { - "fl": "sng", - "smallx": 1.1168484687805176, - "largex": 1.4932247400283813, - "trainable": false - }, - { - "fl": "g", - "smallx": 0.9923287034034729, - "largex": 3.7714877128601074, - "trainable": false - }, - { - "fl": "v", - "smallx": 0.4898352324962616, - "largex": 1.672149658203125, - "trainable": false - }, - { - "fl": "v3", - "smallx": 0.28436920046806335, - "largex": 3.4038245677948, - "trainable": false - }, - { - "fl": "v8", - "smallx": 0.635401725769043, - "largex": 1.9356087446212769, - "trainable": false - }, - { - "fl": "t3", - "smallx": 0.5063296556472778, - "largex": 2.4878852367401123, - "trainable": false - }, - { - "fl": "t8", - "smallx": 0.8517391681671143, - "largex": 2.7349023818969727, - "trainable": false - }, - { - "fl": "t15", - "smallx": 1.1255686283111572, - "largex": 1.68263578414917, - "trainable": false - } - ], - "stop_epoch": 1100, - "best_epoch": 1099, - "erf_tr": 2.4744620323181152, - "erf_vl": 2.905952215194702, - "chi2": 2.118803024291992, - "pos_state": "POS_VETO", - "arc_lengths": [ - 1.3125837362888904, - 1.4889504508820537, - 1.1794334718334645, - 1.0006968075180218, - 1.2461907760321072 - ], - "integrability": [ - 0.0008942503627631937, - 0.0008942503627628051, - 5.014488272003792e-05, - 0.46068788319826015, - 0.007144232804419559 - ], - "timing": { - "walltime": { - "Total": 11.391953229904175, - "start": 0.0, - "replica_set": 0.22628402709960938, - "replica_fitted": 11.391895294189453, - "replica_set_to_replica_fitted": 11.165611267089844 - }, - "cputime": { - "Total": 13.023389705, - "start": 0.0, - "replica_set": 0.2253089749999999, - "replica_fitted": 13.023330024, - "replica_set_to_replica_fitted": 12.798021048999999 - } - }, - "version": { - "keras": "3.6.0", - "tensorflow": "2.18.0, mkl=False", - "numpy": "1.26.4", - "nnpdf": "4.0.9.post1608.dev0+77c3343e3", - "validphys": "4.0.9.post1608.dev0+77c3343e3" - } -} diff --git a/n3fit/runcards/examples/Basic_runcard_parallel.yml b/n3fit/runcards/examples/Basic_runcard_parallel.yml index 5529c5fb73..5a11eee838 100644 --- a/n3fit/runcards/examples/Basic_runcard_parallel.yml +++ b/n3fit/runcards/examples/Basic_runcard_parallel.yml @@ -50,12 +50,8 @@ parameters: # This defines the parameter dictionary that is passed to the Model threshold_chi2: 5.0 fitting: - sum_rules: "All" - # NN23(QED) = sng=0,g=1,v=2,t3=3,ds=4,sp=5,sm=6,(pht=7) - # EVOL(QED) = sng=0,g=1,v=2,v3=3,v8=4,t3=5,t8=6,(pht=7) - # EVOLS(QED)= sng=0,g=1,v=2,v8=4,t3=4,t8=5,ds=6,(pht=7) - # FLVR(QED) = g=0, u=1, ubar=2, d=3, dbar=4, s=5, sbar=6, (pht=7) fitbasis: NN31IC # EVOL (7), EVOLQED (8), etc. + savepseudodata: False basis: # remeber to change the name of PDF accordingly with fitbasis # smallx, largex: preprocessing ranges diff --git a/n3fit/src/n3fit/backends/__init__.py b/n3fit/src/n3fit/backends/__init__.py index 908348c79c..9a4b545536 100644 --- a/n3fit/src/n3fit/backends/__init__.py +++ b/n3fit/src/n3fit/backends/__init__.py @@ -19,6 +19,6 @@ set_eager, set_initial_state, ) -from n3fit.backends.keras_backend.multi_dense import MultiInitializer +from n3fit.backends.keras_backend.multi_initializer import MultiInitializer print("Using Keras backend") diff --git a/n3fit/src/n3fit/backends/keras_backend/base_layers.py b/n3fit/src/n3fit/backends/keras_backend/base_layers.py index 6a21a26480..2ed2628293 100644 --- a/n3fit/src/n3fit/backends/keras_backend/base_layers.py +++ b/n3fit/src/n3fit/backends/keras_backend/base_layers.py @@ -25,7 +25,6 @@ from tensorflow.keras.regularizers import l1_l2 from .MetaLayer import MetaLayer -from .multi_dense import MultiDense from .operations import concatenate_function @@ -132,18 +131,6 @@ def apply_dense(xinput): layers = { - "multidense": ( - MultiDense, - { - "replica_seeds": None, - "base_seed": 0, - "kernel_initializer": "glorot_normal", - "units": 5, - "activation": "sigmoid", - "kernel_regularizer": None, - "is_first_layer": False, - }, - ), "dense": ( Dense, { diff --git a/n3fit/src/n3fit/backends/keras_backend/multi_dense.py b/n3fit/src/n3fit/backends/keras_backend/multi_dense.py deleted file mode 100644 index 07b045fb45..0000000000 --- a/n3fit/src/n3fit/backends/keras_backend/multi_dense.py +++ /dev/null @@ -1,193 +0,0 @@ -""" - Extend the ``Dense`` layer from Keras to act on an arbitrary number of replicas. - This extension provides a performance improvement with respect to the original - Dense layer from Keras even in the single replica case. -""" # Tested last: Feb 2024 - -import tensorflow as tf -from tensorflow.keras.initializers import Initializer -from tensorflow.keras.layers import Dense - -# Note for developers: -# This class plays with fire as it exploits the internals of Keras -# In particular, when saving the weights of the model, the current version (3.2) -# will rely on the existence of Dense being formed by two weights: a kernel and a bias -# the kernel variable is saved in the `_kernel` attribute while the bias in `bias`. -# These should, in addition, correspond to weights "0" and "1" (and are saved as such). -# but this is not a public interface and so it could change at any point. -# In addition, from 3.2 the only accepted filename is `.weight.h5` - - -class MultiDense(Dense): - """ - Dense layer for multiple replicas at the same time. - - For the first layer in the network, (for which ``is_first_layer`` should be set to True), - the input shape is (batch_size, gridsize, features), still without a replica axis. - In this case this layer acts as a stack of single dense layers, - with their own kernel and bias, acting on the same input. - - For subsequent layers, the input already contains multiple replicas, and the shape is - (batch_size, replicas, gridsize, features). - In this case, the input for each replica is multiplied by its own slice of the kernel. - - Weights are initialized using a `replica_seeds` list of seeds, and are identical to the - weights of a list of single dense layers with the same `replica_seeds`. - - Parameters - ---------- - replica_seeds: List[int] - List of seeds per replica for the kernel initializer. - kernel_initializer: Initializer - Initializer class for the kernel. - is_first_layer: bool (default: False) - Whether this is the first MultiDense layer in the network, and so the input shape - does not contain a replica axis. - base_seed: int (default: 0) - Base seed for the single replica initializer to which the replica seeds are added. - """ - - def __init__( - self, - replica_seeds: list[int], - kernel_initializer: Initializer, - is_first_layer: bool = False, - base_seed: int = 0, - **kwargs, - ): - super().__init__(**kwargs) - self.replicas = len(replica_seeds) - self.replica_seeds = replica_seeds - self.kernel_initializer = MultiInitializer( - single_initializer=kernel_initializer, replica_seeds=replica_seeds, base_seed=base_seed - ) - self.bias_initializer = MultiInitializer( - single_initializer=self.bias_initializer, - replica_seeds=replica_seeds, - base_seed=base_seed, - ) - self.is_first_layer = is_first_layer - - # Definition of the convolution between the input of the layer and the kernel parameters - # it is defined during the build stage. - self.matmul = None - - # See note above - self._kernel = None - self.bias = None - - def build(self, input_shape): - input_dim = input_shape[-1] - self._kernel = self.add_weight( - name="kernel", - shape=(self.replicas, input_dim, self.units), - initializer=self.kernel_initializer, - regularizer=self.kernel_regularizer, - constraint=self.kernel_constraint, - ) - if self.use_bias: - self.bias = self.add_weight( - name="bias", - shape=(self.replicas, 1, self.units), - initializer=self.bias_initializer, - regularizer=self.bias_regularizer, - constraint=self.bias_constraint, - ) - else: - self.bias = None - self.input_spec.axes = {-1: input_dim} - self.built = True - - # Using tensordot here for numerical stability with 4.0 fits - # TODO: benchmark against the replica-agnostic einsum below and make that default - # see https://github.com/NNPDF/nnpdf/pull/1905#discussion_r1489344081 - if self.replicas == 1: - matmul = lambda inputs: tf.tensordot(inputs, self._kernel[0], [[-1], [0]]) - if self.is_first_layer: - # Manually add replica dimension - self.matmul = lambda x: tf.expand_dims(matmul(x), axis=1) - else: - self.matmul = matmul - else: - einrule = "bnf,rfg->brng" if self.is_first_layer else "brnf,rfg->brng" - self.matmul = lambda inputs: tf.einsum(einrule, inputs, self._kernel) - - def call(self, inputs): - """ - Compute output of shape (batch_size, replicas, gridsize, units). - - For the first layer, this is equivalent to - applying each replica separately and concatenating along the last axis. - If the input already contains multiple replica outputs, it is equivalent - to applying each replica to its corresponding input. - """ - # cast always - inputs = tf.cast(inputs, dtype=self.compute_dtype) - - outputs = self.matmul(inputs) - - # Reshape the output back to the original ndim of the input. - if not tf.executing_eagerly(): - output_shape = self.compute_output_shape(inputs.shape.as_list()) - outputs.set_shape(output_shape) - - if self.use_bias: - outputs = outputs + self.bias - - if self.activation is not None: - outputs = self.activation(outputs) - - return outputs - - def compute_output_shape(self, input_shape): - if not self.is_first_layer: - # Remove the replica axis from the input shape. - input_shape = input_shape[:1] + input_shape[2:] - - output_shape = super().compute_output_shape(input_shape) - - # Add back the replica axis to the output shape. - output_shape = output_shape[:1] + (self.replicas,) + output_shape[1:] - - return output_shape - - def get_config(self): - config = super().get_config() - config.update({"is_first_layer": self.is_first_layer, "replica_seeds": self.replica_seeds}) - return config - - -class MultiInitializer(Initializer): - """ - Multi replica initializer that exactly replicates a stack of single replica initializers. - - Weights are stacked on the first axis, and per replica seeds are added to a base seed of the - given single replica initializer. - - Parameters - ---------- - single_initializer: Initializer - Initializer class for the kernel. - replica_seeds: List[int] - List of seeds per replica for the kernel initializer. - base_seed: int - Base seed for the single replica initializer to which the replica seeds are added. - """ - - def __init__(self, single_initializer: Initializer, replica_seeds: list[int], base_seed: int): - self.initializer_class = type(single_initializer) - self.initializer_config = single_initializer.get_config() - self.base_seed = base_seed - self.replica_seeds = replica_seeds - - def __call__(self, shape, dtype=None, **kwargs): - shape = shape[1:] # Remove the replica axis from the shape. - per_replica_weights = [] - for replica_seed in self.replica_seeds: - if "seed" in self.initializer_config: - self.initializer_config["seed"] = int(self.base_seed + replica_seed) - single_initializer = self.initializer_class.from_config(self.initializer_config) - - per_replica_weights.append(single_initializer(shape, dtype, **kwargs)) - - return tf.stack(per_replica_weights, axis=0) diff --git a/n3fit/src/n3fit/backends/keras_backend/multi_initializer.py b/n3fit/src/n3fit/backends/keras_backend/multi_initializer.py new file mode 100644 index 0000000000..e3034c8e8e --- /dev/null +++ b/n3fit/src/n3fit/backends/keras_backend/multi_initializer.py @@ -0,0 +1,44 @@ +""" + Extend the ``Initializer`` from Keras to initialize an arbitrary number of replicas, + with a behaviour equal to initiailizing a bunch of replicas and then stacking them. +""" + +from keras.initializers import Initializer + +from .operations import stack + + +class MultiInitializer(Initializer): + """ + Multi replica initializer that exactly replicates a stack of single replica initializers. + + Weights are stacked on the first axis, and per replica seeds are added to a base seed of the + given single replica initializer. + + Parameters + ---------- + single_initializer: Initializer + Initializer class for the kernel. + replica_seeds: List[int] + List of seeds per replica for the kernel initializer. + base_seed: int + Base seed for the single replica initializer to which the replica seeds are added. + """ + + def __init__(self, single_initializer: Initializer, replica_seeds: list[int], base_seed: int): + self.initializer_class = type(single_initializer) + self.initializer_config = single_initializer.get_config() + self.base_seed = base_seed + self.replica_seeds = replica_seeds + + def __call__(self, shape, dtype=None, **kwargs): + shape = shape[1:] # Remove the replica axis from the shape. + per_replica_weights = [] + for replica_seed in self.replica_seeds: + if "seed" in self.initializer_config: + self.initializer_config["seed"] = int(self.base_seed + replica_seed) + single_initializer = self.initializer_class.from_config(self.initializer_config) + + per_replica_weights.append(single_initializer(shape, dtype, **kwargs)) + + return stack(per_replica_weights, axis=0) diff --git a/n3fit/src/n3fit/checks.py b/n3fit/src/n3fit/checks.py index 86f961c7e8..32c2d26acf 100644 --- a/n3fit/src/n3fit/checks.py +++ b/n3fit/src/n3fit/checks.py @@ -135,7 +135,7 @@ def check_initializer(initializer): def check_layer_type_implemented(parameters): """Checks whether the layer_type is implemented""" layer_type = parameters.get("layer_type") - implemented_types = ["dense", "dense_per_flavour", "multidense"] + implemented_types = ["dense", "dense_per_flavour"] if layer_type not in implemented_types: raise CheckError( f"Layer type {layer_type} not implemented, must be one of {implemented_types}" diff --git a/n3fit/src/n3fit/model_gen.py b/n3fit/src/n3fit/model_gen.py index ee88da1ad3..852f93caf3 100644 --- a/n3fit/src/n3fit/model_gen.py +++ b/n3fit/src/n3fit/model_gen.py @@ -778,22 +778,6 @@ def layer_generator(i_layer, nodes_out, activation): ) return layers - elif layer_type == "multidense": - - def layer_generator(i_layer, nodes_out, activation): - """Generate the ``i_layer``-th MetaLayer.MultiDense layer for all replicas.""" - return base_layer_selector( - layer_type, - replica_seeds=replica_seeds, - kernel_initializer=MetaLayer.select_initializer(initializer_name), - base_seed=i_layer, - units=int(nodes_out), - activation=activation, - is_first_layer=(i_layer == 0), - regularizer=reg, - name=f"multi_dense_{i_layer}", - ) - else: raise ValueError(f"{layer_type=} not recognized during model generation") @@ -815,15 +799,6 @@ def layer_generator(i_layer, nodes_out, activation): concat = base_layer_selector("concatenate") list_of_pdf_layers[-1] = [lambda x: concat(layer(x)) for layer in list_of_pdf_layers[-1]] - # In the `layer_type` multidense we have a `MultiDense` layer and we can get out here - if layer_type == "multidense": - pdfs = x_input - for layer in list_of_pdf_layers: - pdfs = layer(pdfs) - model = MetaModel({'NN_input': x_input}, pdfs, name=NN_LAYER_ALL_REPLICAS) - - return model - pdfs = [layer(x_input) for layer in list_of_pdf_layers[0]] for layers in list_of_pdf_layers[1:]: diff --git a/n3fit/src/n3fit/tests/test_modelgen.py b/n3fit/src/n3fit/tests/test_modelgen.py index 2e35441576..b993380229 100644 --- a/n3fit/src/n3fit/tests/test_modelgen.py +++ b/n3fit/src/n3fit/tests/test_modelgen.py @@ -37,22 +37,6 @@ def test_generate_dense_network(): assert weight.shape == esize -def test_generate_multi_dense_network(): - nn = generate_nn("multidense", **COMMON_ARGS) - - # The number of layers should be input layer + len(OUT_SIZES) - assert len(nn.layers) == len(OUT_SIZES) + 1 - # Check that the number of parameters is as expected - expected_sizes = [ - (1, INSIZE, OUT_SIZES[0]), - (1, 1, OUT_SIZES[0]), - (1, *OUT_SIZES), - (1, 1, OUT_SIZES[1]), - ] - for weight, esize in zip(nn.weights, expected_sizes): - assert weight.shape == esize - - def test_generate_dense_per_flavour_network(): nn = generate_nn("dense_per_flavour", **COMMON_ARGS).get_layer(f"{NN_PREFIX}_0") diff --git a/n3fit/src/n3fit/tests/test_multidense.py b/n3fit/src/n3fit/tests/test_multidense.py deleted file mode 100644 index b074e3b2e0..0000000000 --- a/n3fit/src/n3fit/tests/test_multidense.py +++ /dev/null @@ -1,76 +0,0 @@ -import numpy as np -import tensorflow as tf -from tensorflow.keras import Sequential -from tensorflow.keras.initializers import GlorotUniform -from tensorflow.keras.layers import Dense - -from n3fit.backends.keras_backend.multi_dense import MultiDense - - -def test_multidense(): - replicas = 2 - multi_dense_model = Sequential( - [ - MultiDense( - units=8, - replica_seeds=[42, 43], - is_first_layer=True, - kernel_initializer=GlorotUniform(), - base_seed=5, - ), - MultiDense( - units=4, replica_seeds=[52, 53], base_seed=100, kernel_initializer=GlorotUniform() - ), - ] - ) - single_models = [] - for r in range(replicas): - single_models.append( - Sequential( - [ - Dense(units=8, kernel_initializer=GlorotUniform(seed=42 + r + 5)), - Dense(units=4, kernel_initializer=GlorotUniform(seed=52 + r + 100)), - ] - ) - ) - - gridsize, features = 100, 3 - multi_dense_model.build(input_shape=(None, gridsize, features)) - for single_model in single_models: - single_model.build(input_shape=(None, gridsize, features)) - - test_input = tf.random.uniform(shape=(1, gridsize, features)) - multi_dense_output = multi_dense_model(test_input) - single_dense_output = tf.stack( - [single_model(test_input) for single_model in single_models], axis=1 - ) - - np.testing.assert_allclose(multi_dense_output, single_dense_output, atol=1e-6, rtol=1e-4) - - -def test_initializers(): - input_shape = (None, 3, 1) - dense_weights = [] - for r in range(2): - dense_layer = Dense(units=2, kernel_initializer=GlorotUniform(seed=42 + r)) - dense_layer.build(input_shape=input_shape) - try: - dense_weights.append(dense_layer.weights[0].value.numpy()) - except AttributeError: - # In tensorflow < 2.16, value was a function - dense_weights.append(dense_layer.weights[0].value().numpy()) - - stacked_weights = np.stack(dense_weights, axis=0) - - multi_dense_layer = MultiDense( - units=2, - replica_seeds=[0, 1], - is_first_layer=True, - kernel_initializer=GlorotUniform(), - base_seed=42, - ) - multi_dense_layer.build(input_shape=input_shape) - - multi_dense_weights = multi_dense_layer.weights[0].numpy() - - np.testing.assert_allclose(multi_dense_weights, stacked_weights)