Skip to content
Snippets Groups Projects
Commit a2c72e89 authored by Rebecca Kohlhaas's avatar Rebecca Kohlhaas
Browse files

Merge branch 'revert-02d880e5' into 'master'

Revert "Merge branch 'fix/BMC' into 'master'"

See merge request !19
parents 02d880e5 aaaebafd
No related branches found
No related tags found
1 merge request!19Revert "Merge branch 'fix/BMC' into 'master'"
Showing
with 31 additions and 2930 deletions
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="NUMPY" />
<option name="myDocStringFormat" value="NumPy" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="py.test" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.11" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/bayesvalidrox.iml" filepath="$PROJECT_DIR$/.idea/bayesvalidrox.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PySciProjectComponent">
<option name="PY_INTERACTIVE_PLOTS_SUGGESTED" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File deleted
......@@ -141,7 +141,7 @@ if __name__ == "__main__":
# One-shot (normal) or Sequential Adaptive (sequential) Design
ExpDesign.method = 'sequential'
ExpDesign.n_init_samples = 140#00#3*ndim
ExpDesign.n_init_samples = 100#3*ndim
# Sampling methods
# 1) random 2) latin_hypercube 3) sobol 4) halton 5) hammersley
......@@ -227,8 +227,7 @@ if __name__ == "__main__":
MetaModelOpts.ExpDesign = ExpDesign
engine = Engine(MetaModelOpts, Model, ExpDesign)
engine.start_engine()
#engine.train_sequential()
engine.train_normal()
engine.train_sequential()
# Load the objects
# with open(f"PCEModel_{Model.name}.pkl", "rb") as input:
......@@ -267,12 +266,12 @@ if __name__ == "__main__":
# BayesOpts.selected_indices = [0, 3, 5, 7, 9]
# BME Bootstrap
BayesOpts.bootstrap = True
BayesOpts.n_bootstrap_itrs = 500
BayesOpts.bootstrap_noise = 100
# BayesOpts.bootstrap = True
# BayesOpts.n_bootstrap_itrs = 500
# BayesOpts.bootstrap_noise = 100
# Bayesian cross validation
BayesOpts.bayes_loocv = True # TODO: test what this does
# BayesOpts.bayes_loocv = True
# Select the inference method
import emcee
......@@ -297,34 +296,31 @@ if __name__ == "__main__":
BayesOpts.Discrepancy = DiscrepancyOpts
# -- (Option C) --
if 0:
DiscOutputOpts = Input()
# # # OutputName = 'Z'
DiscOutputOpts.add_marginals()
DiscOutputOpts.Marginals[0].Nnme = '$\sigma^2_{\epsilon}$'
DiscOutputOpts.Marginals[0].dist_type = 'uniform'
DiscOutputOpts.Marginals[0].parameters = [0, 10]
#BayesOpts.Discrepancy = {'known': DiscrepancyOpts,
# 'infer': Discrepancy(DiscOutputOpts)}
BayesOpts.bias_inputs = {'Z':np.arange(0, 10, 1.).reshape(-1,1) / 9}
DiscOutputOpts = Input()
# OutputName = 'lambda'
DiscOutputOpts.add_marginals()
DiscOutputOpts.Marginals[0].name = '$\lambda$'
DiscOutputOpts.Marginals[0].dist_type = 'uniform'
DiscOutputOpts.Marginals[0].parameters = [0, 1]
# # OutputName = 'sigma_f'
DiscOutputOpts.add_marginals()
DiscOutputOpts.Marginals[1].Name = '$\sigma_f$'
DiscOutputOpts.Marginals[1].dist_type = 'uniform'
DiscOutputOpts.Marginals[1].parameters = [0, 1e-4]
#BayesOpts.Discrepancy = Discrepancy(DiscOutputOpts)
BayesOpts.Discrepancy = {'known': DiscrepancyOpts,
'infer': Discrepancy(DiscOutputOpts)}
# DiscOutputOpts = Input()
# # # OutputName = 'Z'
# DiscOutputOpts.add_marginals()
# DiscOutputOpts.Marginals[0].Nnme = '$\sigma^2_{\epsilon}$'
# DiscOutputOpts.Marginals[0].dist_type = 'uniform'
# DiscOutputOpts.Marginals[0].parameters = [0, 10]
# BayesOpts.Discrepancy = {'known': DiscrepancyOpts,
# 'infer': Discrepancy(DiscOutputOpts)}
# BayesOpts.bias_inputs = {'Z':np.arange(0, 10, 1.).reshape(-1,1) / 9}
# DiscOutputOpts = Input()
# # OutputName = 'lambda'
# DiscOutputOpts.add_marginals()
# DiscOutputOpts.Marginals[0].name = '$\lambda$'
# DiscOutputOpts.Marginals[0].dist_type = 'uniform'
# DiscOutputOpts.Marginals[0].parameters = [0, 1]
# # OutputName = 'sigma_f'
# DiscOutputOpts.add_marginals()
# DiscOutputOpts.Marginals[1].Name = '$\sigma_f$'
# DiscOutputOpts.Marginals[1].dist_type = 'uniform'
# DiscOutputOpts.Marginals[1].parameters = [0, 1e-4]
# BayesOpts.Discrepancy = Discrepancy(DiscOutputOpts)
# BayesOpts.Discrepancy = {'known': DiscrepancyOpts,
# 'infer': Discrepancy(DiscOutputOpts)}
# Start the calibration/inference
Bayes_PCE = BayesOpts.create_inference()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment