Estimate failure probability for binary-valued black-box system
Project description
Bayesian Safety Validation
A Python implementation of bayesian safety validation.
Usage
from bayesian_safety_validation import BayesianSafetyValidation
# Define a black box function
def black_box_func(params) -> float:
return float(
(
(params["x1"] + 2 * params["x2"] - 7) ** 2
+ (2 * params["x1"] + params["x2"] - 5) ** 2
)
<= 200
)
# Create BSV with a parameter space
bsv = BayesianSafetyValidation(param_space={"x1": (-10, 5), "x2": (-10, 5)})
# Run BSV loop.
for i in range(10):
suggestions = bsv.suggest()
evaluations = [black_box_func(suggestion) for suggestion in suggestions]
print(f"suggestions: {suggestions}, evaluations: {evaluations}")
bsv.refit(suggestions, evaluations)
# Display results
bsv.falsification()
You will get this graph after running forementioned code
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for bayesian_safety_validation-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e6abb1bcb670afbeef09b76075a4e0a9baa00f8103c3e7d5c7fb96c5c1d7786 |
|
MD5 | 68b562ad2e071a38981e4ee311da9077 |
|
BLAKE2b-256 | 74b9a9e7d847a23d33fa7f5e44a459dc20f8cc08afdcc495b412fe31920420cc |