From 660cc219fbb4e160552a8203a28a2aa486026fa6 Mon Sep 17 00:00:00 2001 From: "Juan M. Cruz-Martinez" Date: Sat, 27 Jan 2024 18:59:28 +0100 Subject: [PATCH 1/3] update fit bot for a replica-by-replica fit --- .github/workflows/fitbot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fitbot.yml b/.github/workflows/fitbot.yml index a238776f9c..be4dcb71a4 100644 --- a/.github/workflows/fitbot.yml +++ b/.github/workflows/fitbot.yml @@ -77,7 +77,7 @@ jobs: run: | conda activate nnpdfenv cd $RUNFOLDER - for ((i=1; i<=$N3FIT_MAXNREP; i+=2)); do n3fit $RUNCARD.yml $i -r $((i+1)); done + for ((i=1; i<=$N3FIT_MAXNREP; i+=1)); do n3fit $RUNCARD.yml $i ; done # performing DGLAP - name: Running dglap shell: bash -l {0} From d8f64e04c627c3f300d6ed32611aae5b182eec1a Mon Sep 17 00:00:00 2001 From: juacrumar Date: Sun, 28 Jan 2024 12:22:45 +0100 Subject: [PATCH 2/3] fix bug from #1881: weights were saved by ref --- n3fit/src/n3fit/backends/keras_backend/MetaModel.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/n3fit/src/n3fit/backends/keras_backend/MetaModel.py b/n3fit/src/n3fit/backends/keras_backend/MetaModel.py index fde7c4f987..e4f5459c57 100644 --- a/n3fit/src/n3fit/backends/keras_backend/MetaModel.py +++ b/n3fit/src/n3fit/backends/keras_backend/MetaModel.py @@ -341,9 +341,9 @@ def get_replica_weights(self, i_replica): """ Get the weights of replica i_replica. - This assumes that the only weights are in layers called - ``NN_{i_replica}`` and ``preprocessing_factor_{i_replica}`` - + This assumes that the only weights are in the + layer types defined as the constants + NN_LAYER_ALL_REPLICAS & PREPROCESSING_LAYER_ALL_REPLICAS Parameters ---------- @@ -458,7 +458,8 @@ def get_layer_replica_weights(layer, i_replica: int): list of weights for the replica """ if is_stacked_single_replicas(layer): - weights = layer.get_layer(f"{NN_PREFIX}_{i_replica}").weights + weights_ref = layer.get_layer(f"{NN_PREFIX}_{i_replica}").weights + weights = [tf.Variable(w, name=w.name) for w in weights_ref] else: weights = [tf.Variable(w[i_replica : i_replica + 1], name=w.name) for w in layer.weights] From 209f3108296ee5f56ec29cebd3f1b5a092ccecab Mon Sep 17 00:00:00 2001 From: juacrumar Date: Sun, 28 Jan 2024 18:04:24 +0100 Subject: [PATCH 3/3] ensure pdf exists on test so it is not order dependent --- validphys2/src/validphys/tests/photon/test_compute.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/validphys2/src/validphys/tests/photon/test_compute.py b/validphys2/src/validphys/tests/photon/test_compute.py index 0cd51c561c..64e3cda263 100644 --- a/validphys2/src/validphys/tests/photon/test_compute.py +++ b/validphys2/src/validphys/tests/photon/test_compute.py @@ -17,6 +17,8 @@ def generate_fiatlux_runcard(): + # Ensures the PDF from conftest exists + _ = FallbackLoader().check_pdf(PDF) return { "luxset": PDFset(PDF), # check if "LUXqed17_plus_PDF4LHC15_nnlo_100" is installed