Skip to content

Commit

Permalink
Merge pull request #2068 from NNPDF/fix_ct_docs
Browse files Browse the repository at this point in the history
update the closure test docs
  • Loading branch information
RoyStegeman authored May 9, 2024
2 parents f796d7e + 5874ee6 commit 807d5c2
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 238 deletions.
13 changes: 1 addition & 12 deletions doc/sphinx/source/tutorials/closuretest.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ closuretest:
filterseed : 0 # Random seed to be used in filtering data partitions
fakedata : False
fakepdf : MMHT2014nnlo68cl
errorsize : 1.0 # uncertainties rescaling
fakenoise : False
rancutprob : 1.0 # Fraction of data to be included in the fit
rancutmethod: 0 # Method to select rancutprob data fraction
rancuttrnval: False # 0(1) to output training(valiation) chi2 in report
printpdf4gen: False # To print info on PDFs during minimization
```
Setting ``fakedata`` to ``True`` will cause closure test pseudodata to be generated
Expand All @@ -80,21 +75,15 @@ closuretest:
filterseed : 0 # Random seed to be used in filtering data partitions
fakedata : True
fakepdf : MMHT2014nnlo68cl
errorsize : 1.0 # uncertainties rescaling
fakenoise : True
rancutprob : 1.0 # Fraction of data to be included in the fit
rancutmethod: 0 # Method to select rancutprob data fraction
rancuttrnval: False # 0(1) to output training(valiation) chi2 in report
printpdf4gen: False # To print info on PDFs during minimization
```
Note that it is *critical* that two closure tests which are to be compared have
the same ``filterseed``. They should also both have been run during a time where
no major changes were made to data generation. This is because fits with
different level 1 noise produce different closure test estimators. See for
example a [report](https://vp.nnpdf.science/mbcTUd6-TQmQFvaGd37bkg==/)
comparing two level 2 closure tests with identical settings apart from
``filterseed``. Note that setting ``filterseed`` to 0 will use the default seed for
the selected ``fitting::rngalgo``.
``filterseed``.
There are still some relevant settings to the closure test. For the above example
we would choose that the t0 set was the same as the underlying law:
Expand Down
88 changes: 88 additions & 0 deletions n3fit/runcards/examples/Basic_runcard_closure_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#
# Configuration file for n3fit
#
############################################################
description: Basic closure test runcard

############################################################
# frac: training fraction
# ewk: apply ewk k-factors
# sys: systematics treatment (see systypes)
dataset_inputs:
- {dataset: NMC_NC_NOTFIXED_DW_EM-F2, frac: 0.75, variant: legacy}
- {dataset: SLAC_NC_NOTFIXED_D_DW_EM-F2, frac: 0.75, variant: legacy}
- {dataset: ATLAS_Z0J_8TEV_PT-M, frac: 0.75, cfac: [], variant: legacy_10}

############################################################
datacuts:
t0pdfset : NNPDF40_nnlo_as_01180 # PDF set to generate t0 covmat
q2min : 3.49 # Q2 minimum
w2min : 12.5 # W2 minimum

############################################################
theory:
theoryid: 708 # database id

sampling:
separate_multiplicative: 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'
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

############################################################
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)
# FLVR(QED) = g=0, u=1, ubar=2, d=3, dbar=4, s=5, sbar=6, (pht=7)
fitbasis: NN31IC # EVOL (7), EVOLQED (8), etc.
basis:
# remeber to change the name of PDF accordingly with fitbasis
- { fl: sng, smallx: [1.05,1.19], largex: [1.47,2.70], trainable: False }
- { fl: g, smallx: [0.94,1.25], largex: [0.11,5.87], trainable: False }
- { fl: v, smallx: [0.54,0.75], largex: [1.15,2.76], trainable: False }
- { fl: v3, smallx: [0.21,0.57], largex: [1.35,3.08] }
- { fl: v8, smallx: [0.52,0.76], largex: [0.77,3.56], trainable: True }
- { 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: NNPDF_POS_2P24GEV_F2U, maxlambda: 1e6} # Positivity Lagrange Multiplier
- {dataset: NNPDF_POS_2P24GEV_FLL-19PTS, maxlambda: 1e6}

############################################################
integrability:
integdatasets:
- {dataset: NNPDF_INTEG_3GEV_XT3, maxlambda: 1e2}

############################################################
debug: True
maxcores: 8

closuretest:
filterseed: 3345348918 # Random seed to be used in filtering data partitions
fakedata: true # true = to use FAKEPDF to generate pseudo-data
fakepdf: NNPDF40_nnlo_as_01180 # Theory input for pseudo-data
fakenoise: true # true = to add random fluctuations to pseudo-data
179 changes: 0 additions & 179 deletions validphys2/src/validphys/closuretest/runcards/NNPDF40_closure_test.yml

This file was deleted.

This file was deleted.

0 comments on commit 807d5c2

Please sign in to comment.