Expose positivity threshold in the runcard
Created by: scarlehoff
This is the maximum value that the replica's positivity loss can have to get a POS_PASS
tag in .fitinfo
. By default it has the conservative 1e-6
value, but now it can be changed directly from the runcard as sometimes might not a good idea to be too strict. A comparison below:
I used as baseline the 130920-nnpdf40_jcm_iterated fit from Cameron, for which 66% of the replica passed. This was with a threshold of 1e-6.
I've launched a fit with 1e-4 and another one with 1e-3, the results are below:
For 1e-4, 74% of the replicas passed positivity
https://vp.nnpdf.science/VLGnw8h8SPOVI4HxJ0YaXA==/
For 1e-3, 90% of the replicas passed positivity.
Merge request reports
Activity
requested review from @enocera
requested review from @enocera
added n3fit label
66 66 positivity: 67 67 multiplier: 1.05 # When any of the multiplier and/or the initial is not set 68 68 initial: # the poslambda will be used instead to compute these values per dataset 69 threshold: 1e-5 Created by: voisey
Okay, sure. I just worried that someone might use this runcard as a template but not fiddle with parameters such as these, but rather just e.g. add the datasets they want to use, not appreciating that it uses non-default values for certain parameters. But I suppose someone's far more likely to use an existing fit runcard, which makes this fine
100 117 if weight_freq < 0: 101 raise CheckError(f"The frequency at which weights are saved must be greater than 0, received {weight_freq}") 118 raise CheckError( 119 f"The frequency at which weights are saved must be greater than 0, received {weight_freq}" 120 ) 121 122 123 def check_lagrange_multipliers(parameters, key): 124 """Checks the parameters in a lagrange multiplier dictionary 125 are correct (positivity, integrability)""" 126 lagrange_dict = parameters.get(key) 127 if lagrange_dict is None: 128 return 129 multiplier = lagrange_dict.get("multiplier") 130 if multiplier is not None and multiplier <= 0: 131 log.warning("The %s multiplier is below 0, it will produce a negative loss", key)