Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving pseudodata of replicas whit multiple fits #2138

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
20 changes: 10 additions & 10 deletions n3fit/src/n3fit/scripts/n3fit_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import sys
import warnings

from reportengine import colors
from reportengine import colors, collect
from reportengine.compat import yaml
from reportengine.namespaces import NSList
from validphys.app import App
Expand Down Expand Up @@ -133,15 +133,15 @@ def from_yaml(cls, o, *args, **kwargs):
if fps := file_content["fitting"].get("savepseudodata", True):
if fps != True:
raise TypeError(f"fitting::savepseudodata is neither True nor False ({fps})")
if len(kwargs["environment"].replicas) != 1:
raise ConfigError(
"Cannot request that multiple replicas are fitted and that "
"pseudodata is saved. Either set `fitting::savepseudodata` "
"to `false` or fit replicas one at a time."
)
# take same namespace configuration on the pseudodata_table action.
training_action = namespace + "training_pseudodata"
validation_action = namespace + "validation_pseudodata"
#if len(kwargs["environment"].replicas) != 1:
#raise ConfigError(
# "Cannot request that multiple replicas are fitted and that "
# "pseudodata is saved. Either set `fitting::savepseudodata` "
# "to `false` or fit replicas one at a time."
#)
# take same namespace configuration on the pseudodata_table action.
training_action = namespace + "replicas_training_pseudodata"
validation_action = namespace + "replicas_validation_pseudodata"

N3FIT_FIXED_CONFIG['actions_'].extend((training_action, validation_action))

Expand Down
3 changes: 2 additions & 1 deletion validphys2/src/validphys/n3fit_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ def replica_nnseed_fitting_data_dict(replica, exps_fitting_data_dict, replica_nn
"""
return (replica, exps_fitting_data_dict, replica_nnseed)


replicas_training_pseudodata = collect("training_pseudodata", ("replicas",))
replicas_validation_pseudodata = collect("validation_pseudodata", ("replicas",))
replicas_nnseed_fitting_data_dict = collect("replica_nnseed_fitting_data_dict", ("replicas",))
groups_replicas_indexed_make_replica = collect(
"indexed_make_replica", ("replicas", "group_dataset_inputs_by_experiment")
Expand Down