diff --git a/doc/sphinx/source/n3fit/runcard_detailed.rst b/doc/sphinx/source/n3fit/runcard_detailed.rst index 89cf5bc07f..3c79a353c7 100644 --- a/doc/sphinx/source/n3fit/runcard_detailed.rst +++ b/doc/sphinx/source/n3fit/runcard_detailed.rst @@ -74,17 +74,16 @@ It is possible to run a fit with no validation set by setting the fraction to `` Network Architecture -------------------- There are different network architectures implemented in ``n3fit``. -Which can be selected by changing the ``fitting:parameters::layer_type`` parameter in the runcard. +Which can be selected by changing the ``parameters::layer_type`` parameter in the runcard. All layer types implement the ``nodes_per_layer``, ``activation_per_layer`` and ``initializer`` parameters. .. code-block:: yaml - fitting: - parameters: - nodes_per_layer: [5, 3, 8] - activation_per_layer: ['tanh', 'tanh', 'linear'] - layer_type: 'dense_per_flavour' - initializer: 'glorot_normal' + parameters: + nodes_per_layer: [5, 3, 8] + activation_per_layer: ['tanh', 'tanh', 'linear'] + layer_type: 'dense_per_flavour' + initializer: 'glorot_normal' - **One single network** (``layer_type: dense``): @@ -117,12 +116,11 @@ of optimizer (and its corresponding options). .. code-block:: yaml - fitting: - parameters: - optimizer: - optimizer_name: 'Adadelta' - learning_rate: 1.0 - clipnorm: 1.0 + parameters: + optimizer: + optimizer_name: 'Adadelta' + learning_rate: 1.0 + clipnorm: 1.0 The full list of optimizers accepted by the ``n3fit`` and their arguments @@ -136,13 +134,13 @@ Positivity ---------- In ``n3fit`` the behavior of the positivity observables has changed with respect to ``nnfit``. -In ``nnfit`` the loss due to the positivity observable was multiplied by a ``poslambda`` for each observable, defined in the runcard as: +In ``nnfit`` the loss due to the positivity observable was multiplied by a ``maxlambda`` for each observable, defined in the runcard as: .. code-block:: yaml positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} This behavior was found to be very inefficient for gradient descent based strategies and was exchanged for a dynamical Lagrange multiplier. @@ -152,19 +150,18 @@ the Neural Network as: .. code-block:: yaml - fitting: - parameters: - positivity: - threshold: 1e-6 - multiplier: 1.05 - initial: 14.5 + parameters: + positivity: + threshold: 1e-6 + multiplier: 1.05 + initial: 14.5 Note that by defining the positivity in this way all datasets will share the same Lagrange multiplier. It is also possible to not define the positivity hyperparameters (or define them only partially). In this case ``n3fit`` will set the initial Lagrange multiplier as ``initial`` (default: 1.0) while the ``multiplier`` will be such that after the last epoch the final Lagrange multiplier -equals the ``poslambda`` defined for the dataset. +equals the ``maxlambda`` defined for the dataset. Finally we have the positivity threshold, which is set to ``1e-6`` by default. During the fit, the positivity loss will be compared to this value. If it is above it, @@ -200,9 +197,8 @@ Threshold :math:`\chi2` .. code-block:: yaml - fitting: - parameters: - threshold_chi2: 4.0 + parameters: + threshold_chi2: 4.0 - ``threshold_chi2``: sets a maximum validation :math:`\chi2` for the stopping to activate. Avoids (too) early stopping. @@ -220,10 +216,9 @@ In order to enable the TensorBoard callback in ``n3fit`` it is enough with addin .. code-block:: yaml - fitting: - tensorboard: - weight_freq: 100 - profiling: True + tensorboard: + weight_freq: 100 + profiling: True The ``weight_freq`` flag controls each how many epochs the weights of the NN are stored. @@ -267,9 +262,8 @@ Threshold :math:`\chi2` .. code-block:: yaml - fitting: - parameters: - threshold_chi2: 4.0 + parameters: + threshold_chi2: 4.0 - ``threshold_chi2``: sets a maximum validation :math:`\chi2` for the stopping to activate. Avoids (too) early stopping. @@ -279,9 +273,8 @@ Save and load weights of the model .. code-block:: yaml - fitting: - save: "weights.h5" - load: "weights.h5" + save: "weights.h5" + load: "weights.h5" - ``save``: saves the weights of the PDF model in the selected file in the replica folder. - ``load``: loads the weights of the PDF model from the selected file. diff --git a/doc/sphinx/source/tutorials/pseudodata.md b/doc/sphinx/source/tutorials/pseudodata.md index cae613732a..fc864b8435 100644 --- a/doc/sphinx/source/tutorials/pseudodata.md +++ b/doc/sphinx/source/tutorials/pseudodata.md @@ -2,7 +2,7 @@ Suppose one has obtained a fit using the N3FIT framework and wants to do some analysis that requires knowing exactly the data that the neural networks saw during the fitting procedure. Thankfully, this -information is reproducible due to the various seeds in the `fitting` namespace in the fit runcard. +information is reproducible due to the various seeds in the fit runcard. The 3 seeds of interest are `trvlseed` which determines the training/validation splitting, `nnseed` which concerns the initialization of the neural netowrks themselves, and finally `mcseed` which is the diff --git a/doc/sphinx/source/tutorials/run-fit.md b/doc/sphinx/source/tutorials/run-fit.md index f91d5f49a6..0c462e321d 100644 --- a/doc/sphinx/source/tutorials/run-fit.md +++ b/doc/sphinx/source/tutorials/run-fit.md @@ -28,11 +28,10 @@ experimental data, the theory setup and the fitting setup. The `n3fit` code accepts the same YAML keys used by `nnfit` and extra keys required by the new techniques introduced in [Methodology](methodology). -In particular we introduce new keys in the `fitting` section such as: +In particular we introduce new keys in the fit runcard such as: - different seeds for the training and validation split (`trvlseed`), neural network intialization (`nnseed`) and the MC data replica generation (`mcseed`). -- some debug flags to store or load the model in/from hd5 files (`save`, -`savefile`, `load`, `loadfile`, `plot`) +- some debug flags to store or load the model in/from hd5 files (`save`, `load`) - a new `parameters` dictionnary with the model specifications based on the arguments described in [Methodology](methodology). @@ -40,28 +39,23 @@ See, as an example, the following self explanatory runcard fragment: ```yaml # runcard example ... -fitting: - trvlseed: 1 - nnseed: 2 - mcseed: 3 - save: False - savefile: 'weights.hd5' - load: False - loadfile: 'weights.hd5' - plot: False - - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 8] - activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - learning_rate: 0.01 - optimizer: 'RMSprop' - epochs: 900 - pos_multiplier: 1.05 - pos_initial: # believe the pos_lambda below - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 +trvlseed: 1 +nnseed: 2 +mcseed: 3 +genrep: true + +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 8] + activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + learning_rate: 0.01 + optimizer: 'RMSprop' + epochs: 900 + pos_multiplier: 1.05 + pos_initial: # believe the pos_lambda below + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 ... ``` diff --git a/doc/validphys2/guide.md b/doc/validphys2/guide.md index 337fe2f473..af47685e8c 100644 --- a/doc/validphys2/guide.md +++ b/doc/validphys2/guide.md @@ -2848,7 +2848,7 @@ resource we are providing does. The docstring will be seen in ```python def parse_posdataset(self, posset:dict, * ,theoryid): """An observable used as positivity constrain in the fit. - It is a mapping containing 'dataset' and 'poslambda'.""" + It is a mapping containing 'dataset' and 'maxlambda'.""" ... ``` @@ -2938,10 +2938,10 @@ errors (see the other examples in the class). The `PositivytySetSpec` could be defined roughly like: ```python class PositivitySetSpec(): - def __init__(self, commondataspec, fkspec, poslambda, thspec): + def __init__(self, commondataspec, fkspec, maxlambda, thspec): self.commondataspec = commondataspec self.fkspec = fkspec - self.poslambda = poslambda + self.maxlambda = maxlambda self.thspec = thspec @property @@ -2955,7 +2955,7 @@ The `PositivytySetSpec` could be defined roughly like: def load(self): cd = self.commondataspec.load() fk = self.fkspec.load() - return PositivitySet(cd, fk, self.poslambda) + return PositivitySet(cd, fk, self.maxlambda) ``` Here `PositivitySet` is the `libnnpdf` object. It is generally better to pass around the spec objects because they are lighter and have more @@ -2966,21 +2966,21 @@ With this, our parser method could look like this: def parse_posdataset(self, posset:dict, * ,theoryid): """An observable used as positivity constrain in the fit. - It is a mapping containing 'dataset' and 'poslambda'.""" + It is a mapping containing 'dataset' and 'maxlambda'.""" bad_msg = ("posset must be a mapping with a name ('dataset') and " - "a float multiplier(poslambda)") + "a float multiplier(maxlambda)") theoryno, theopath = theoryid try: name = posset['dataset'] - poslambda = float(posset['poslambda']) + maxlambda = float(posset['maxlambda']) except KeyError as e: raise ConfigError(bad_msg, e.args[0], posset.keys()) from e except ValueError as e: raise ConfigError(bad_msg) from e try: - return self.loader.check_posset(theoryno, name, poslambda) + return self.loader.check_posset(theoryno, name, maxlambda) except FileNotFoundError as e: raise ConfigError(e) from e ``` diff --git a/n3fit/runcards/Basic_feature_scaling.yml b/n3fit/runcards/Basic_feature_scaling.yml index b8e95db28a..41e326ae65 100644 --- a/n3fit/runcards/Basic_feature_scaling.yml +++ b/n3fit/runcards/Basic_feature_scaling.yml @@ -34,40 +34,37 @@ theory: theoryid: 53 # database id ############################################################ -fitting: - trvlseed: 1 - nnseed: 2 - mcseed: 3 - epochs: 900 - save: 'weights.h5' -# load: '/path/to/weights.h5/file' - +trvlseed: 1 +nnseed: 2 +mcseed: 3 +genrep : True # true = generate MC replicas, false = use real data - tensorboard: - weight_freq: 100 - profiling: False +save: 'weights.h5' - genrep : True # true = generate MC replicas, false = use real data +tensorboard: + weight_freq: 100 + profiling: False - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 8] - activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'RMSprop' - learning_rate: 0.01 - clipnorm: 1.0 - epochs: 900 - positivity: - multiplier: 1.05 # When any of the multiplier and/or the initial is not set - initial: # the poslambda will be used instead to compute these values per dataset - threshold: 1e-5 - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 - interpolation_points: 40 - threshold_chi2: 5.0 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 8] + activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + optimizer: + optimizer_name: 'RMSprop' + learning_rate: 0.01 + clipnorm: 1.0 + epochs: 900 + positivity: + multiplier: 1.05 # When any of the multiplier and/or the initial is not set + initial: # the maxlambda will be used instead to compute these values per dataset + threshold: 1e-5 + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 + interpolation_points: 40 + threshold_chi2: 5.0 +fitting: # 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) @@ -79,25 +76,25 @@ fitting: # mutsize: mutation size # mutprob: mutation probability # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.05,1.19], largex: [1.47,2.70], trainable: False } - - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.94,1.25], largex: [0.11,5.87], trainable: False } - - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.54,0.75], largex: [1.15,2.76], trainable: False } - - { fl: v3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.21,0.57], largex: [1.35,3.08] } - - { fl: v8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.52,0.76], largex: [0.77,3.56], trainable: True } - - { fl: t3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.37,1.52], largex: [1.74,3.39] } - - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.56,1.29], largex: [1.45,3.03] } - - { fl: cp, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.12,1.19], largex: [1.83,6.70] } + - { fl: sng, pos: False, smallx: [1.05,1.19], largex: [1.47,2.70], trainable: False } + - { fl: g, pos: False, smallx: [0.94,1.25], largex: [0.11,5.87], trainable: False } + - { fl: v, pos: False, smallx: [0.54,0.75], largex: [1.15,2.76], trainable: False } + - { fl: v3, pos: False, smallx: [0.21,0.57], largex: [1.35,3.08] } + - { fl: v8, pos: False, smallx: [0.52,0.76], largex: [0.77,3.56], trainable: True } + - { fl: t3, pos: False, smallx: [-0.37,1.52], largex: [1.74,3.39] } + - { fl: t8, pos: False, smallx: [0.56,1.29], largex: [1.45,3.03] } + - { fl: cp, pos: False, smallx: [0.12,1.19], largex: [1.83,6.70] } ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - - { dataset: POSFLL, poslambda: 1e4 } + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier + - { dataset: POSFLL, maxlambda: 1e4 } ############################################################ integrability: integdatasets: - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: True diff --git a/n3fit/runcards/Basic_hyperopt.yml b/n3fit/runcards/Basic_hyperopt.yml index a138f50f3f..0d5ac8accc 100644 --- a/n3fit/runcards/Basic_hyperopt.yml +++ b/n3fit/runcards/Basic_hyperopt.yml @@ -105,29 +105,27 @@ hyperscan: - BCDMSP ############################################################ -fitting: - trvlseed: 1 - nnseed: 2 - mcseed: 3 - genrep: false # true = generate MC replicas, false = use real data - - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [35, 25, 8] - activation_per_layer: ['tanh', 'tanh', 'linear'] - initializer: 'glorot_normal' - optimizer: - learning_rate: 0.01 - optimizer_name: 'Adadelta' - epochs: 40000 - positivity: - multiplier: 1.09 - initial: 10.0 - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 - +trvlseed: 1 +nnseed: 2 +mcseed: 3 +genrep: false # true = generate MC replicas, false = use real data +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [35, 25, 8] + activation_per_layer: ['tanh', 'tanh', 'linear'] + initializer: 'glorot_normal' + optimizer: + learning_rate: 0.01 + optimizer_name: 'Adadelta' + epochs: 40000 + positivity: + multiplier: 1.09 + initial: 10.0 + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 +fitting: # 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) @@ -139,25 +137,25 @@ fitting: # mutsize: mutation size # mutprob: mutation probability # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [1.04,1.20], largex: [1.45,2.64] } - - { fl: g, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [0.82,1.31], largex: [0.20,6.17] } - - { fl: v, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [0.51,0.71], largex: [1.24,2.80] } - - { fl: v3, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [0.23,0.63], largex: [1.02,3.14] } - - { fl: v8, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [0.53,0.75], largex: [0.70,3.31] } - - { fl: t3, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [-0.45,1.41], largex: [1.78,3.21] } - - { fl: t8, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [0.49,1.32], largex: [1.42,3.13] } - - { fl: cp, pos: False, mutsize: [15], trainable: False, mutprob: [0.05], smallx: [-0.07,1.13], largex: [1.73,7.37] } + - { fl: sng, pos: False, trainable: False, smallx: [1.04,1.20], largex: [1.45,2.64] } + - { fl: g, pos: False, trainable: False, smallx: [0.82,1.31], largex: [0.20,6.17] } + - { fl: v, pos: False, trainable: False, smallx: [0.51,0.71], largex: [1.24,2.80] } + - { fl: v3, pos: False, trainable: False, smallx: [0.23,0.63], largex: [1.02,3.14] } + - { fl: v8, pos: False, trainable: False, smallx: [0.53,0.75], largex: [0.70,3.31] } + - { fl: t3, pos: False, trainable: False, smallx: [-0.45,1.41], largex: [1.78,3.21] } + - { fl: t8, pos: False, trainable: False, smallx: [0.49,1.32], largex: [1.42,3.13] } + - { fl: cp, pos: False, trainable: False, smallx: [-0.07,1.13], largex: [1.73,7.37] } ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} ############################################################ debug: false diff --git a/n3fit/runcards/Basic_runcard.yml b/n3fit/runcards/Basic_runcard.yml index 49cf383e52..2b349a78d8 100644 --- a/n3fit/runcards/Basic_runcard.yml +++ b/n3fit/runcards/Basic_runcard.yml @@ -33,38 +33,31 @@ datacuts: theory: theoryid: 200 # database id -############################################################ -fitting: - trvlseed: 1 - nnseed: 2 - mcseed: 3 - save: 'weights.h5' -# load: '/path/to/weights.h5/file' - - tensorboard: - weight_freq: 100 - profiling: False - - genrep : True # true = generate MC replicas, false = use real data +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 8] + activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + optimizer: + optimizer_name: 'RMSprop' + learning_rate: 0.01 + clipnorm: 1.0 + epochs: 900 + positivity: + multiplier: 1.05 # When any of the multiplier and/or the initial is not set + initial: # the maxlambda will be used instead to compute these values per dataset + threshold: 1e-5 + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 + threshold_chi2: 5.0 - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 8] - activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'RMSprop' - learning_rate: 0.01 - clipnorm: 1.0 - epochs: 900 - positivity: - multiplier: 1.05 # When any of the multiplier and/or the initial is not set - initial: # the poslambda will be used instead to compute these values per dataset - threshold: 1e-5 - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 - threshold_chi2: 5.0 +############################################################ +trvlseed: 1 +nnseed: 2 +mcseed: 3 +genrep: True # true = generate MC replicas, false = use real data +fitting: # 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) @@ -76,26 +69,33 @@ fitting: # mutsize: mutation size # mutprob: mutation probability # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.05,1.19], largex: [1.47,2.70], trainable: False } - - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.94,1.25], largex: [0.11,5.87], trainable: False } - - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.54,0.75], largex: [1.15,2.76], trainable: False } - - { fl: v3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.21,0.57], largex: [1.35,3.08] } - - { fl: v8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.52,0.76], largex: [0.77,3.56], trainable: True } - - { fl: t3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.37,1.52], largex: [1.74,3.39] } - - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.56,1.29], largex: [1.45,3.03] } - - { fl: cp, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.12,1.19], largex: [1.83,6.70] } + - { fl: sng, pos: False, smallx: [1.05,1.19], largex: [1.47,2.70], trainable: False } + - { fl: g, pos: False, smallx: [0.94,1.25], largex: [0.11,5.87], trainable: False } + - { fl: v, pos: False, smallx: [0.54,0.75], largex: [1.15,2.76], trainable: False } + - { fl: v3, pos: False, smallx: [0.21,0.57], largex: [1.35,3.08] } + - { fl: v8, pos: False, smallx: [0.52,0.76], largex: [0.77,3.56], trainable: True } + - { fl: t3, pos: False, smallx: [-0.37,1.52], largex: [1.74,3.39] } + - { fl: t8, pos: False, smallx: [0.56,1.29], largex: [1.45,3.03] } + - { fl: cp, pos: False, smallx: [0.12,1.19], largex: [1.83,6.70] } ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - - { dataset: POSFLL, poslambda: 1e4 } + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier + - { dataset: POSFLL, maxlambda: 1e4 } ############################################################ integrability: integdatasets: - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: True maxcores: 8 + +tensorboard: + weight_freq: 100 + profiling: False + +save: 'weights.h5' +# load: '/path/to/weights.h5/file' diff --git a/n3fit/runcards/Basic_runcard_parallel.yml b/n3fit/runcards/Basic_runcard_parallel.yml index 13ff0db81e..eff2ff114e 100644 --- a/n3fit/runcards/Basic_runcard_parallel.yml +++ b/n3fit/runcards/Basic_runcard_parallel.yml @@ -35,32 +35,31 @@ theory: theoryid: 162 # database id ############################################################ -fitting: - trvlseed: 1 - nnseed: 2 - mcseed: 3 - sum_rules: "All" - - genrep: False # true = generate MC replicas, false = use real data +trvlseed: 1 +nnseed: 2 +mcseed: 3 +genrep: False # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 8] - activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'RMSprop' - learning_rate: 0.01 - clipnorm: 1.0 - epochs: 900 - positivity: - multiplier: 1.05 # When any of the multiplier and/or the initial is not set - initial: # the poslambda will be used instead to compute these values per dataset - threshold: 1e-5 - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 - threshold_chi2: 5.0 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 8] + activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + optimizer: + optimizer_name: 'RMSprop' + learning_rate: 0.01 + clipnorm: 1.0 + epochs: 900 + positivity: + multiplier: 1.05 # When any of the multiplier and/or the initial is not set + initial: # the maxlambda will be used instead to compute these values per dataset + threshold: 1e-5 + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 + 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) @@ -72,20 +71,20 @@ fitting: # mutsize: mutation size # mutprob: mutation probability # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.05,1.19], largex: [1.47,2.70], trainable: False } - - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.94,1.25], largex: [0.11,5.87], trainable: False } - - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.54,0.75], largex: [1.15,2.76], trainable: False } - - { fl: v3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.21,0.57], largex: [1.35,3.08] } - - { fl: v8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.52,0.76], largex: [0.77,3.56], trainable: True } - - { fl: t3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.37,1.52], largex: [1.74,3.39] } - - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.56,1.29], largex: [1.45,3.03] } - - { fl: cp, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.12,1.19], largex: [1.83,6.70] } + - { fl: sng, pos: False, smallx: [1.05,1.19], largex: [1.47,2.70], trainable: False } + - { fl: g, pos: False, smallx: [0.94,1.25], largex: [0.11,5.87], trainable: False } + - { fl: v, pos: False, smallx: [0.54,0.75], largex: [1.15,2.76], trainable: False } + - { fl: v3, pos: False, smallx: [0.21,0.57], largex: [1.35,3.08] } + - { fl: v8, pos: False, smallx: [0.52,0.76], largex: [0.77,3.56], trainable: True } + - { fl: t3, pos: False, smallx: [-0.37,1.52], largex: [1.74,3.39] } + - { fl: t8, pos: False, smallx: [0.56,1.29], largex: [1.45,3.03] } + - { fl: cp, pos: False, smallx: [0.12,1.19], largex: [1.83,6.70] } ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - - { dataset: POSFLL, poslambda: 1e4 } + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier + - { dataset: POSFLL, maxlambda: 1e4 } ############################################################ debug: False diff --git a/n3fit/runcards/DIS_diagonal_l2reg_example.yml b/n3fit/runcards/DIS_diagonal_l2reg_example.yml index 2650cfef32..5a81be0ab4 100644 --- a/n3fit/runcards/DIS_diagonal_l2reg_example.yml +++ b/n3fit/runcards/DIS_diagonal_l2reg_example.yml @@ -37,7 +37,6 @@ dataset_inputs: - { dataset: H1HERAF2B, frac: 1.0} - { dataset: ZEUSHERAF2B, frac: 1.0} - ############################################################ datacuts: t0pdfset : NNPDF31_nnlo_as_0118 # PDF set to generate t0 covmat @@ -55,37 +54,36 @@ datacuts: ############################################################ theory: - theoryid: 53 # database id + theoryid: 162 # database id ############################################################ -fitting: +trvlseed: 1 +nnseed: 2 +mcseed: 3 +save: False +load: False - trvlseed: 1 - nnseed: 2 - mcseed: 3 - save: False - load: False +genrep : True # true = generate MC replicas, false = use real data +diagonal_basis: True - genrep : True # true = generate MC replicas, false = use real data - diagonal_basis: True - - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [35, 25, 8] - activation_per_layer: ['tanh', 'tanh', 'linear'] - initializer: 'glorot_normal' - optimizer: - learning_rate: 1.0 - optimizer_name: 'Adadelta' - epochs: 4000 - positivity: - multiplier: 1.09 - initial: 10.0 - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 - regularizer: l1_l2 - regularizer_args: {l1: 0.0, l2: 1.0} +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [35, 25, 8] + activation_per_layer: ['tanh', 'tanh', 'linear'] + initializer: 'glorot_normal' + optimizer: + learning_rate: 1.0 + optimizer_name: 'Adadelta' + epochs: 4000 + positivity: + multiplier: 1.09 + initial: 10.0 + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 + regularizer: l1_l2 + regularizer_args: {l1: 0.0, l2: 1.0} +fitting: # 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) @@ -97,25 +95,25 @@ fitting: # mutsize: mutation size # mutprob: mutation probability # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.04,1.20], largex: [1.45,2.64] } - - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.82,1.31], largex: [0.20,6.17] } - - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.51,0.71], largex: [1.24,2.80] } - - { fl: v3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.23,0.63], largex: [1.02,3.14] } - - { fl: v8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.53,0.75], largex: [0.70,3.31] } - - { fl: t3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.45,1.41], largex: [1.78,3.21] } - - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.49,1.32], largex: [1.42,3.13] } - - { fl: cp, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.07,1.13], largex: [1.73,7.37] } + - { fl: sng, pos: False, smallx: [1.04,1.20], largex: [1.45,2.64] } + - { fl: g, pos: False, smallx: [0.82,1.31], largex: [0.20,6.17] } + - { fl: v, pos: False, smallx: [0.51,0.71], largex: [1.24,2.80] } + - { fl: v3, pos: False, smallx: [0.23,0.63], largex: [1.02,3.14] } + - { fl: v8, pos: False, smallx: [0.53,0.75], largex: [0.70,3.31] } + - { fl: t3, pos: False, smallx: [-0.45,1.41], largex: [1.78,3.21] } + - { fl: t8, pos: False, smallx: [0.49,1.32], largex: [1.42,3.13] } + - { fl: cp, pos: False, smallx: [-0.07,1.13], largex: [1.73,7.37] } ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - - { dataset: POSF2DW, poslambda: 1e6 } - - { dataset: POSF2S, poslambda: 1e6 } - - { dataset: POSFLL, poslambda: 1e6 } - - { dataset: POSDYU, poslambda: 1e10 } - - { dataset: POSDYD, poslambda: 1e10 } - - { dataset: POSDYS, poslambda: 1e10 } + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier + - { dataset: POSF2DW, maxlambda: 1e6 } + - { dataset: POSF2S, maxlambda: 1e6 } + - { dataset: POSFLL, maxlambda: 1e6 } + - { dataset: POSDYU, maxlambda: 1e10 } + - { dataset: POSDYD, maxlambda: 1e10 } + - { dataset: POSDYS, maxlambda: 1e10 } ############################################################ debug: False diff --git a/n3fit/runcards/NNPDF40_lo_as_0118.yml b/n3fit/runcards/NNPDF40_lo_as_0118.yml index f7ca2e8d3d..827ae5430d 100644 --- a/n3fit/runcards/NNPDF40_lo_as_0118.yml +++ b/n3fit/runcards/NNPDF40_lo_as_0118.yml @@ -214,77 +214,76 @@ theory: theoryid: 213 # database id ############################################################ -fitting: - sum_rules: MSR - - trvlseed: 1520585894 - nnseed: 2647869818 - mcseed: 1101490705 - save: false - genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 8] - activation_per_layer: [tanh, tanh, square] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - # threshold_chi2: 3.5 +trvlseed: 1520585894 +nnseed: 2647869818 +mcseed: 1101490705 +save: false +genrep: true # true = generate MC replicas, false = use real data +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 8] + activation_per_layer: [tanh, tanh, square] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + # threshold_chi2: 3.5 +fitting: + sum_rules: MSR # 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: FLAVOUR # EVOL (7), EVOLQED (8), etc. basis: - - {fl: u, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [1.655, 4.386]} - - {fl: ubar, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [2.766, 11.61]} - - {fl: d, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [3.48, 6.71]} - - {fl: dbar, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [4.274, 13.33]} - - {fl: s, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [4.861, 9.974]} - - {fl: sbar, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [4.648, 12.43]} - - {fl: c, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [2.878, 7.57]} - - {fl: g, pos: false, mutsize: [15], trainable: false, mutprob: [0.05], smallx: [1,1], largex: [3.453, 13.24]} + - {fl: u, trainable: false, smallx: [1,1], largex: [1.655, 4.386]} + - {fl: ubar, trainable: false, smallx: [1,1], largex: [2.766, 11.61]} + - {fl: d, trainable: false, smallx: [1,1], largex: [3.48, 6.71]} + - {fl: dbar, trainable: false, smallx: [1,1], largex: [4.274, 13.33]} + - {fl: s, trainable: false, smallx: [1,1], largex: [4.861, 9.974]} + - {fl: sbar, trainable: false, smallx: [1,1], largex: [4.648, 12.43]} + - {fl: c, trainable: false, smallx: [1,1], largex: [2.878, 7.57]} + - {fl: g, trainable: false, smallx: [1,1], largex: [3.453, 13.24]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} -# - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} -# - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} +# - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} +# - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3_543, poslambda: 1e2} - - {dataset: INTEGXV_543, poslambda: 1e2} - - {dataset: INTEGXV3_543, poslambda: 1e2} - - {dataset: INTEGXV8_543, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3_543, maxlambda: 1e2} + - {dataset: INTEGXV_543, maxlambda: 1e2} + - {dataset: INTEGXV3_543, maxlambda: 1e2} + - {dataset: INTEGXV8_543, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/NNPDF40_lo_as_0118_pch.yml b/n3fit/runcards/NNPDF40_lo_as_0118_pch.yml index 2627f56d20..c4ec1761fc 100644 --- a/n3fit/runcards/NNPDF40_lo_as_0118_pch.yml +++ b/n3fit/runcards/NNPDF40_lo_as_0118_pch.yml @@ -181,7 +181,6 @@ NNLODatasets: &NNLODatasets - {dataset: LHCB_Z_13TEV_DIELECTRON, frac: 0.75, cfac: [QCD]} - do_not_require_similarity_for: - ATLAS_WCHARM_WP_DIFF_7TEV - ATLAS_WCHARM_WM_DIFF_7TEV @@ -202,7 +201,6 @@ cuts_intersection_spec: dataset_inputs: *NNLODatasets - ############################################################ datacuts: t0pdfset: 210504-03-rs-nnpdf40-lo-pch # PDF set to generate t0 covmat @@ -215,79 +213,68 @@ theory: theoryid: 214 # database id ############################################################ -fitting: - trvlseed: 568256760 - nnseed: 3756954509 - mcseed: 1316499424 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 568256760 +nnseed: 3756954509 +mcseed: 1316499424 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 7] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 -# threshold_chi2: 3.5 - - # 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) +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 7] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 +# threshold_chi2: 3.5 +fitting: fitbasis: NN31PC # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.114, 1.203], largex: [1.338, 3.519]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.117, 1.217], largex: [2.239, 8.1]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.4308, 0.9017], largex: [1.413, 3.818]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.06275, 0.7698], largex: [1.45, 3.74]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.509, 0.8937], largex: [1.412, 3.757]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.7526, 1.414], largex: [1.403, 3.569]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5591, 1.246], largex: [1.374, 3.431]} + - {fl: sng, trainable: false, smallx: [1.114, 1.203], largex: [1.338, 3.519]} + - {fl: g, trainable: false, smallx: [1.117, 1.217], largex: [2.239, 8.1]} + - {fl: v, trainable: false, smallx: [0.4308, 0.9017], largex: [1.413, 3.818]} + - {fl: v3, trainable: false, smallx: [0.06275, 0.7698], largex: [1.45, 3.74]} + - {fl: v8, trainable: false, smallx: [0.509, 0.8937], largex: [1.412, 3.757]} + - {fl: t3, trainable: false, smallx: [-0.7526, 1.414], largex: [1.403, 3.569]} + - {fl: t8, trainable: false, smallx: [0.5591, 1.246], largex: [1.374, 3.431]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} -# - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} -# - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} +# - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} +# - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false -maxcores: 4 \ No newline at end of file +maxcores: 4 diff --git a/n3fit/runcards/NNPDF40_nlo_as_0117.yml b/n3fit/runcards/NNPDF40_nlo_as_0117.yml index 6c715e391d..cf0184bc36 100644 --- a/n3fit/runcards/NNPDF40_nlo_as_0117.yml +++ b/n3fit/runcards/NNPDF40_nlo_as_0117.yml @@ -215,79 +215,71 @@ theory: theoryid: 209 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 8] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 8] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 +fitting: # 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: EVOL # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.093, 1.121], largex: [1.486, 3.287]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.8329, 1.071], largex: [3.084, 6.767]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5202, 0.7431], largex: [1.556, 3.639]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.1205, 0.4839], largex: [1.736, 3.622]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5864, 0.7987], largex: [1.559, 3.569]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.5019, 1.126], largex: [1.754, 3.479]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.6305, 0.8806], largex: [1.544, 3.481]} - - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.087, 1.139], largex: [1.48, 3.365]} + - {fl: sng, trainable: false, smallx: [1.093, 1.121], largex: [1.486, 3.287]} + - {fl: g, trainable: false, smallx: [0.8329, 1.071], largex: [3.084, 6.767]} + - {fl: v, trainable: false, smallx: [0.5202, 0.7431], largex: [1.556, 3.639]} + - {fl: v3, trainable: false, smallx: [0.1205, 0.4839], largex: [1.736, 3.622]} + - {fl: v8, trainable: false, smallx: [0.5864, 0.7987], largex: [1.559, 3.569]} + - {fl: t3, trainable: false, smallx: [-0.5019, 1.126], largex: [1.754, 3.479]} + - {fl: t8, trainable: false, smallx: [0.6305, 0.8806], largex: [1.544, 3.481]} + - {fl: t15, trainable: false, smallx: [1.087, 1.139], largex: [1.48, 3.365]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} - - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} + - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/NNPDF40_nlo_as_0118.yml b/n3fit/runcards/NNPDF40_nlo_as_0118.yml index 76e8778b2e..c9395c34ee 100644 --- a/n3fit/runcards/NNPDF40_nlo_as_0118.yml +++ b/n3fit/runcards/NNPDF40_nlo_as_0118.yml @@ -214,79 +214,68 @@ theory: theoryid: 208 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 8] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 8] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 - # 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) +fitting: fitbasis: EVOL # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.093, 1.121], largex: [1.486, 3.287]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.8329, 1.071], largex: [3.084, 6.767]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5202, 0.7431], largex: [1.556, 3.639]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.1205, 0.4839], largex: [1.736, 3.622]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5864, 0.7987], largex: [1.559, 3.569]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.5019, 1.126], largex: [1.754, 3.479]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.6305, 0.8806], largex: [1.544, 3.481]} - - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.087, 1.139], largex: [1.48, 3.365]} + - {fl: sng, trainable: false, smallx: [1.093, 1.121], largex: [1.486, 3.287]} + - {fl: g, trainable: false, smallx: [0.8329, 1.071], largex: [3.084, 6.767]} + - {fl: v, trainable: false, smallx: [0.5202, 0.7431], largex: [1.556, 3.639]} + - {fl: v3, trainable: false, smallx: [0.1205, 0.4839], largex: [1.736, 3.622]} + - {fl: v8, trainable: false, smallx: [0.5864, 0.7987], largex: [1.559, 3.569]} + - {fl: t3, trainable: false, smallx: [-0.5019, 1.126], largex: [1.754, 3.479]} + - {fl: t8, trainable: false, smallx: [0.6305, 0.8806], largex: [1.544, 3.481]} + - {fl: t15, trainable: false, smallx: [1.087, 1.139], largex: [1.48, 3.365]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} - - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} + - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/NNPDF40_nlo_as_0118_pch.yml b/n3fit/runcards/NNPDF40_nlo_as_0118_pch.yml index ed600cc44e..f776f2f96d 100644 --- a/n3fit/runcards/NNPDF40_nlo_as_0118_pch.yml +++ b/n3fit/runcards/NNPDF40_nlo_as_0118_pch.yml @@ -29,7 +29,7 @@ NLODatasets: &NLODatasets - {dataset: HERACOMBCCEP, frac: 0.75} - {dataset: HERACOMB_SIGMARED_C, frac: 0.75} - {dataset: HERACOMB_SIGMARED_B, frac: 0.75} -- {dataset: DYE886R_dw_ite, frac: 0.75, cfac: [QCD]} +- {dataset: DYE886R_dw_ite, frac: 0.75, cfac: []} - {dataset: DYE886P, frac: 0.75, cfac: []} - {dataset: DYE605_dw_ite, frac: 0.75, cfac: []} - {dataset: CDFZRAP_NEW, frac: 0.75, cfac: []} @@ -116,7 +116,7 @@ NNLODatasets: &NNLODatasets - {dataset: HERACOMBCCEP, frac: 0.75} - {dataset: HERACOMB_SIGMARED_C, frac: 0.75} - {dataset: HERACOMB_SIGMARED_B, frac: 0.75} -- {dataset: DYE886R_dw_ite, frac: 0.75} +- {dataset: DYE886R_dw_ite, frac: 0.75, cfac: [QCD]} - {dataset: DYE886P, frac: 0.75, cfac: [QCD]} - {dataset: DYE605_dw_ite, frac: 0.75, cfac: [QCD]} - {dataset: CDFZRAP_NEW, frac: 0.75, cfac: [QCD]} @@ -213,71 +213,71 @@ theory: theoryid: 212 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 7] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 7] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 +fitting: # 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: NN31PC # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [1.093, 1.122], largex: [1.482, 3.418]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.8072, 1.064], largex: [3.09, 7.07]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.5307, 0.7518], largex: [1.565, 3.659]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.07457, 0.5159], largex: [1.725, 3.527]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.5854, 0.8039], largex: [1.556, 3.565]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [-0.5149, 1.121], largex: [1.734, 3.495]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.6185, 0.8848], largex: [1.535, 3.599]} + - {fl: sng, trainable: false, smallx: [1.093, 1.122], largex: [1.482, 3.418]} + - {fl: g, trainable: false, smallx: [0.8072, 1.064], largex: [3.09, 7.07]} + - {fl: v, trainable: false, smallx: [0.5307, 0.7518], largex: [1.565, 3.659]} + - {fl: v3, trainable: false, smallx: [0.07457, 0.5159], largex: [1.725, 3.527]} + - {fl: v8, trainable: false, smallx: [0.5854, 0.8039], largex: [1.556, 3.565]} + - {fl: t3, trainable: false, smallx: [-0.5149, 1.121], largex: [1.734, 3.495]} + - {fl: t8, trainable: false, smallx: [0.6185, 0.8848], largex: [1.535, 3.599]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} -# - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} +# - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/NNPDF40_nlo_as_0119.yml b/n3fit/runcards/NNPDF40_nlo_as_0119.yml index 13dc0c3786..543b60e367 100644 --- a/n3fit/runcards/NNPDF40_nlo_as_0119.yml +++ b/n3fit/runcards/NNPDF40_nlo_as_0119.yml @@ -215,79 +215,71 @@ theory: theoryid: 210 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 8] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 8] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 +fitting: # 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: EVOL # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.093, 1.121], largex: [1.486, 3.287]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.8329, 1.071], largex: [3.084, 6.767]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5202, 0.7431], largex: [1.556, 3.639]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.1205, 0.4839], largex: [1.736, 3.622]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5864, 0.7987], largex: [1.559, 3.569]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.5019, 1.126], largex: [1.754, 3.479]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.6305, 0.8806], largex: [1.544, 3.481]} - - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.087, 1.139], largex: [1.48, 3.365]} + - {fl: sng, trainable: false, smallx: [1.093, 1.121], largex: [1.486, 3.287]} + - {fl: g, trainable: false, smallx: [0.8329, 1.071], largex: [3.084, 6.767]} + - {fl: v, trainable: false, smallx: [0.5202, 0.7431], largex: [1.556, 3.639]} + - {fl: v3, trainable: false, smallx: [0.1205, 0.4839], largex: [1.736, 3.622]} + - {fl: v8, trainable: false, smallx: [0.5864, 0.7987], largex: [1.559, 3.569]} + - {fl: t3, trainable: false, smallx: [-0.5019, 1.126], largex: [1.754, 3.479]} + - {fl: t8, trainable: false, smallx: [0.6305, 0.8806], largex: [1.544, 3.481]} + - {fl: t15, trainable: false, smallx: [1.087, 1.139], largex: [1.48, 3.365]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} - - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} + - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/NNPDF40_nnlo_as_0117.yml b/n3fit/runcards/NNPDF40_nnlo_as_0117.yml index e768bee2a5..ad0e40196e 100644 --- a/n3fit/runcards/NNPDF40_nnlo_as_0117.yml +++ b/n3fit/runcards/NNPDF40_nnlo_as_0117.yml @@ -98,79 +98,71 @@ theory: theoryid: 202 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 8] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 8] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 +fitting: # 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: EVOL # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.095, 1.121], largex: [1.519, 3.207]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.8119, 1.106], largex: [2.877, 6.781]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5361, 0.7263], largex: [1.592, 3.459]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.1419, 0.4964], largex: [1.737, 3.623]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5851, 0.7927], largex: [1.589, 3.651]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.543, 1.13], largex: [1.778, 3.554]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.6476, 0.8731], largex: [1.572, 3.586]} - - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.084, 1.141], largex: [1.524, 3.424]} + - {fl: sng, trainable: false, smallx: [1.095, 1.121], largex: [1.519, 3.207]} + - {fl: g, trainable: false, smallx: [0.8119, 1.106], largex: [2.877, 6.781]} + - {fl: v, trainable: false, smallx: [0.5361, 0.7263], largex: [1.592, 3.459]} + - {fl: v3, trainable: false, smallx: [0.1419, 0.4964], largex: [1.737, 3.623]} + - {fl: v8, trainable: false, smallx: [0.5851, 0.7927], largex: [1.589, 3.651]} + - {fl: t3, trainable: false, smallx: [-0.543, 1.13], largex: [1.778, 3.554]} + - {fl: t8, trainable: false, smallx: [0.6476, 0.8731], largex: [1.572, 3.586]} + - {fl: t15, trainable: false, smallx: [1.084, 1.141], largex: [1.524, 3.424]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} - - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} + - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/NNPDF40_nnlo_as_0118.yml b/n3fit/runcards/NNPDF40_nnlo_as_0118.yml index 9cc8d6e971..36bfe4aab4 100644 --- a/n3fit/runcards/NNPDF40_nnlo_as_0118.yml +++ b/n3fit/runcards/NNPDF40_nnlo_as_0118.yml @@ -98,79 +98,68 @@ theory: theoryid: 200 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 8] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 8] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 - # 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) +fitting: fitbasis: EVOL # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.093, 1.121], largex: [1.486, 3.287]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.8329, 1.071], largex: [3.084, 6.767]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5202, 0.7431], largex: [1.556, 3.639]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.1205, 0.4839], largex: [1.736, 3.622]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5864, 0.7987], largex: [1.559, 3.569]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.5019, 1.126], largex: [1.754, 3.479]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.6305, 0.8806], largex: [1.544, 3.481]} - - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.087, 1.139], largex: [1.48, 3.365]} + - {fl: sng, trainable: false, smallx: [1.093, 1.121], largex: [1.486, 3.287]} + - {fl: g, trainable: false, smallx: [0.8329, 1.071], largex: [3.084, 6.767]} + - {fl: v, trainable: false, smallx: [0.5202, 0.7431], largex: [1.556, 3.639]} + - {fl: v3, trainable: false, smallx: [0.1205, 0.4839], largex: [1.736, 3.622]} + - {fl: v8, trainable: false, smallx: [0.5864, 0.7987], largex: [1.559, 3.569]} + - {fl: t3, trainable: false, smallx: [-0.5019, 1.126], largex: [1.754, 3.479]} + - {fl: t8, trainable: false, smallx: [0.6305, 0.8806], largex: [1.544, 3.481]} + - {fl: t15, trainable: false, smallx: [1.087, 1.139], largex: [1.48, 3.365]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} - - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} + - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/NNPDF40_nnlo_as_0118_pch.yml b/n3fit/runcards/NNPDF40_nnlo_as_0118_pch.yml index 285dc588b7..1f49d30741 100644 --- a/n3fit/runcards/NNPDF40_nnlo_as_0118_pch.yml +++ b/n3fit/runcards/NNPDF40_nnlo_as_0118_pch.yml @@ -97,46 +97,46 @@ theory: theoryid: 211 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 7] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 7] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 +fitting: # N23(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: NN31PC # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [1.093, 1.122], largex: [1.482, 3.418]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.8072, 1.064], largex: [3.09, 7.07]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.5307, 0.7518], largex: [1.565, 3.659]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.07457, 0.5159], largex: [1.725, 3.527]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.5854, 0.8039], largex: [1.556, 3.565]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [-0.5149, 1.121], largex: [1.734, 3.495]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.6185, 0.8848], largex: [1.535, 3.599]} + - {fl: sng, trainable: false, smallx: [1.093, 1.122], largex: [1.482, 3.418]} + - {fl: g, trainable: false, smallx: [0.8072, 1.064], largex: [3.09, 7.07]} + - {fl: v, trainable: false, smallx: [0.5307, 0.7518], largex: [1.565, 3.659]} + - {fl: v3, trainable: false, smallx: [0.07457, 0.5159], largex: [1.725, 3.527]} + - {fl: v8, trainable: false, smallx: [0.5854, 0.8039], largex: [1.556, 3.565]} + - {fl: t3, trainable: false, smallx: [-0.5149, 1.121], largex: [1.734, 3.495]} + - {fl: t8, trainable: false, smallx: [0.6185, 0.8848], largex: [1.535, 3.599]} ############################################################ stopping: @@ -155,26 +155,26 @@ stopping: ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} -# - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} +# - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} closuretest: filterseed: 621616460 # Random seed to be used in filtering data partitions diff --git a/n3fit/runcards/NNPDF40_nnlo_as_0119.yml b/n3fit/runcards/NNPDF40_nnlo_as_0119.yml index ac118336f4..088c4fc0be 100644 --- a/n3fit/runcards/NNPDF40_nnlo_as_0119.yml +++ b/n3fit/runcards/NNPDF40_nnlo_as_0119.yml @@ -98,79 +98,68 @@ theory: theoryid: 205 # database id ############################################################ -fitting: - trvlseed: 475038818 - nnseed: 2394641471 - mcseed: 1831662593 - save: false - genrep: true # true = generate MC replicas, false = use real data +trvlseed: 475038818 +nnseed: 2394641471 +mcseed: 1831662593 +save: false +genrep: true # true = generate MC replicas, false = use real data - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [25, 20, 8] - activation_per_layer: [tanh, tanh, linear] - initializer: glorot_normal - optimizer: - clipnorm: 6.073e-6 - learning_rate: 2.621e-3 - optimizer_name: Nadam - epochs: 17000 - positivity: - initial: 184.8 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.1 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [25, 20, 8] + activation_per_layer: [tanh, tanh, linear] + initializer: glorot_normal + optimizer: + clipnorm: 6.073e-6 + learning_rate: 2.621e-3 + optimizer_name: Nadam + epochs: 17000 + positivity: + initial: 184.8 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.1 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 - # 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) +fitting: fitbasis: EVOL # EVOL (7), EVOLQED (8), etc. basis: - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.092, 1.12], largex: [1.457, 3.157]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.7824, 1.071], largex: [3.034, 6.419]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5091, 0.7372], largex: [1.526, 3.366]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.1274, 0.4667], largex: [1.696, 3.461]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5825, 0.7851], largex: [1.518, 3.47]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.7245, 1.185], largex: [1.733, 3.273]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5886, 0.8746], largex: [1.512, 3.499]} - - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.084, 1.139], largex: [1.458, 3.192]} + - {fl: sng, trainable: false, smallx: [1.092, 1.12], largex: [1.457, 3.157]} + - {fl: g, trainable: false, smallx: [0.7824, 1.071], largex: [3.034, 6.419]} + - {fl: v, trainable: false, smallx: [0.5091, 0.7372], largex: [1.526, 3.366]} + - {fl: v3, trainable: false, smallx: [0.1274, 0.4667], largex: [1.696, 3.461]} + - {fl: v8, trainable: false, smallx: [0.5825, 0.7851], largex: [1.518, 3.47]} + - {fl: t3, trainable: false, smallx: [-0.7245, 1.185], largex: [1.733, 3.273]} + - {fl: t8, trainable: false, smallx: [0.5886, 0.8746], largex: [1.512, 3.499]} + - {fl: t15, trainable: false, smallx: [1.084, 1.139], largex: [1.458, 3.192]} ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} - - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} + - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: false diff --git a/n3fit/runcards/developing.yml b/n3fit/runcards/developing.yml index 24431e5ec3..9fe4eeec18 100644 --- a/n3fit/runcards/developing.yml +++ b/n3fit/runcards/developing.yml @@ -63,79 +63,60 @@ theory: theoryid: 200 # database id ############################################################ -fitting: - - trvlseed: 1 - nnseed: 2 - mcseed: 3 - load: 'developing_weights.h5' +trvlseed: 1 +nnseed: 2 +mcseed: 3 +load: 'developing_weights.h5' +genrep: true # true = generate MC replicas, false = use real data - genrep : true # true = generate MC replicas, false = use real data - - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [50, 35, 25, 8] - activation_per_layer: ['tanh', 'sigmoid', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'Adadelta' - learning_rate: 1.0 - clipnorm: 0.1 - epochs: 2000 - ntegrability: +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [50, 35, 25, 8] + activation_per_layer: ['tanh', 'sigmoid', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + optimizer: + optimizer_name: 'Adadelta' + learning_rate: 1.0 + clipnorm: 0.1 + epochs: 2000 + ntegrability: + initial: + multiplier: 1.03 + positivity: initial: - multiplier: 1.03 - positivity: - initial: - multiplier: 1.10 - stopping_patience: 0.1 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.001 + multiplier: 1.10 + stopping_patience: 0.1 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.001 - # 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) +fitting: fitbasis: EVOL # EVOL (7), EVOLQED (8), etc. basis: - # remeber to change the name of PDF accordingly with fitbasis - # pos: True for NN squared - # mutsize: mutation size - # mutprob: mutation probability - # smallx, largex: preprocessing ranges - - {fl: sng, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.093, 1.121], largex: [1.486, 3.287]} - - {fl: g, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.8329, 1.071], largex: [3.084, 6.767]} - - {fl: v, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5202, 0.7431], largex: [1.556, 3.639]} - - {fl: v3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.1205, 0.4839], largex: [1.736, 3.622]} - - {fl: v8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.5864, 0.7987], largex: [1.559, 3.569]} - - {fl: t3, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - -0.5019, 1.126], largex: [1.754, 3.479]} - - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 0.6305, 0.8806], largex: [1.544, 3.481]} - - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [ - 1.087, 1.139], largex: [1.48, 3.365]} + - {fl: sng, trainable: false, smallx: [1.093, 1.121], largex: [1.486, 3.287]} + - {fl: g, trainable: false, smallx: [0.8329, 1.071], largex: [3.084, 6.767]} + - {fl: v, trainable: false, smallx: [0.5202, 0.7431], largex: [1.556, 3.639]} + - {fl: v3, trainable: false, smallx: [0.1205, 0.4839], largex: [1.736, 3.622]} + - {fl: v8, trainable: false, smallx: [0.5864, 0.7987], largex: [1.559, 3.569]} + - {fl: t3, trainable: false, smallx: [-0.5019, 1.126], largex: [1.754, 3.479]} + - {fl: t8, trainable: false, smallx: [0.6305, 0.8806], largex: [1.544, 3.481]} + - {fl: t15, trainable: false, smallx: [1.087, 1.139], largex: [1.48, 3.365]} ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - - { dataset: POSF2DW, poslambda: 1e6 } - - { dataset: POSDYU, poslambda: 1e10 } - - { dataset: POSDYD, poslambda: 1e10 } - - { dataset: POSDYS, poslambda: 1e10 } - - { dataset: POSXDB, poslambda: 1e6} - - { dataset: POSXSQ, poslambda: 1e6} - - { dataset: POSXSB, poslambda: 1e6} - - { dataset: POSXGL, poslambda: 1e6} + - { dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - { dataset: POSDYU, maxlambda: 1e10} + - { dataset: POSDYD, maxlambda: 1e10} + - { dataset: POSDYS, maxlambda: 1e10} + - { dataset: POSXDB, maxlambda: 1e6} + - { dataset: POSXSQ, maxlambda: 1e6} + - { dataset: POSXSB, maxlambda: 1e6} + - { dataset: POSXGL, maxlambda: 1e6} integrability: integdatasets: - - { dataset: INTEGXT8, poslambda: 1e2 } - - { dataset: INTEGXT3, poslambda: 1e2 } + - { dataset: INTEGXT8, maxlambda: 1e2} + - { dataset: INTEGXT3, maxlambda: 1e2} ############################################################ debug: True diff --git a/n3fit/src/n3fit/checks.py b/n3fit/src/n3fit/checks.py index 0a48fe0a76..55f349d0dc 100644 --- a/n3fit/src/n3fit/checks.py +++ b/n3fit/src/n3fit/checks.py @@ -29,7 +29,7 @@ def _is_floatable(num): # Checks on the NN parameters def check_existing_parameters(parameters): - """ Check that non-optional parameters are defined and are not empty """ + """Check that non-optional parameters are defined and are not empty""" for param_name in NN_PARAMETERS: if param_name in parameters: val = parameters[param_name] @@ -41,13 +41,14 @@ def check_existing_parameters(parameters): if "pos_initial" in parameters or "pos_multiplier" in parameters: raise CheckError( "The definition of the positivity parameters is deprecated, please " - "use instead: fitting:parameters:positivity: {multiplier: x, initial: y} " - "as can be seen in the example runcard n3fit/runcards/Basic_runcard.yml" + "use instead:\nparameters:\n positivity\n" + " multiplier: x\n initial: y\n" + "as can be seen in the example runcard: n3fit/runcards/Basic_runcard.yml" ) def check_consistent_layers(parameters): - """ Checks that all layers have an activation function defined """ + """Checks that all layers have an activation function defined""" npl = len(parameters["nodes_per_layer"]) apl = len(parameters["activation_per_layer"]) if npl != apl: @@ -68,7 +69,7 @@ def check_stopping(parameters): def check_basis_with_layers(basis, parameters): - """ Check that the last layer matches the number of flavours defined in the runcard""" + """Check that the last layer matches the number of flavours defined in the runcard""" number_of_flavours = len(basis) last_layer = parameters["nodes_per_layer"][-1] if number_of_flavours != last_layer: @@ -79,7 +80,7 @@ def check_basis_with_layers(basis, parameters): def check_optimizer(optimizer_dict): - """ Checks whether the optimizer setup is valid """ + """Checks whether the optimizer setup is valid""" name_key = "optimizer_name" name = optimizer_dict[name_key] from n3fit.backends import MetaModel @@ -96,7 +97,7 @@ def check_optimizer(optimizer_dict): def check_initializer(initializer): - """ Checks whether the initializer is implemented """ + """Checks whether the initializer is implemented""" from n3fit.backends import MetaLayer accepted_init = MetaLayer.initializers @@ -105,14 +106,14 @@ def check_initializer(initializer): def check_dropout(parameters): - """ Checks the dropout setup (positive and smaller than 1.0) """ + """Checks the dropout setup (positive and smaller than 1.0)""" dropout = parameters.get("dropout") if dropout is not None and not 0.0 <= dropout <= 1.0: raise CheckError(f"Dropout must be between 0 and 1, got: {dropout}") def check_tensorboard(tensorboard): - """ Check that the tensorbard callback can be enabled correctly """ + """Check that the tensorbard callback can be enabled correctly""" if tensorboard is not None: weight_freq = tensorboard.get("weight_freq", 0) if weight_freq < 0: @@ -138,7 +139,7 @@ def check_lagrange_multipliers(parameters, key): def check_model_file(save, load): - """ Checks whether the model_files given in the runcard are acceptable """ + """Checks whether the model_files given in the runcard are acceptable""" if save: if not isinstance(save, str): raise CheckError(f"Model file to save to: {save} not understood") @@ -154,9 +155,10 @@ def check_model_file(save, load): if os.stat(load).st_size == 0: raise CheckError(f"Model file {load} seems to be empty") + @make_argcheck def wrapper_check_NN(basis, tensorboard, save, load, parameters): - """ Wrapper function for all NN-related checks """ + """Wrapper function for all NN-related checks""" check_tensorboard(tensorboard) check_model_file(save, load) check_existing_parameters(parameters) @@ -222,7 +224,7 @@ def check_hyperopt_positivity(positivity_dict): def check_kfold_options(kfold): - """ Warns the user about potential bugs on the kfold setup""" + """Warns the user about potential bugs on the kfold setup""" threshold = kfold.get("threshold") if threshold is not None and threshold < 2.0: log.warning("The kfolding loss threshold might be too low: %f", threshold) @@ -254,7 +256,7 @@ def check_correct_partitions(kfold, data): def check_hyperopt_stopping(stopping_dict): - """ Checks that the options selected for the stopping are consistent """ + """Checks that the options selected for the stopping are consistent""" if stopping_dict is None: return min_ep = stopping_dict.get("min_epochs") @@ -305,8 +307,7 @@ def wrapper_hyperopt(hyperopt, hyperscan, genrep, data): def check_sumrules(sum_rules): - """Checks that the chosen option for the sum rules are sensible - """ + """Checks that the chosen option for the sum rules are sensible""" if isinstance(sum_rules, bool): return accepted_options = ["ALL", "MSR", "VSR"] @@ -350,12 +351,14 @@ def check_consistent_basis(sum_rules, fitbasis, basis, theoryid): @make_argcheck def can_run_multiple_replicas(replicas, genrep, parameters, hyperopt, parallel_models): - """ Checks whether a runcard which is trying to run several replicas at once + """Checks whether a runcard which is trying to run several replicas at once (parallel_models =/= 1) is valid """ rp = len(replicas) if rp > 1 and not genrep: - raise CheckError("Can't run more than one replica at once if no replicas are to be generated") + raise CheckError( + "Can't run more than one replica at once if no replicas are to be generated" + ) if parallel_models == 1: return if hyperopt: @@ -366,3 +369,20 @@ def can_run_multiple_replicas(replicas, genrep, parameters, hyperopt, parallel_m raise CheckError("Parallelization has only been tested with layer_type=='dense'") if rp > 1: raise CheckError("Parallel mode cannot be used together with multireplica runs") + + +@make_argcheck +def check_deprecated_options(fitting): + """Checks whether the runcard is using deprecated options""" + options_outside = ["trvlseed", "nnseed", "mcseed", "save", "load", "genrep", "parameters"] + for option in options_outside: + if option in fitting: + raise CheckError( + f"The key '{option}' should be top-level key and not part of the 'fitting' namespace" + ) + if "epochs" in fitting: + raise CheckError("The key 'epoch' should only appear as part of the 'parameters' namespace") + nnfit_options = ["seed", "rnalgo", "fitmethod", "nmutants", "paramtype", "nnodes"] + for option in nnfit_options: + if option in fitting: + log.warning("'fitting::%s' is an nnfit-only key, it will be ignored", option) diff --git a/n3fit/src/n3fit/performfit.py b/n3fit/src/n3fit/performfit.py index 40da892896..74837e02a5 100644 --- a/n3fit/src/n3fit/performfit.py +++ b/n3fit/src/n3fit/performfit.py @@ -18,6 +18,7 @@ @n3fit.checks.check_consistent_basis @n3fit.checks.wrapper_check_NN @n3fit.checks.wrapper_hyperopt +@n3fit.checks.check_deprecated_options def performfit( *, replicas, # used for checks diff --git a/n3fit/src/n3fit/tests/regressions/hyper-quickcard.yml b/n3fit/src/n3fit/tests/regressions/hyper-quickcard.yml index 04d812cb58..06d1035c0c 100644 --- a/n3fit/src/n3fit/tests/regressions/hyper-quickcard.yml +++ b/n3fit/src/n3fit/tests/regressions/hyper-quickcard.yml @@ -77,38 +77,29 @@ hyperscan: - CMSZDIFF12 ############################################################ -fitting: - genrep: False # on = generate MC replicas, False = use real data - trvlseed: 3 - nnseed: 2 - mcseed: 1 +genrep: False # on = generate MC replicas, False = use real data +trvlseed: 3 +nnseed: 2 +mcseed: 1 - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 8] - activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'RMSprop' - learning_rate: 0.00001 - epochs: 10 - positivity: - multiplier: 1.05 - initial: 1.5 - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 8] + activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + optimizer: + optimizer_name: 'RMSprop' + learning_rate: 0.00001 + epochs: 10 + positivity: + multiplier: 1.05 + initial: 1.5 + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 - # 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) +fitting: fitbasis: NN31IC # EVOL (7), EVOLQED (8), etc. basis: - # remeber to change the name of PDF accordingly with fitbasis - # pos: True for NN squared - # mutsize: mutation size - # mutprob: mutation probability - # smallx, largex: preprocessing ranges - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.05,1.19], largex: [1.47,2.70] } - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.94,1.25], largex: [0.11,5.87] } - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.54,0.75], largex: [1.15,2.76] } @@ -118,34 +109,11 @@ fitting: - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.56,1.29], largex: [1.45,3.03] } - { fl: cp, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.12,1.19], largex: [1.83,6.70] } -############################################################ -stopping: - stopmethod: LOOKBACK # Stopping method - lbdelta : 0 # Delta for look-back stopping - mingen : 0 # Minimum number of generations - window : 500 # Window for moving average - minchi2 : 3.5 # Minimum chi2 - minchi2exp: 6.0 # Minimum chi2 for experiments - nsmear : 200 # Smear for stopping - deltasm : 200 # Delta smear for stopping - rv : 2 # Ratio for validation stopping - rt : 0.5 # Ratio for training stopping - epsilon : 1e-6 # Gradient epsilon - ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - - { dataset: POSDYC , poslambda: 1e5 } - -############################################################ -lhagrid: - nx : 150 - xmin: 1e-9 - xmed: 0.1 - xmax: 1.0 - nq : 50 - qmax: 1e5 + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier + - { dataset: POSDYC , maxlambda: 1e5 } ############################################################ closuretest: diff --git a/n3fit/src/n3fit/tests/regressions/noval-quickcard.yml b/n3fit/src/n3fit/tests/regressions/noval-quickcard.yml index 52d9ed6f85..155350c942 100644 --- a/n3fit/src/n3fit/tests/regressions/noval-quickcard.yml +++ b/n3fit/src/n3fit/tests/regressions/noval-quickcard.yml @@ -34,73 +34,41 @@ theory: theoryid: 162 # database id ############################################################ -fitting: - genrep: True # on = generate MC replicas, False = use real data - trvlseed: 3 - nnseed: 2 - mcseed: 1 +genrep: True # on = generate MC replicas, False = use real data +trvlseed: 3 +nnseed: 2 +mcseed: 1 - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 8] - activation_per_layer: ['tanh', 'sigmoid', 'linear'] - initializer: 'glorot_uniform' - optimizer: - optimizer_name: 'Adadelta' - learning_rate: 0.00001 - clipnorm: 1.0 - epochs: 20000 - stopping_patience: 1.00 # percentage of the number of epochs - layer_type: 'dense_per_flavour' - dropout: 0.0 - threshold_chi2: 50.0 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 8] + activation_per_layer: ['tanh', 'sigmoid', 'linear'] + initializer: 'glorot_uniform' + optimizer: + optimizer_name: 'Adadelta' + learning_rate: 0.00001 + clipnorm: 1.0 + epochs: 20000 + stopping_patience: 1.00 # percentage of the number of epochs + layer_type: 'dense_per_flavour' + dropout: 0.0 + threshold_chi2: 50.0 - # 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) +fitting: fitbasis: NN31IC # EVOL (7), EVOLQED (8), etc. basis: - # remeber to change the name of PDF accordingly with fitbasis - # pos: True for NN squared - # mutsize: mutation size - # mutprob: mutation probability - # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.05,1.19], largex: [1.47,2.70] } - - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.94,1.25], largex: [0.11,5.87] } - - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.54,0.75], largex: [1.15,2.76] } - - { fl: v3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.21,0.57], largex: [1.35,3.08] } - - { fl: v8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.52,0.76], largex: [0.77,3.56] } - - { fl: t3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.37,1.52], largex: [1.74,3.39] } - - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.56,1.29], largex: [1.45,3.03] } - - { fl: cp, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.12,1.19], largex: [1.83,6.70] } - -############################################################ -stopping: - stopmethod: LOOKBACK # Stopping method - lbdelta : 0 # Delta for look-back stopping - mingen : 0 # Minimum number of generations - window : 500 # Window for moving average - minchi2 : 3.5 # Minimum chi2 - minchi2exp: 6.0 # Minimum chi2 for experiments - nsmear : 200 # Smear for stopping - deltasm : 200 # Delta smear for stopping - rv : 2 # Ratio for validation stopping - rt : 0.5 # Ratio for training stopping - epsilon : 1e-6 # Gradient epsilon + - { fl: sng, smallx: [1.05,1.19], largex: [1.47,2.70] } + - { fl: g, smallx: [0.94,1.25], largex: [0.11,5.87] } + - { fl: v, smallx: [0.54,0.75], largex: [1.15,2.76] } + - { fl: v3, smallx: [0.21,0.57], largex: [1.35,3.08] } + - { fl: v8, smallx: [0.52,0.76], largex: [0.77,3.56] } + - { fl: t3, smallx: [-0.37,1.52], largex: [1.74,3.39] } + - { fl: t8, smallx: [0.56,1.29], largex: [1.45,3.03] } + - { fl: cp, smallx: [0.12,1.19], largex: [1.83,6.70] } ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - -############################################################ -lhagrid: - nx : 150 - xmin: 1e-9 - xmed: 0.1 - xmax: 1.0 - nq : 50 - qmax: 1e5 + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier ############################################################ closuretest: diff --git a/n3fit/src/n3fit/tests/regressions/pc-quickcard.yml b/n3fit/src/n3fit/tests/regressions/pc-quickcard.yml index 48b9259998..3b1b661bf3 100644 --- a/n3fit/src/n3fit/tests/regressions/pc-quickcard.yml +++ b/n3fit/src/n3fit/tests/regressions/pc-quickcard.yml @@ -34,26 +34,26 @@ theory: theoryid: 162 # database id ############################################################ -fitting: - genrep: True # on = generate MC replicas, False = use real data - trvlseed: 3 - nnseed: 2 - mcseed: 1 +genrep: True # on = generate MC replicas, False = use real data +trvlseed: 3 +nnseed: 2 +mcseed: 1 - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [15, 10, 7] - activation_per_layer: ['tanh', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'RMSprop' - learning_rate: 0.00001 - clipnorm: 1.0 - epochs: 20000 - stopping_patience: 1.00 # percentage of the number of epochs - layer_type: 'dense_per_flavour' - dropout: 0.6 - threshold_chi2: 50.0 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 7] + activation_per_layer: ['tanh', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + optimizer: + optimizer_name: 'RMSprop' + learning_rate: 0.00001 + clipnorm: 1.0 + epochs: 20000 + stopping_patience: 1.00 # percentage of the number of epochs + layer_type: 'dense_per_flavour' + dropout: 0.6 + threshold_chi2: 50.0 +fitting: # 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) @@ -65,41 +65,18 @@ fitting: # mutsize: mutation size # mutprob: mutation probability # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.05,1.19], largex: [1.47,2.70] } - - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.94,1.25], largex: [0.11,5.87] } - - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.54,0.75], largex: [1.15,2.76] } - - { fl: v3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.21,0.57], largex: [1.35,3.08] } - - { fl: v8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.52,0.76], largex: [0.77,3.56] } - - { fl: t3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.37,1.52], largex: [1.74,3.39] } - - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.56,1.29], largex: [1.45,3.03] } - -############################################################ -stopping: - stopmethod: LOOKBACK # Stopping method - lbdelta : 0 # Delta for look-back stopping - mingen : 0 # Minimum number of generations - window : 500 # Window for moving average - minchi2 : 3.5 # Minimum chi2 - minchi2exp: 6.0 # Minimum chi2 for experiments - nsmear : 200 # Smear for stopping - deltasm : 200 # Delta smear for stopping - rv : 2 # Ratio for validation stopping - rt : 0.5 # Ratio for training stopping - epsilon : 1e-6 # Gradient epsilon + - { fl: sng, smallx: [1.05,1.19], largex: [1.47,2.70] } + - { fl: g, smallx: [0.94,1.25], largex: [0.11,5.87] } + - { fl: v, smallx: [0.54,0.75], largex: [1.15,2.76] } + - { fl: v3, smallx: [0.21,0.57], largex: [1.35,3.08] } + - { fl: v8, smallx: [0.52,0.76], largex: [0.77,3.56] } + - { fl: t3, smallx: [-0.37,1.52], largex: [1.74,3.39] } + - { fl: t8, smallx: [0.56,1.29], largex: [1.45,3.03] } ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - -############################################################ -lhagrid: - nx : 150 - xmin: 1e-9 - xmed: 0.1 - xmax: 1.0 - nq : 50 - qmax: 1e5 + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier ############################################################ closuretest: diff --git a/n3fit/src/n3fit/tests/regressions/quickcard.yml b/n3fit/src/n3fit/tests/regressions/quickcard.yml index dd52936f4d..572644de40 100644 --- a/n3fit/src/n3fit/tests/regressions/quickcard.yml +++ b/n3fit/src/n3fit/tests/regressions/quickcard.yml @@ -37,80 +37,47 @@ theory: theoryid: 162 # database id ############################################################ -fitting: - genrep: True # on = generate MC replicas, False = use real data - trvlseed: 3 - nnseed: 2 - mcseed: 1 +genrep: True # on = generate MC replicas, False = use real data +trvlseed: 3 +nnseed: 2 +mcseed: 1 -# save: "weights.h5" - load: "weights.h5" +load: "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', 'sigmoid', 'linear'] - initializer: 'glorot_normal' - optimizer: - optimizer_name: 'RMSprop' - learning_rate: 0.00001 - clipnorm: 1.0 - epochs: 1000 - positivity: - multiplier: 1.05 - initial: 1.5 - stopping_patience: 0.30 # percentage of the number of epochs - layer_type: 'dense' - dropout: 0.0 - threshold_chi2: 10.0 +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [15, 10, 8] + activation_per_layer: ['sigmoid', 'sigmoid', 'linear'] + initializer: 'glorot_normal' + optimizer: + optimizer_name: 'RMSprop' + learning_rate: 0.00001 + clipnorm: 1.0 + epochs: 1000 + positivity: + multiplier: 1.05 + initial: 1.5 + stopping_patience: 0.30 # percentage of the number of epochs + layer_type: 'dense' + dropout: 0.0 + threshold_chi2: 10.0 - # 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) +fitting: fitbasis: NN31IC # EVOL (7), EVOLQED (8), etc. basis: - # remeber to change the name of PDF accordingly with fitbasis - # pos: True for NN squared - # mutsize: mutation size - # mutprob: mutation probability - # smallx, largex: preprocessing ranges - - { fl: sng, pos: False, mutsize: [15], mutprob: [0.05], smallx: [1.05,1.19], largex: [1.47,2.70] } - - { fl: g, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.94,1.25], largex: [0.11,5.87] } - - { fl: v, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.54,0.75], largex: [1.15,2.76] } - - { fl: v3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.21,0.57], largex: [1.35,3.08] } - - { fl: v8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.52,0.76], largex: [0.77,3.56] } - - { fl: t3, pos: False, mutsize: [15], mutprob: [0.05], smallx: [-0.37,1.52], largex: [1.74,3.39] } - - { fl: t8, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.56,1.29], largex: [1.45,3.03] } - - { fl: cp, pos: False, mutsize: [15], mutprob: [0.05], smallx: [0.12,1.19], largex: [1.83,6.70] } - -############################################################ -stopping: - stopmethod: LOOKBACK # Stopping method - lbdelta : 0 # Delta for look-back stopping - mingen : 0 # Minimum number of generations - window : 500 # Window for moving average - minchi2 : 3.5 # Minimum chi2 - minchi2exp: 6.0 # Minimum chi2 for experiments - nsmear : 200 # Smear for stopping - deltasm : 200 # Delta smear for stopping - rv : 2 # Ratio for validation stopping - rt : 0.5 # Ratio for training stopping - epsilon : 1e-6 # Gradient epsilon + - { fl: sng, smallx: [1.05,1.19], largex: [1.47,2.70] } + - { fl: g, smallx: [0.94,1.25], largex: [0.11,5.87] } + - { fl: v, smallx: [0.54,0.75], largex: [1.15,2.76] } + - { fl: v3, smallx: [0.21,0.57], largex: [1.35,3.08] } + - { fl: v8, smallx: [0.52,0.76], largex: [0.77,3.56] } + - { fl: t3, smallx: [-0.37,1.52], largex: [1.74,3.39] } + - { fl: t8, smallx: [0.56,1.29], largex: [1.45,3.03] } + - { fl: cp, smallx: [0.12,1.19], largex: [1.83,6.70] } ############################################################ positivity: posdatasets: - - { dataset: POSF2U, poslambda: 1e6 } # Positivity Lagrange Multiplier - - { dataset: POSDYC , poslambda: 1e5 } - -############################################################ -lhagrid: - nx : 150 - xmin: 1e-9 - xmed: 0.1 - xmax: 1.0 - nq : 50 - qmax: 1e5 + - { dataset: POSF2U, maxlambda: 1e6 } # Positivity Lagrange Multiplier + - { dataset: POSDYC , maxlambda: 1e5 } ############################################################ closuretest: diff --git a/validphys2/src/validphys/closuretest/runcards/NNPDF40_closure_test.yml b/validphys2/src/validphys/closuretest/runcards/NNPDF40_closure_test.yml index de47727753..a177a77730 100644 --- a/validphys2/src/validphys/closuretest/runcards/NNPDF40_closure_test.yml +++ b/validphys2/src/validphys/closuretest/runcards/NNPDF40_closure_test.yml @@ -95,41 +95,33 @@ theory: theoryid: 53 # database id ############################################################ -fitting: - - trvlseed: 1727532335 - nnseed: 1737785873 - mcseed: 2123509817 - save: false +trvlseed: 1727532335 +nnseed: 1737785873 +mcseed: 2123509817 +genrep: true # true = generate MC replicas, false = use real data - seed: 1881658207 # set the seed for the random generator - genrep: true # true = generate MC replicas, false = use real data - rngalgo: 0 # 0 = ranlux, 1 = cmrg, see randomgenerator.cc - fitmethod: NGA # Minimization algorithm - nmutants: 80 # Number of mutants for replica - paramtype: NN - nnodes: [2, 5, 3, 1] +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [18, 24, 36, 8] + activation_per_layer: [tanh, sigmoid, sigmoid, linear] + initializer: glorot_normal + optimizer: + clipnorm: 100.0 + learning_rate: 1.0 + optimizer_name: Adadelta + epochs: 45000 + positivity: + initial: 338 + multiplier: + integrability: + initial: 10 + multiplier: + stopping_patience: 0.15 + layer_type: dense + dropout: 0.0 + threshold_chi2: 3.5 - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [18, 24, 36, 8] - activation_per_layer: [tanh, sigmoid, sigmoid, linear] - initializer: glorot_normal - optimizer: - clipnorm: 100.0 - learning_rate: 1.0 - optimizer_name: Adadelta - epochs: 45000 - positivity: - initial: 338 - multiplier: - integrability: - initial: 10 - multiplier: - stopping_patience: 0.15 - layer_type: dense - dropout: 0.0 - threshold_chi2: 3.5 +fitting: # 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) @@ -145,43 +137,29 @@ fitting: - {fl: t8, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [0.7236, 1.0], largex: [1.516, 3.649]} - {fl: t15, pos: false, trainable: false, mutsize: [15], mutprob: [0.05], smallx: [1.014, 1.137], largex: [1.43, 3.752]} -############################################################ -stopping: - stopmethod: LOOKBACK # Stopping method - lbdelta: 0 # Delta for look-back stopping - mingen: 0 # Minimum number of generations - window: 500 # Window for moving average - minchi2: 3.5 # Minimum chi2 - minchi2exp: 6.0 # Minimum chi2 for experiments - nsmear: 200 # Smear for stopping - deltasm: 200 # Delta smear for stopping - rv: 2 # Ratio for validation stopping - rt: 0.5 # Ratio for training stopping - epsilon: 1e-6 # Gradient epsilon - ############################################################ positivity: posdatasets: - - {dataset: POSF2U, poslambda: 1e6} # Positivity Lagrange Multiplier - - {dataset: POSF2DW, poslambda: 1e6} - - {dataset: POSF2S, poslambda: 1e6} - - {dataset: POSFLL, poslambda: 1e6} - - {dataset: POSDYU, poslambda: 1e10} - - {dataset: POSDYD, poslambda: 1e10} - - {dataset: POSDYS, poslambda: 1e10} - - {dataset: POSF2C, poslambda: 1e6} - - {dataset: POSXUQ, poslambda: 1e6} # Positivity of MSbar PDFs - - {dataset: POSXUB, poslambda: 1e6} - - {dataset: POSXDQ, poslambda: 1e6} - - {dataset: POSXDB, poslambda: 1e6} - - {dataset: POSXSQ, poslambda: 1e6} - - {dataset: POSXSB, poslambda: 1e6} - - {dataset: POSXGL, poslambda: 1e6} + - {dataset: POSF2U, maxlambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSF2DW, maxlambda: 1e6} + - {dataset: POSF2S, maxlambda: 1e6} + - {dataset: POSFLL, maxlambda: 1e6} + - {dataset: POSDYU, maxlambda: 1e10} + - {dataset: POSDYD, maxlambda: 1e10} + - {dataset: POSDYS, maxlambda: 1e10} + - {dataset: POSF2C, maxlambda: 1e6} + - {dataset: POSXUQ, maxlambda: 1e6} # Positivity of MSbar PDFs + - {dataset: POSXUB, maxlambda: 1e6} + - {dataset: POSXDQ, maxlambda: 1e6} + - {dataset: POSXDB, maxlambda: 1e6} + - {dataset: POSXSQ, maxlambda: 1e6} + - {dataset: POSXSB, maxlambda: 1e6} + - {dataset: POSXGL, maxlambda: 1e6} ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} closuretest: filterseed: 3345348918 # Random seed to be used in filtering data partitions @@ -194,14 +172,5 @@ closuretest: rancuttrnval: false # 0(1) to output training(valiation) chi2 in report printpdf4gen: false # To print info on PDFs during minimization -############################################################ -lhagrid: - nx: 150 - xmin: 1e-9 - xmed: 0.1 - xmax: 1.0 - nq: 50 - qmax: 1e5 - ############################################################ debug: false diff --git a/validphys2/src/validphys/config.py b/validphys2/src/validphys/config.py index 2996ef0015..df224a0689 100644 --- a/validphys2/src/validphys/config.py +++ b/validphys2/src/validphys/config.py @@ -799,28 +799,33 @@ def produce_t0set(self, use_t0=False, t0pdfset=None): else: return None - @element_of("posdatasets") - def parse_posdataset(self, posset: dict, *, theoryid): - """An observable used as positivity constrain in the fit. - It is a mapping containing 'dataset' and 'poslambda'.""" + def _parse_lagrange_multiplier(self, kind, theoryid, setdict): + """ Lagrange multiplier constraints are mappings + containing a `dataset` and a `maxlambda` argument which + defines the maximum value allowed for the multiplier """ bad_msg = ( - "posset must be a mapping with a name ('dataset') and " - "a float multiplier(poslambda)" + f"{kind} must be a mapping with a name ('dataset') and a float multiplier (maxlambda)" ) - - theoryno, theopath = theoryid + theoryno, _ = theoryid + lambda_key = "maxlambda" + #BCH allow for old-style runcards with 'poslambda' instead of 'maxlambda' + if "poslambda" in setdict and "maxlambda" not in setdict: + log.warning("The `poslambda` argument has been deprecated in favour of `maxlambda`") + lambda_key = "poslambda" try: - name = posset["dataset"] - poslambda = float(posset["poslambda"]) + name = setdict["dataset"] + maxlambda = float(setdict[lambda_key]) except KeyError as e: - raise ConfigError(bad_msg, e.args[0], posset.keys()) from e + raise ConfigError(bad_msg, setdict.keys(), e.args[0]) from e except ValueError as e: raise ConfigError(bad_msg) from e + return self.loader.check_posset(theoryno, name, maxlambda) - try: - return self.loader.check_posset(theoryno, name, poslambda) - except FileNotFoundError as e: - raise ConfigError(e) from e + @element_of("posdatasets") + def parse_posdataset(self, posset: dict, *, theoryid): + """An observable used as positivity constrain in the fit. + It is a mapping containing 'dataset' and 'maxlambda'.""" + return self._parse_lagrange_multiplier("posdataset", theoryid, posset) def produce_posdatasets(self, positivity): if not isinstance(positivity, dict) or "posdatasets" not in positivity: @@ -833,25 +838,9 @@ def produce_posdatasets(self, positivity): @element_of("integdatasets") def parse_integdataset(self, integset: dict, *, theoryid): """An observable corresponding to a PDF in the evolution basis, - used as integrability constrain in the fit. It is a mapping containing 'dataset' and 'poslambda'.""" - bad_msg = ( - "integset must be a mapping with a name ('dataset') and " - "a float multiplier(poslambda)" - ) - - theoryno, theopath = theoryid - try: - name = integset["dataset"] - poslambda = float(integset["poslambda"]) - except KeyError as e: - raise ConfigError(bad_msg, e.args[0], integset.keys()) from e - except ValueError as e: - raise ConfigError(bad_msg) from e - # use the same underlying c++ code as the positivity observables - try: - return self.loader.check_posset(theoryno, name, poslambda) - except FileNotFoundError as e: - raise ConfigError(e) from e + used as integrability constrain in the fit. + It is a mapping containing 'dataset' and 'maxlambda'.""" + return self._parse_lagrange_multiplier("integdataset", theoryid, integset) def produce_integdatasets(self, integrability): if not isinstance(integrability, dict) or "integdatasets" not in integrability: diff --git a/validphys2/src/validphys/core.py b/validphys2/src/validphys/core.py index f12c632053..a1021d16c5 100644 --- a/validphys2/src/validphys/core.py +++ b/validphys2/src/validphys/core.py @@ -529,13 +529,13 @@ def load(self): return FKTable(str(self.fkpath), [str(factor) for factor in self.cfactors]) class PositivitySetSpec(TupleComp): - def __init__(self, name ,commondataspec, fkspec, poslambda, thspec): + def __init__(self, name ,commondataspec, fkspec, maxlambda, thspec): self.name = name self.commondataspec = commondataspec self.fkspec = fkspec - self.poslambda = poslambda + self.maxlambda = maxlambda self.thspec = thspec - super().__init__(name, commondataspec, fkspec, poslambda, thspec) + super().__init__(name, commondataspec, fkspec, maxlambda, thspec) @@ -546,9 +546,8 @@ def __str__(self): def load(self): cd = self.commondataspec.load() fk = self.fkspec.load() - return PositivitySet(cd, fk, self.poslambda) + return PositivitySet(cd, fk, self.maxlambda) - #__slots__ = ('__weakref__', 'commondataspec', 'fkspec', 'poslambda') #We allow to expand the experiment as a list of datasets @@ -630,6 +629,15 @@ def as_input(self): dataset_inputs = experiments_to_dataset_inputs(d['experiments']) d['dataset_inputs'] = dataset_inputs + #BCH + # backwards compatibility hack for runcards with the 'fitting' namespace + # if a variable already exists outside 'fitting' it takes precedence + fitting = d.get("fitting") + if fitting is not None: + to_take_out = ["genrep", "trvlseed", "mcseed", "nnseed", "parameters"] + for vari in to_take_out: + if vari in fitting and vari not in d: + d[vari] = fitting[vari] return d def __str__(self): diff --git a/validphys2/src/validphys/eff_exponents.py b/validphys2/src/validphys/eff_exponents.py index 8c388c0b41..feaabde5ef 100644 --- a/validphys2/src/validphys/eff_exponents.py +++ b/validphys2/src/validphys/eff_exponents.py @@ -530,17 +530,21 @@ def iterated_runcard_yaml( # Update seeds with valid pseudorandom unsigned long int # Check if seeds exist especially since extra seeds needed in n3fit vs nnfit # Start with seeds in "fitting" section of runcard - fitting_data = filtermap["fitting"] fitting_seeds = ["seed", "trvlseed", "nnseed", "mcseed"] - + fitting_data = filtermap.get("fitting") + maxint = np.iinfo('int32').max for seed in fitting_seeds: - if seed in fitting_data: - fitting_data[seed] = random.randrange(0, 2**32) + if seed in filtermap: + filtermap[seed] = random.randrange(0, maxint) + elif fitting_data is not None and seed in fitting_data: + #BCH + # For older runcards the seeds are inside the `fitting` namespace + fitting_data[seed] = random.randrange(0, maxint) # Next "closuretest" section of runcard if "closuretest" in filtermap: closuretest_data = filtermap["closuretest"] if "filterseed" in closuretest_data: - closuretest_data["filterseed"] = random.randrange(0, 2**32) + closuretest_data["filterseed"] = random.randrange(0, maxint) return yaml.dump(filtermap, Dumper=yaml.RoundTripDumper) diff --git a/validphys2/src/validphys/n3fit_data.py b/validphys2/src/validphys/n3fit_data.py index 1120000bf6..078f8228a4 100644 --- a/validphys2/src/validphys/n3fit_data.py +++ b/validphys2/src/validphys/n3fit_data.py @@ -464,7 +464,7 @@ def fitting_pos_dict(posdataset): Examples -------- >>> from validphys.api import API - >>> posdataset = {"dataset": "POSF2U", "poslambda": 1e6} + >>> posdataset = {"dataset": "POSF2U", "maxlambda": 1e6} >>> pos = API.fitting_pos_dict(posdataset=posdataset, theoryid=162) >>> len(pos) 9 @@ -492,7 +492,7 @@ def integdatasets_fitting_integ_dict(integdatasets=None): Examples -------- >>> from validphys.api import API - >>> integdatasets = [{"dataset": "INTEGXT3", "poslambda": 1e2}] + >>> integdatasets = [{"dataset": "INTEGXT3", "maxlambda": 1e2}] >>> res = API.integdatasets_fitting_integ_dict(integdatasets=integdatasets, theoryid=53) >>> len(res), len(res[0]) (1, 9) diff --git a/validphys2/src/validphys/n3fit_data_utils.py b/validphys2/src/validphys/n3fit_data_utils.py index 976d19f545..547b9ab2f0 100644 --- a/validphys2/src/validphys/n3fit_data_utils.py +++ b/validphys2/src/validphys/n3fit_data_utils.py @@ -392,7 +392,7 @@ def positivity_reader(pos_spec): } ] - positivity_factor = pos_spec.poslambda + positivity_factor = pos_spec.maxlambda dict_out = { "datasets": pos_sets, diff --git a/validphys2/src/validphys/pseudodata.py b/validphys2/src/validphys/pseudodata.py index 43b9b9d8d4..d17ebff702 100644 --- a/validphys2/src/validphys/pseudodata.py +++ b/validphys2/src/validphys/pseudodata.py @@ -312,7 +312,7 @@ def fitted_pseudodata_internal(fit, experiments, num_fitted_replicas, t0pdfset=N replica = range(1, num_fitted_replicas + 1) trvlseed, mcseed, genrep = [ - fit.as_input().get("fitting").get(i) + fit.as_input().get(i) for i in ["trvlseed", "mcseed", "genrep"] ] diff --git a/validphys2/src/validphys/tests/regressions/dummy_closure_runcard.yaml b/validphys2/src/validphys/tests/regressions/dummy_closure_runcard.yaml index fc964b6704..4474665d94 100644 --- a/validphys2/src/validphys/tests/regressions/dummy_closure_runcard.yaml +++ b/validphys2/src/validphys/tests/regressions/dummy_closure_runcard.yaml @@ -37,43 +37,43 @@ theory: theoryid: 162 # database id ############################################################ -fitting: +trvlseed: 6416578340 +nnseed: 4106399685 +mcseed: 6355854418 +genrep: true # true = generate MC replicas, false = use real data + +parameters: # This defines the parameter dictionary that is passed to the Model Trainer + nodes_per_layer: [30, 30, 42, 18, 8] + activation_per_layer: [tanh, sigmoid, sigmoid, sigmoid, linear] + initializer: glorot_uniform + optimizer: + clipnorm: 46.2 + learning_rate: 0.73 + optimizer_name: Adadelta + epochs: 50000 + positivity: + initial: 370 + multiplier: + integrability: + initial: + multiplier: 1.03 + stopping_patience: 0.30 + layer_type: dense + dropout: 0.005 - trvlseed: 6416578340 - nnseed: 4106399685 - mcseed: 6355854418 +fitting: epochs: 20000 save: false - savefile: weights.hd5 load: false - loadfile: weights.hd5 seed: 577993051 # set the seed for the random generator - genrep: true # true = generate MC replicas, false = use real data rngalgo: 0 # 0 = ranlux, 1 = cmrg, see randomgenerator.cc fitmethod: NGA # Minimization algorithm nmutants: 80 # Number of mutants for replica paramtype: NN nnodes: [2, 5, 3, 1] - parameters: # This defines the parameter dictionary that is passed to the Model Trainer - nodes_per_layer: [30, 30, 42, 18, 8] - activation_per_layer: [tanh, sigmoid, sigmoid, sigmoid, linear] - initializer: glorot_uniform - optimizer: - clipnorm: 46.2 - learning_rate: 0.73 - optimizer_name: Adadelta - epochs: 50000 - positivity: - initial: 370 - multiplier: - integrability: - initial: - multiplier: 1.03 - stopping_patience: 0.30 - layer_type: dense - dropout: 0.005 + # 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) @@ -120,13 +120,13 @@ stopping: ############################################################ positivity: posdatasets: - - {dataset: POSDYC, poslambda: 1e6} # Positivity Lagrange Multiplier + - {dataset: POSDYC, maxlambda: 1e6} # Positivity Lagrange Multiplier ############################################################ integrability: integdatasets: - - {dataset: INTEGXT8, poslambda: 1e2} - - {dataset: INTEGXT3, poslambda: 1e2} + - {dataset: INTEGXT8, maxlambda: 1e2} + - {dataset: INTEGXT3, maxlambda: 1e2} closuretest: filterseed: 9116129314 # Random seed to be used in filtering data partitions