UQPyL 2.1.0__tar.gz → 2.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- UQPyL-2.1.2/PKG-INFO +528 -0
- UQPyL-2.1.2/README.md +512 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/__init__.py +1 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/__init__.py +4 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/single_objective/single_simple_problem.py +16 -16
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/delta_test.py +1 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/fast.py +2 -2
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/mars_sa.py +1 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/morris.py +1 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/rbd_fast.py +1 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/rsa.py +1 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/sobol.py +2 -2
- UQPyL-2.1.2/UQPyL.egg-info/PKG-INFO +528 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/pyproject.toml +2 -1
- {UQPyL-2.1.0 → UQPyL-2.1.2}/setup.py +5 -6
- UQPyL-2.1.0/PKG-INFO +0 -195
- UQPyL-2.1.0/README.md +0 -179
- UQPyL-2.1.0/UQPyL.egg-info/PKG-INFO +0 -195
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/fast_sequence.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/full_fact.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/lhs.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/morris_sequence.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/random.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/saltelli_sequence.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/samplerABC.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/DoE/sobol_sequence.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/algorithmABC.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/metric/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/metric/gd.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/metric/hv.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/metric/igd.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/multi_objective/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/multi_objective/moasmo.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/multi_objective/moea_d.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/multi_objective/nsga_ii.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/multi_objective/nsga_iii.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/multi_objective/rvea.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/population.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/result.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/abc.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/asmo.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/csa.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/de.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/ego.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/ga.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/ml_sce_ua.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/pso.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/single_objective/sce_ua.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/utility_functions/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/utility_functions/crowding_distance.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/utility_functions/ndsort.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/utility_functions/operation_GA.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/utility_functions/tournament_selection.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/optimization/utility_functions/uniform_point.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/multi_objective/DTLZ.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/multi_objective/ZDT.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/multi_objective/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/problem.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/problemABC.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/single_objective/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/single_objective/single_constraint_problem.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/utility_functions/NDsort.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/utility_functions/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/problems/utility_functions/uniformPoint.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/sensibility/saABC.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/auto_tuner.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/fnn/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/fnn/_activation_funcs.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/fnn/base.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/fnn/fully_connect_neural_network.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/gaussian_process.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/kernel/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/kernel/base_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/kernel/c_kernel_.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/kernel/dot_kernel_.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/kernel/matern_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/kernel/rbf_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/gp/kernel/rq_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/kriging/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/kriging/kernel/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/kriging/kernel/base_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/kriging/kernel/cubic_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/kriging/kernel/exp_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/kriging/kernel/guass_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/kriging/kriging.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_basis.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_forward.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_knot_search.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_pruning.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_qr.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_record.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_types.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/core/_util.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/mars/mars.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/kernel/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/kernel/base_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/kernel/cubic_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/kernel/gaussian_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/kernel/linear_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/kernel/multiquadric_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/kernel/thin_plate_spline_kernel.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/rbf/radial_basis_function.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/regression/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/regression/lasso/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/regression/lasso/lasso_fast.c +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/regression/linear_regression.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/regression/polynomial_regression.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/setting.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/surrogateABC.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/svr/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/svr/core/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/svr/core/libsvm_interface.cpp +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/svr/core/svm.cpp +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/svr/support_vector_machine.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/util/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/util/adam.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/surrogates/util/boxmin.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/utility/__init__.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/utility/data_selections.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/utility/metrics.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/utility/polynomial_features.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/utility/scalers.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL/utility/verbose.py +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL.egg-info/SOURCES.txt +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL.egg-info/dependency_links.txt +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL.egg-info/requires.txt +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/UQPyL.egg-info/top_level.txt +0 -0
- {UQPyL-2.1.0 → UQPyL-2.1.2}/setup.cfg +0 -0
UQPyL-2.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: UQPyL
|
|
3
|
+
Version: 2.1.2
|
|
4
|
+
Summary: A python package for parameter uncertainty quantification and optimization
|
|
5
|
+
Author: wmtSky
|
|
6
|
+
Author-email: wmtSky <wmtsky@hhu.edu.cn>
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# UQPyL: Uncertainty Quantification Python Lab
|
|
18
|
+
|
|
19
|
+
<p align="center"><img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/UQ.svg" width="400"/></p>
|
|
20
|
+
|
|
21
|
+
[](https://badge.fury.io/py/UQPyL)     
|
|
22
|
+
|
|
23
|
+
**UQPyL** is a Python package for **Uncertainty Quantification** and **Optimization** of computational models and their associated problems (e.g., model calibration, resource scheduling, product design). It includes a wide range of methods and algorithms for Design of Experiments, Sensitivity Analysis, Optimization (Single- and Multi-objective). Additionally, **Surrogate Models** are built-in for solving computationally expensive problems.
|
|
24
|
+
|
|
25
|
+
👉[中文文档](./README_CN.md)
|
|
26
|
+
|
|
27
|
+
## Contents
|
|
28
|
+
|
|
29
|
+
- [Main Features](#-main-features)
|
|
30
|
+
- [Installation](#-installation)
|
|
31
|
+
- [Useful Links](#-useful-links)
|
|
32
|
+
- [Overview of Methods, Algorithms and Problem](#-overview-of-methods-algorithms-and-problems)
|
|
33
|
+
- [Sensitivity Analysis](#sensitivity-analysis)
|
|
34
|
+
- [Optimization Algorithms](#optimization-algorithms)
|
|
35
|
+
- [Surrogate Models](#surrogate-models)
|
|
36
|
+
- [Single-objective Problems](#single-objective-problems)
|
|
37
|
+
- [Multi-objective Problems](#multi-objective-problems)
|
|
38
|
+
- [Quick Start](#-quick-start)
|
|
39
|
+
- [Call for Contributions](#-call-for-contributions)
|
|
40
|
+
- [Contact](#-contact)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## ✨ Main Features
|
|
44
|
+
1. **Comprehensive Sensitivity Analysis and Optimization**: Implements widely used sensitivity analysis methodologies and optimization algorithms.
|
|
45
|
+
2. **Running Display and Result Save**: Enable users to track and save the history and results of their running.
|
|
46
|
+
3. **Advanced Surrogate Modeling**: Integrates diverse surrogate models and auto-tunning tool to enhance these model performances.
|
|
47
|
+
4. **Rich Application Resources**: Provides a comprehensive suite of benchmark problems and practical case studies, enabling users to get started quickly. (👉**Recent Planing:** For water science research, we plan to customize the interface to integrate water-related models with UQPyL, enhancing usability and functionality, like [SWAT-UQ](https://github.com/smasky/SWAT-UQ). So, **if you have interest, please contact us to collaborate.**).
|
|
48
|
+
5. **Modular and Extensible Architecture**: Encourages and facilitates the development of novel methods or algorithms by users, aligning with our commitment to openness and collaboration. (**We appreciate and welcome contributions**)
|
|
49
|
+
|
|
50
|
+
## ⚙️ Installation
|
|
51
|
+
|
|
52
|
+
 
|
|
53
|
+
|
|
54
|
+
**Recommended (PyPi or Conda):**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install -U UQPyL
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
conda install UQPyL --upgrade
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Alternatively:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
git clone https://github.com/smasky/UQPyL.git
|
|
68
|
+
cd UQPyL
|
|
69
|
+
pip install .
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 🔗 Useful Links
|
|
73
|
+
|
|
74
|
+
- **Website**: [UQPyL Official Site](http://www.uq-pyl.com) (**TODO**: Needs update)
|
|
75
|
+
- **Source Code**: [GitHub Repository](https://github.com/smasky/UQPyL/)
|
|
76
|
+
- **Documentation**: [ReadTheDocs](https://uqpyl.readthedocs.io/en/latest/) (**TODO**: Being updating )
|
|
77
|
+
- **Citation Infos**: [UQPyL 2.0](**TODO**: Needs update), [UQPyL 1.0](https://www.sciencedirect.com/science/article/pii/S1364815215300955)
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 🎉 Overview of Methods, Algorithms and Problems
|
|
82
|
+
|
|
83
|
+
### Sensitivity Analysis
|
|
84
|
+
|
|
85
|
+
| Abbreviation | Full Name | References |
|
|
86
|
+
| -------|------------|----------|
|
|
87
|
+
| Sobol' | \ |[Sobol(2010)](https://www.sciencedirect.com/science/article/pii/S0378475400002706), [Saltelli (2002)](https://www.sciencedirect.com/science/article/pii/S0010465502002801)|
|
|
88
|
+
| DT| Delta Test| [Eirola et al. (2008)](https://www.semanticscholar.org/paper/Using-the-Delta-Test-for-Variable-Selection-Eirola-Liiti%C3%A4inen/fa131898bbd99e848e706837f4072a310e1109e5?p2df)|
|
|
89
|
+
| FAST | Fourier Amplitude Sensitivity Test | [Cukier et al. (1973)](https://pubs.aip.org/aip/jcp/article-abstract/59/8/3873/533535/Study-of-the-sensitivity-of-coupled-reaction), [Saltelli et al. (1999)](https://amstat.tandfonline.com/doi/abs/10.1080/00401706.1999.10485594)|
|
|
90
|
+
| RBD-FAST| Random Balance Designs Fourier Amplitude Sensitivity Test | [Tarantola et al. (2006)](https://www.sciencedirect.com/science/article/pii/S0951832005001444), [Tissot, Prieur (2012)](https://www.sciencedirect.com/science/article/pii/S0951832012001159)
|
|
91
|
+
|MARS-SA| Multivariate Adaptive Regression Splines for Sensibility Analysis |[Friedman, (1991)](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)|
|
|
92
|
+
|Morris| \ |[Morris, (2012)](https://www.tandfonline.com/doi/abs/10.1080/00401706.1991.10484804)|
|
|
93
|
+
|RSA| Regional Sensitivity Analysis | [Hornberger, Spear, (1981)](https://www.osti.gov/biblio/6396608), [Pianosi (2016)](https://www.sciencedirect.com/science/article/pii/S1364815216300287) |
|
|
94
|
+
|
|
95
|
+
💡 **Noted:** All methods now support for using surrogate models.
|
|
96
|
+
|
|
97
|
+
🚀 **Credits:** Special thanks to the [SALib](https://github.com/SALib/SALib) project for inspiring parts of the implementation.
|
|
98
|
+
|
|
99
|
+
### Optimization Algorithms
|
|
100
|
+
|
|
101
|
+
| Abbreviation | Full Name | Optimization Label | References |
|
|
102
|
+
|--------------|-----------| ----------|---------------|
|
|
103
|
+
| SCE-UA | Shuffled Complex Evolution| Single | [Duan et al. (1992)](https://link.springer.com/article/10.1007/BF00939380)|
|
|
104
|
+
| ML-SCE-UA| M&L Shuffled Complex Evolution| Single | [Muttil, Liong (2006)](https://www.worldscientific.com/doi/abs/10.1142/9789812707208_0036) |
|
|
105
|
+
| GA | Genetic Algorithm| Single | [Holland (1992)](https://direct.mit.edu/books/monograph/2574/Adaptation-in-Natural-and-Artificial-SystemsAn)|
|
|
106
|
+
| CSA | Cooperation Search Algorithm | Single | [Feng et al. (2021)](https://www.sciencedirect.com/science/article/pii/S1568494620306724) |
|
|
107
|
+
| PSO | Particle Swarm Optimization | Single | [Kennedy and Eberhart (1995)](https://ieeexplore.ieee.org/abstract/document/488968/) |
|
|
108
|
+
| DE | Differential Evolution | Single | [Storn and Price (1997)](https://link.springer.com/article/10.1023/a:1008202821328) |
|
|
109
|
+
| ABC |Artificial Bee Colony | Single | [Karaboga (2005)](https://abc.erciyes.edu.tr/pub/tr06_2005.pdf) |
|
|
110
|
+
| ASMO | Adaptive Surrogate Modelling based Optimization | Single, Surrogate | [Wang et al.(2014)](https://www.sciencedirect.com/science/article/pii/S1364815214001698) |
|
|
111
|
+
| EGO | Efficient Global Optimization | Single, Surrogate | [Jones (1998)](https://link.springer.com/article/10.1023/A:1008306431147)
|
|
112
|
+
| MOEA/D | Multi-objective Evolutionary Algorithm based on Decomposition | Multiple | [Zhang, Li (2007)](https://ieeexplore.ieee.org/document/4358754)|
|
|
113
|
+
| NSGA-II| Nondominated Sorting Genetic Algorithm II | Multiple | [Deb et al. (2002)](https://ieeexplore.ieee.org/document/996017)|
|
|
114
|
+
| NSGA-III| Nondominated Sorting Genetic Algorithm III| Multiple | [Deb, Jain (2014)](https://ieeexplore.ieee.org/document/6600851)|
|
|
115
|
+
| RVEA | Reference Vector guided Evolutionary Algorithm | Multiple | [Cheng et al. (2016)](https://ieeexplore.ieee.org/document/7386636)|
|
|
116
|
+
|MO-ASMO|Multi-Objective Adaptive Surrogate Modelling-based Optimization| Multiple, Surrogate | [Gong et al. (2015)](https://agupubs.onlinelibrary.wiley.com/doi/10.1002/2015WR018230)|
|
|
117
|
+
|
|
118
|
+
(The label `Surrogate` indicates solving computationally expensive optimization problem)
|
|
119
|
+
|
|
120
|
+
💡 **Noted:** This modular is still being updated. If you need other algorithms, please contact us.
|
|
121
|
+
|
|
122
|
+
### Surrogate Models
|
|
123
|
+
|
|
124
|
+
| Abbreviation | Full Name | Features |
|
|
125
|
+
|--------------|-----------|----------|
|
|
126
|
+
| KRG | Kriging | Support `guass`, `cubic`, `exp` kernel functions |
|
|
127
|
+
| GP | Gaussian Process | Support `const`, `rbf`, `dot`, `matern`, `rq` kernel functions |
|
|
128
|
+
| LR | Linear Regression | Support `origin`, `ridge`, `lasso` loss functions|
|
|
129
|
+
| PR | Polynomial Regression | Support `origin`, `ridge`, `lasso` loss functions|
|
|
130
|
+
| RBF | Radial Basis Function |Support `cubic`, `guass`, `linear`, `mq`, `tps` kernel functions and their corresponding hyper-parameters|
|
|
131
|
+
| SVM | Support Vector Machine | Use [libsvm](https://www.csie.ntu.edu.tw/~cjlin/libsvm/) as the core library |
|
|
132
|
+
| MARS | Multivariate Adaptive Regression Splines | Use [Earth](http://www.milbo.users.sonic.net/earth/) package as the core library |
|
|
133
|
+
|
|
134
|
+
❤️ Here, we provide the **Auto-tuning tool** to optimally build surrogate models, so you don't need to worry about hyper-parameters.
|
|
135
|
+
|
|
136
|
+
### Single-objective Problems
|
|
137
|
+
|
|
138
|
+
| Name | Formula | Optimal Solution | Optima |
|
|
139
|
+
|------|---------|------------------|--------|
|
|
140
|
+
|Sphere| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Sphere.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
|
|
141
|
+
|Schwefel_2_22| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_2_22.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
|
|
142
|
+
|Schwefel_1_22| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_1_22.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
|
|
143
|
+
|Schwefel_2_21| <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_2_21.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
|
|
144
|
+
|Schwefel_2_26 | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Schwefel_2_26.svg" /> | (420.9687 ... 420.9687) | -12569.5 |
|
|
145
|
+
| Rosenbrock | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Rosenbrock.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
|
|
146
|
+
| Step | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Step.svg" /> | ( 1, 1, 1 ... 1) | 0.0 |
|
|
147
|
+
| Quartic | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Quartic.svg" /> | ( 1, 1, 1 ... 1) | 0.0 |
|
|
148
|
+
| Rastrigin | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Rastrigin.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
|
|
149
|
+
| Ackley | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Ackley.svg" /> | ( 0, 0, 0 ... 0 ) | 0.0 |
|
|
150
|
+
| Griewank | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Griewank.svg" /> | ( 0, 0, 0 ... 0) | 0.0 |
|
|
151
|
+
| Trid | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Trid.svg" /> | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Trid_solution.svg">| `-D(D+4)(D-1)/6` |
|
|
152
|
+
| Bent_Cigar | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Bent_Cigar.svg" /> |(0, 0, 0 ... 0) | 0.0 |
|
|
153
|
+
| Discus | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Discus.svg" /> | (0, 0, 0 ... 0) | 0.0 |
|
|
154
|
+
| Weierstrass | <img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Weierstrass.svg" /> | (0, 0, 0 ... 0) | 0.0 |
|
|
155
|
+
|
|
156
|
+
### Multi-objective Problems
|
|
157
|
+
|
|
158
|
+
| Name | Num. of Objective | Shape of the Pareto Front | Feature |
|
|
159
|
+
|------|-------------------|---------------------------|---------|
|
|
160
|
+
| ZDT1 | 2 | Line | Convex |
|
|
161
|
+
| ZDT2 | 2 | Line | Concave |
|
|
162
|
+
| ZDT3 | 2 | Line | Disconnected |
|
|
163
|
+
| ZDT4 | 2 | Line | Convex |
|
|
164
|
+
| ZDT6 | 2 | Line | Concave |
|
|
165
|
+
| DTLZ1 | >=3 (user define) | Surface | Multimodal |
|
|
166
|
+
| DTLZ2 | >=3 (user define) | Surface | Single-peaked |
|
|
167
|
+
| DTLZ3 | >=3 (user define) | Surface | Multimodal|
|
|
168
|
+
| DTLZ4 | >=3 (user define) | Surface | Multimodal|
|
|
169
|
+
| DTLZ5 | >=3 (user define) | Line | Multimodal|
|
|
170
|
+
| DTLZ6 | >=3 (user define) | Line | Multimodal|
|
|
171
|
+
| DTLZ7 | >=3 (user define) | Discrete Surface | Multimodal|
|
|
172
|
+
|
|
173
|
+
### Practical Problems
|
|
174
|
+
|
|
175
|
+
**#TODO:** We are planning to incorporate some common hydrological model calibration (like SWAT, SAC...) or related water resource optimization cases into UQPyL.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 🍭 Quick Start
|
|
180
|
+
|
|
181
|
+
To effectively use UQPyL, the **first step** is to define the problem you solve:
|
|
182
|
+
1. The **basic information** of the problem, e.g., the dimension, range, value type (float, int, or discrete) of each variable, name of the problem, decisions, objectives.
|
|
183
|
+
2. The **function** from input variables `x` to output objective `obj` named `objFunc` in UQPyL, i.e., how the output `obj` is obtained from the inputs `x`, which could be an analytical function, or include running computational model, external black-box process. If necessary, the constraint functions named `concFunc` should be implemented.
|
|
184
|
+
|
|
185
|
+
Following problem is a variant of the Rosenbrock function, which adds additional constraint functions ($x_1^2+x_2^2+x_3^2 \ge 4$) and changes the variable types, from the origin `continuous` and `float` to `int` ($x_2$) and `discrete` ($x_3$). Take this as an example to illustrate the specific steps of problem definition.
|
|
186
|
+
|
|
187
|
+
<p align="center"><img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Problem1.svg" width=500/></p>
|
|
188
|
+
|
|
189
|
+
UQPyL provide a python class named `Problem` to simplify the workflow of defining problems.
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
<a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/defefine_problem.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
```python
|
|
196
|
+
# Step 1: import Problem class from UQPyL's problem module
|
|
197
|
+
from UQPyL.problems import Problem
|
|
198
|
+
|
|
199
|
+
# Step 2: define objFunc Function
|
|
200
|
+
# The 'objFunc' function is one that accepts a 2D numpy array 'X' as input and returns a 2D numpy array 'objs'. Specifically:
|
|
201
|
+
# The rows of the 2D array 'X' represent a set of decision variables, while the columns correspond to different values of the same variable.
|
|
202
|
+
# The returned 2D array 'objs' should have the same number of rows as 'X', and the number of columns should equal the number of objectives in the problem.
|
|
203
|
+
# For a single-objective problem, the shape of the 2D array 'objs' should be (N, 1), where 'N' is the number of input variables.
|
|
204
|
+
# For a multi-objective problem, the shape of the 2D array 'objs' should be (N, M), where 'M' is the number of objective functions.
|
|
205
|
+
# Users should ensure that the returned 2D array 'objs' satisfies the above shape requirements.
|
|
206
|
+
|
|
207
|
+
def objFunc(X):
|
|
208
|
+
# If possible, advise vectorizing operations on matrix X to improve computational efficiency.
|
|
209
|
+
objs =100 * (X[:, 2] - X[:, 1]**2)**2+ 100 * (X[:, 1] - X[:, 0]**2)**2 + \
|
|
210
|
+
(1 - X[:, 1])**2 + (1 - X[:, 0])**2
|
|
211
|
+
return objs[:, None] # Although UQPyL performs further checks, please ensure the returned `objs` is a 2D array.
|
|
212
|
+
|
|
213
|
+
# UQPyL also supports an alternative way of defining the objFunc function.
|
|
214
|
+
# For problems involving numerical simulation models, it's often not feasible to vectorize operations on matrix 'X'.
|
|
215
|
+
# To address this, UQPyL provides a decorator function @singleFunc that enables single running mode.
|
|
216
|
+
# In single running mode, The 'objFunc' function only accepts a Python list or 1D numpy array as input.
|
|
217
|
+
# It processes one decision variable combination at a time, making it suitable for complex or non-vectorizable objective functions.
|
|
218
|
+
|
|
219
|
+
# First, import the decorator that enables singleton mode from UQPyL
|
|
220
|
+
from UQPyL.problems import singleFunc
|
|
221
|
+
|
|
222
|
+
@singleFunc
|
|
223
|
+
def objFunc_(X): # Input X should be a 1D numpy array or Python list
|
|
224
|
+
# Perform calculations for each element in X
|
|
225
|
+
obj = 100 * (X[2] - X[1]**2)**2 + 100 * (X[1] - X[0]**2)**2 + \
|
|
226
|
+
(1 - X[1])**2 + (1 - X[0])**2
|
|
227
|
+
return obj # Return the objective value: a scalar for single-objective, or a 1D array/list for multi-objective
|
|
228
|
+
|
|
229
|
+
# Step 3: Define concFunc Function
|
|
230
|
+
# Similar to objFunc, the conFunc function supports two definition modes.
|
|
231
|
+
# Note: The return value of conFunc indicates whether the constraints are satisfied:
|
|
232
|
+
# - A negative value indicates a violation of the constraint — the smaller the value, the more severe the violation.
|
|
233
|
+
# - A positive value indicates the constraint is satisfied, i.e., the solution is feasible.
|
|
234
|
+
# As a result, users may need to reformulate their original constraint expressions to follow this convention.
|
|
235
|
+
|
|
236
|
+
# Matrix Mode
|
|
237
|
+
def conFunc(X):
|
|
238
|
+
cons = X[:, 0]**2 + X[:, 1]**2 + X[:, 2]**2 - 4
|
|
239
|
+
return cons[:, None]
|
|
240
|
+
|
|
241
|
+
# Single Running Mode
|
|
242
|
+
@singleFunc
|
|
243
|
+
def conFunc(X):
|
|
244
|
+
con = X[0]**2 + X[1]**2 + X[2]**2 - 4
|
|
245
|
+
return con
|
|
246
|
+
|
|
247
|
+
# Step 4: describe the properties of X
|
|
248
|
+
|
|
249
|
+
nInput = 3 # number of input variables (X), here it's 3 inputs.
|
|
250
|
+
nOutput = 1 # number of outputs (objective functions), here it's 1 objective.
|
|
251
|
+
|
|
252
|
+
#Upper bound of X.
|
|
253
|
+
ub = [10, 10, 10] # It can be a float, int, list, or numpy array.
|
|
254
|
+
# In this case, both input variables have an upper bound of 10.
|
|
255
|
+
|
|
256
|
+
# Lower bound of X.
|
|
257
|
+
lb = [0, 0, 0] # It can also be a float, int, list, or numpy array.
|
|
258
|
+
# In this case, both input variables have a lower bound of 0.
|
|
259
|
+
|
|
260
|
+
# Types of variables.
|
|
261
|
+
# type 0 for continuous, 1 for integer, and 2 for discrete.
|
|
262
|
+
varType = [0, 1, 2]
|
|
263
|
+
# varType[0] = 0: The first input (X[0]) is a float.
|
|
264
|
+
# varType[1] = 1: The second input (X[1]) is an integer variable.
|
|
265
|
+
# varType[2] = 2: The second input (X[2]) is a discrete variable.
|
|
266
|
+
|
|
267
|
+
# The set of possible values for discrete variables.
|
|
268
|
+
varSet = {2: [2, 3.4, 5.1, 7]}
|
|
269
|
+
# varSet is a dictionary where the key indicates the index of the variable (2 refers to the third variable, x3). It follows Python's zero-based indexing.
|
|
270
|
+
# The value associated with key 2 specifies the set of possible values for X[2]: [2, 3.4, 5.1, 7].
|
|
271
|
+
# This means that X[2] can only take one of these four values: 2, 3.4, 5.1, or 7.
|
|
272
|
+
|
|
273
|
+
# The optimization type: 'min' for minimization, 'max' for maximization.
|
|
274
|
+
optType = 'min'
|
|
275
|
+
|
|
276
|
+
# Names (or labels) for the input variables.
|
|
277
|
+
xLabels = ['x1', 'x2', 'x3']
|
|
278
|
+
# If the optimization problem has named variables, you can set them here.
|
|
279
|
+
# Otherwise, default names like 'x1', 'x2', 'x3', etc., can be used.
|
|
280
|
+
|
|
281
|
+
# Names (or labels) for the objective functions.
|
|
282
|
+
yLabels = ['obj1'] # Similar to xLabel, if your objective(s) have specific names, you can set them here.
|
|
283
|
+
# Otherwise, use default labels like 'obj1', 'obj2', etc.
|
|
284
|
+
|
|
285
|
+
# Name of the optimization problem
|
|
286
|
+
name = 'Rosenbrock'
|
|
287
|
+
# Useful for identifying the problem instance, organizing results, saving files, etc.
|
|
288
|
+
|
|
289
|
+
#Step 5: Initialize the problem instance
|
|
290
|
+
problem = Problem(
|
|
291
|
+
nInput=nInput,
|
|
292
|
+
nOutput=nOutput,
|
|
293
|
+
objFunc=objFunc,
|
|
294
|
+
conFunc=conFunc,
|
|
295
|
+
ub=ub,
|
|
296
|
+
lb=lb,
|
|
297
|
+
varType=varType,
|
|
298
|
+
varSet=varSet,
|
|
299
|
+
xLabels=xLabels,
|
|
300
|
+
yLabels=yLabels,
|
|
301
|
+
name=name
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
# Step 6: Use optimization methods from UQPyL
|
|
305
|
+
# All methods and algorithms in UQPyL operate by reading the 'problem' object
|
|
306
|
+
# In this example, we are using the Genetic Algorithm (GA) for optimization
|
|
307
|
+
from UQPyL.optimization.single_objective import GA
|
|
308
|
+
|
|
309
|
+
# Create an instance of the Genetic Algorithm (GA). By default, GA will output optimization history
|
|
310
|
+
# and final results in the command line.
|
|
311
|
+
ga = GA()
|
|
312
|
+
|
|
313
|
+
# Run the Genetic Algorithm optimization by passing the defined 'problem' object
|
|
314
|
+
ga.run(problem = problem)
|
|
315
|
+
# Output:
|
|
316
|
+
# Time: 0.0 day | 0.0 hour | 0.0 minute | 1.17 second
|
|
317
|
+
# Used FEs: 50000 | Iters: 999
|
|
318
|
+
# Best Objs and Best Decision with the FEs
|
|
319
|
+
# +-------------------+-------------------+-------------------+-------------------+
|
|
320
|
+
# | FEs | Iters | OptType | Feasible |
|
|
321
|
+
# +-------------------+-------------------+-------------------+-------------------+
|
|
322
|
+
# | 50 | 0 | min | True |
|
|
323
|
+
# +-------------------+-------------------+-------------------+-------------------+
|
|
324
|
+
# +-------------------+-------------------+-------------------+-------------------+
|
|
325
|
+
# | obj1 | x1 | x2 | x3 |
|
|
326
|
+
# +-------------------+-------------------+-------------------+-------------------+
|
|
327
|
+
# | 4.0e+02 | 0.000 | 0.000 | 2.000 |
|
|
328
|
+
# +-------------------+-------------------+-------------------+-------------------+
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Benchmark Problems
|
|
332
|
+
UQPyL provides built-in benchmark problems (inheriting from `Problem` class) to test methods.
|
|
333
|
+
```python
|
|
334
|
+
from UQPyL.problems.single_objective import Sphere, Ackley
|
|
335
|
+
from UQPyL.problems.multi_objective import ZDT1, DTLZ1
|
|
336
|
+
|
|
337
|
+
# Create benchmark problems for testing algorithms
|
|
338
|
+
# You can easily customize the input dimension and variable bounds as needed
|
|
339
|
+
|
|
340
|
+
# Single-objective benchmark problems
|
|
341
|
+
problem1 = Sphere(nInput=10, ub=100, lb=-100) # Sphere function with 10 dimensions, bounds [-100, 100]
|
|
342
|
+
problem2 = Ackley(nInput=10, ub=np.ones(10)*100, lb=np.ones(10)*-100) # Ackley function with 10 dimensions
|
|
343
|
+
|
|
344
|
+
# Multi-objective benchmark problems
|
|
345
|
+
problem3 = ZDT1(nInput=5) # ZDT1 problem with 5 decision variables
|
|
346
|
+
problem4 = DTLZ1(nInput=15) # DTLZ1 problem with 15 decision variables
|
|
347
|
+
|
|
348
|
+
# UQPyL provides ready-to-use benchmark problems for both single and multi-objective optimization.
|
|
349
|
+
# You can easily adjust input dimensions and variable bounds to suit your testing needs.
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
### Sensitivity Analysis
|
|
355
|
+
|
|
356
|
+
Here, use Ishigami Function as example.
|
|
357
|
+
<p align="center"><img src="https://raw.githubusercontent.com/smasky/UQPyL/dev/docs/pic/Problem2.svg" width=400 /></p>
|
|
358
|
+
|
|
359
|
+
The theoretical sensitivity indices of the Ishigami function are as follows:
|
|
360
|
+
First-order sensitivity indices: x1 = 0.314, x2 = 0.442, x3 = 0.000
|
|
361
|
+
Total-order sensitivity indices: x1 = 0.558, x2 = 0.442, x3 = 0.244
|
|
362
|
+
|
|
363
|
+
<a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/sensitivity_analysis.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
|
|
364
|
+
|
|
365
|
+
```python
|
|
366
|
+
import numpy as np
|
|
367
|
+
from UQPyL.problems import Problem
|
|
368
|
+
# Define Ishigami Function
|
|
369
|
+
def objFunc(X):
|
|
370
|
+
objs = np.sin(X[:, 0]) + 7 * np.sin(X[:, 1])**2 + \
|
|
371
|
+
0.1 * X[:, 2]**4 * np.sin(X[:, 0])
|
|
372
|
+
return objs[:, None]
|
|
373
|
+
|
|
374
|
+
Ishigami = Problem(nInput = 3, nOutput = 1, objFunc = objFunc,
|
|
375
|
+
ub = np.pi, lb = -1*np.pi, varType = [0, 0, 0],
|
|
376
|
+
name = "Ishigami")
|
|
377
|
+
|
|
378
|
+
from UQPyL.sensibility import Sobol
|
|
379
|
+
|
|
380
|
+
# Instantiate a Sobol sensitivity analysis object
|
|
381
|
+
sobol = Sobol()
|
|
382
|
+
# N = 512 defines the base sample size;
|
|
383
|
+
# total number of evaluations will be larger due to Sobol' method structure
|
|
384
|
+
X = sobol.sample(problem = Ishigami, N = 512)
|
|
385
|
+
|
|
386
|
+
# Evaluate the objective function (i.e., Ishigami function) on the sample points
|
|
387
|
+
# Returns an array of function outputs corresponding to each input in X
|
|
388
|
+
Obj = problem.objFunc(X)
|
|
389
|
+
|
|
390
|
+
# Perform Sobol' sensitivity analysis
|
|
391
|
+
# Inputs:
|
|
392
|
+
# - problem: the problem instance (defines bounds and function)
|
|
393
|
+
# - X: the input samples
|
|
394
|
+
# - Obj: the function evaluations at X
|
|
395
|
+
sobol.analyze(problem, X, Obj)
|
|
396
|
+
|
|
397
|
+
# By default, the following results will be obtained:
|
|
398
|
+
# =======================Attribute=======================
|
|
399
|
+
# First Order Sensitivity: True
|
|
400
|
+
# Second Order Sensitivity: False
|
|
401
|
+
# Total Order Sensitivity: True
|
|
402
|
+
# ======================Conclusion=============================
|
|
403
|
+
# --------------------------S1---------------------------------
|
|
404
|
+
# +-------------------+-------------------+-------------------+
|
|
405
|
+
# | x_1 | x_2 | x_3 |
|
|
406
|
+
# +-------------------+-------------------+-------------------+
|
|
407
|
+
# | 0.3222 | 0.4531 | 0.0175 |
|
|
408
|
+
# +-------------------+-------------------+-------------------+
|
|
409
|
+
# --------------------------ST---------------------------------
|
|
410
|
+
# +-------------------+-------------------+-------------------+
|
|
411
|
+
# | x_1 | x_2 | x_3 |
|
|
412
|
+
# +-------------------+-------------------+-------------------+
|
|
413
|
+
# | 0.5436 | 0.4306 | 0.2416 |
|
|
414
|
+
# +-------------------+-------------------+-------------------+
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
### Optimization
|
|
418
|
+
|
|
419
|
+
Here's an example using SCE-UA to optimize the Sphere function
|
|
420
|
+
|
|
421
|
+
<a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/optimization.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
|
|
422
|
+
|
|
423
|
+
```python
|
|
424
|
+
|
|
425
|
+
# Import the Sphere benchmark function
|
|
426
|
+
from UQPyL.problems.single_objective import Sphere
|
|
427
|
+
|
|
428
|
+
# Instantiate the problem with 10 input dimensions; other settings use defaults
|
|
429
|
+
sphere = Sphere(nInput = 10) #Other settings use default
|
|
430
|
+
|
|
431
|
+
# Import the SCE-UA optimization algorithm
|
|
432
|
+
from UQPyL.optimization.single_objective import SCE_UA
|
|
433
|
+
|
|
434
|
+
# Instantiate the optimizer with default settings
|
|
435
|
+
sce = SCE_UA()
|
|
436
|
+
|
|
437
|
+
# Run the optimization on the Sphere problem
|
|
438
|
+
res = sce.run(sphere)
|
|
439
|
+
|
|
440
|
+
# Extract the best decision variables and objective values
|
|
441
|
+
bestDecs = res.bestDecs
|
|
442
|
+
bestObjs = res.bestObjs
|
|
443
|
+
|
|
444
|
+
# The program would display the optimization history in the command line
|
|
445
|
+
# =========Conclusion=================================
|
|
446
|
+
# Time: 0.0 day | 0.0 hour | 0.0 minute | 5.32 second
|
|
447
|
+
# Used FEs: 24356 | Iters: 1000
|
|
448
|
+
# Best Objs and Best Decision with the FEs
|
|
449
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
450
|
+
# | FEs | Iters | OptType | Feasible | y_1 |
|
|
451
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
452
|
+
# | 24122 | 990 | min | True | 4.6e-12 |
|
|
453
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
454
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
455
|
+
# | x_1 | x_2 | x_3 | x_4 | x_5 |
|
|
456
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
457
|
+
# | -0.000 | -0.000 | 0.000 | 0.000 | -0.000 |
|
|
458
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
459
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
460
|
+
# | x_6 | x_7 | x_8 | x_9 | x_10 |
|
|
461
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
462
|
+
# | -0.000 | -0.000 | 0.000 | -0.000 | -0.000 |
|
|
463
|
+
# +-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### Surrogate Modeling
|
|
467
|
+
|
|
468
|
+
Use RBF model to predict Sphere Function as an example
|
|
469
|
+
|
|
470
|
+
<a href="https://nbviewer.org/github/smasky/UQPyL/blob/dev/notebooks/surrogate_modelling.ipynb" target="_blank">📘 View Jupyter Notebook example online </a>
|
|
471
|
+
|
|
472
|
+
```python
|
|
473
|
+
from UQPyL.problems import Sphere
|
|
474
|
+
#Instantiate the problem
|
|
475
|
+
sphere = Sphere(nInput = 10)
|
|
476
|
+
|
|
477
|
+
# Import Latin Hypercube Sampling (LHS) for generating design of experiments
|
|
478
|
+
from UQPyL.DoE import LHS
|
|
479
|
+
|
|
480
|
+
# Generate 200 training samples in the input space using LHS
|
|
481
|
+
lhs = LHS()
|
|
482
|
+
xTrain = lhs.sample(200, problem.nInput, problem = sphere)
|
|
483
|
+
|
|
484
|
+
# Evaluate the true objective function at training points
|
|
485
|
+
yTrain = sphere.objFunc(xTrain)
|
|
486
|
+
|
|
487
|
+
# Generate 50 test samples for model validation
|
|
488
|
+
xTest = lhs.sample(50, problem.nInput, problem = sphere)
|
|
489
|
+
# Evaluate the true function at test points
|
|
490
|
+
yTest = sphere.objFunc(xTest)
|
|
491
|
+
|
|
492
|
+
# Import Radial Basis Function (RBF) surrogate model
|
|
493
|
+
from UQPyL.surrogate.rbf import RBF
|
|
494
|
+
|
|
495
|
+
# Initialize and fit the RBF surrogate model
|
|
496
|
+
rbf = RBF()
|
|
497
|
+
rbf.fit(xTrain, yTrain)
|
|
498
|
+
|
|
499
|
+
# Use the trained RBF model to predict outputs on test inputs
|
|
500
|
+
yPred = rbf.predict(xTest)
|
|
501
|
+
|
|
502
|
+
# Import R² metric to evaluate surrogate model performance
|
|
503
|
+
from UQPyL.utility.metric import r_square
|
|
504
|
+
# Compute R² score between true and predicted test outputs
|
|
505
|
+
r2 = r_square(yTest, yPred)
|
|
506
|
+
print(r2)
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
💡 **Noted:** More advanced features and examples are coming soon — check out the [documentation](https://uqpyl.readthedocs.io/en/latest/) (updates in progress, thanks for bearing with us)!
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## 🔥 Call for Contributions
|
|
514
|
+
|
|
515
|
+
We welcome contributions to expand our library with more advanced UQ methods, optimization algorithms and engineering problems.
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## 📧 Contact
|
|
520
|
+
|
|
521
|
+
For any inquiries or contributions, please contact:
|
|
522
|
+
|
|
523
|
+
**wmtSky**
|
|
524
|
+
Email: [wmtsmasky@gmail.com](mailto:wmtsmasky@gmail.com)(priority), [wmtsky@hhu.edu.cn](mailto:wmtsky@hhu.edu.cn)
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
*This project is licensed under the MIT License - see the [LICENSE](https://github.com/smasky/UQPyL/LICENSE) file for details.*
|