Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions doc/sphinx/source/tutorials/thcov_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ It can be found `here <https://github.com/NNPDF/nnpdf/tree/master/validphys2/exa
use_thcovmat_in_fitting: true
use_thcovmat_in_sampling: true

sampling_t0:
use_t0: false

fitting_t0:
use_t0: true

############################################################
fitting:
Expand Down
2 changes: 1 addition & 1 deletion n3fit/runcards/examples/Basic_feature_scaling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ datacuts:
theory:
theoryid: 200 # database id
sampling:
use_t0: false
separate_multiplicative: true

############################################################
trvlseed: 1
nnseed: 2
Expand Down
2 changes: 0 additions & 2 deletions n3fit/runcards/examples/Basic_hyperopt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ theory:
theoryid: 200 # database id

sampling:
use_t0: false
separate_multiplicative: true

hyperscan_config:
stopping:
min_epochs: 1e3
Expand Down
2 changes: 0 additions & 2 deletions n3fit/runcards/examples/Basic_runcard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ theory:
theoryid: 200 # database id

sampling:
use_t0: false
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']
Expand Down
1 change: 0 additions & 1 deletion n3fit/runcards/examples/Basic_runcard_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ theory:
theoryid: 162 # database id

sampling:
use_t0: false
separate_multiplicative: true
############################################################
trvlseed: 1
Expand Down
2 changes: 0 additions & 2 deletions n3fit/runcards/examples/DIS_diagonal_l2reg_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ theory:
theoryid: 162 # database id

sampling:
use_t0: false
separate_multiplicative: true

############################################################
trvlseed: 1
nnseed: 2
Expand Down
3 changes: 0 additions & 3 deletions n3fit/runcards/examples/Fit_with_theory_covmat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ theorycovmatconfig:
use_thcovmat_in_fitting: true
use_thcovmat_in_sampling: true

sampling:
use_t0: false
separate_multiplicative: false

############################################################
trvlseed: 376191634
Expand Down
2 changes: 0 additions & 2 deletions n3fit/runcards/examples/developing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ theory:
theoryid: 200 # database id

sampling:
use_t0: false
separate_multiplicative: true

############################################################
trvlseed: 1
nnseed: 2
Expand Down
2 changes: 0 additions & 2 deletions n3fit/src/n3fit/scripts/n3fit_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,8 @@ def from_yaml(cls, o, *args, **kwargs):
N3FIT_FIXED_CONFIG['use_scalevar_uncertainties'] = thconfig.get('use_scalevar_uncertainties', True)
#Sampling flags
if (sam_t0:=file_content.get('sampling')) is not None:
N3FIT_FIXED_CONFIG['use_t0_sampling'] = sam_t0.get('use_t0', False)
N3FIT_FIXED_CONFIG['separate_multiplicative'] = sam_t0.get('separate_multiplicative', True)
#Fitting flag
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the only other flag of sampling separate_multiplicative @andreab1997 ?

If so it might make sense to remove this extra level.

Also, maybe in the same vein as removing the option to not use t0 we might want to remove the option of doing the sampling with the multiplicative uncertainties separated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was the original proposal: it does not really make sense to separate the multiplicative uncertainties. However I think that @Zaharid was against. Are you still?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the only other flag of sampling separate_multiplicative @andreab1997 ?

To answer this question, yes so it makes sense to remove completely the sampling level

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say let's remove both the sampling level and separate_multiplicative

N3FIT_FIXED_CONFIG['use_t0_fitting'] = file_content.get('fitting').get('use_t0', True)
file_content.update(N3FIT_FIXED_CONFIG)
return cls(file_content, *args, **kwargs)

Expand Down
45 changes: 12 additions & 33 deletions validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ def produce_dataset_inputs_fitting_covmat(
self,
theory_covmat_flag=False,
use_thcovmat_in_fitting=False,
use_t0_fitting=True,
):
"""
Produces the correct covmat to be used in fitting_data_dict according
Expand All @@ -723,24 +722,16 @@ def produce_dataset_inputs_fitting_covmat(
"""
from validphys import covmats

if use_t0_fitting:
if theory_covmat_flag and use_thcovmat_in_fitting:
return covmats.dataset_inputs_t0_total_covmat
else:
return covmats.dataset_inputs_t0_exp_covmat
else:
if theory_covmat_flag and use_thcovmat_in_fitting:
return covmats.dataset_inputs_total_covmat
else:
return covmats.dataset_inputs_exp_covmat
if theory_covmat_flag and use_thcovmat_in_fitting:
return covmats.dataset_inputs_t0_total_covmat
return covmats.dataset_inputs_t0_exp_covmat

@configparser.explicit_node
def produce_dataset_inputs_sampling_covmat(
self,
sep_mult,
theory_covmat_flag=False,
use_thcovmat_in_sampling=False,
use_t0_sampling=False,
):
"""
Produces the correct covmat to be used in make_replica according
Expand All @@ -750,28 +741,16 @@ def produce_dataset_inputs_sampling_covmat(
"""
from validphys import covmats

if use_t0_sampling:
if theory_covmat_flag and use_thcovmat_in_sampling:
if sep_mult:
return covmats.dataset_inputs_t0_total_covmat_separate
else:
return covmats.dataset_inputs_t0_total_covmat
if theory_covmat_flag and use_thcovmat_in_sampling:
if sep_mult:
return covmats.dataset_inputs_total_covmat_separate
else:
if sep_mult:
return covmats.dataset_inputs_t0_exp_covmat_separate
else:
return covmats.dataset_inputs_t0_exp_covmat
return covmats.dataset_inputs_total_covmat
else:
if theory_covmat_flag and use_thcovmat_in_sampling:
if sep_mult:
return covmats.dataset_inputs_total_covmat_separate
else:
return covmats.dataset_inputs_total_covmat
if sep_mult:
return covmats.dataset_inputs_exp_covmat_separate
else:
if sep_mult:
return covmats.dataset_inputs_exp_covmat_separate
else:
return covmats.dataset_inputs_exp_covmat
return covmats.dataset_inputs_exp_covmat

def produce_loaded_theory_covmat(
self,
Expand Down Expand Up @@ -1051,12 +1030,12 @@ def parse_use_t0(self, do_use_t0: bool):

# TODO: Find a good name for this
def produce_t0set(
self, t0pdfset=None, use_t0_sampling=False, use_t0_fitting=True,
self, t0pdfset=None, use_t0=False,
):
"""Return the t0set if use_t0 is True and None otherwise. Raises an
error if t0 is requested but no t0set is given.
"""
if use_t0_sampling or use_t0_fitting:
if use_t0:
if not t0pdfset:
raise ConfigError("Setting use_t0 requires specifying a valid t0pdfset")
return t0pdfset
Expand Down