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

Param hotfix #194

Merged
merged 2 commits into from
Sep 20, 2024
Merged

Param hotfix #194

merged 2 commits into from
Sep 20, 2024

Conversation

hellkite500
Copy link
Member

Previously, only single model parameter spaces were fully supported by ngen-cal.

This feature makes it possible to calibrate a multi-bmi model with ngen by allowing multiple parameter sets from different models to be combined into a single search space with a unique (ish) index.

Note

Parameters with the exact same name between two models will be exposed as two parameters in the parameter space, but will always share the same value.

@aaraney
Copy link
Member

aaraney commented Sep 9, 2024

I don't think this works at least for dds in the uniform case b.c. this does not guarantee unique index values. When dds_update selects a random subset of parameters, if two of the parameters share the same name (e.g. 2 bmi modules have calib param with same name) the following code throw.

for n in neighborhood:
#permute the variables in neighborhood
#using a random normal sample * sigma, sigma = 0.2*(max-min)
#print(n, meta.best_params)
new = calibration_object.df.loc[n, agent.best_params] + calibration_object.df.loc[n, 'sigma']*np.random.normal(0,1)
lower = calibration_object.df.loc[n, 'min']
upper = calibration_object.df.loc[n, 'max']
#print( new )
#print( lower )
#print( upper )
if new < lower:
new = lower + (lower - new)
if new > upper:
new = lower
elif new > upper:
new = upper - (new - upper)
if new < lower:
new = upper

@aaraney aaraney merged commit bb31102 into NOAA-OWP:master Sep 20, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants