diff --git a/AcquistionFunctions/PreferenceExpectedImprovement.py b/AcquistionFunctions/PreferenceExpectedImprovement.py new file mode 100644 index 0000000..83bbe3c --- /dev/null +++ b/AcquistionFunctions/PreferenceExpectedImprovement.py @@ -0,0 +1,19 @@ +import numpy as np +from scipy.stats import norm + + +class PreferenceExpectedImprovement: + def __init__(self): + pass + + def rejection_sampling(self): + pass + + def expected_improvement(self): + pass + + def update_user_preference_model(self): + pass + + def update_proposal_model(self): + pass diff --git a/DistTesting/Testing.py b/DistTesting/Testing.py new file mode 100644 index 0000000..50ae73b --- /dev/null +++ b/DistTesting/Testing.py @@ -0,0 +1,25 @@ +import numpy as np +import matplotlib.pyplot as plt + +# Define the Gaussian distribution +mu, sigma = 0, 5 # High variance +gaussian = np.random.normal(mu, sigma, 1000000) # Generate a lot of samples + +# Rejection sampling +gaussian = gaussian[(gaussian > -1) & (gaussian < 1)] + +# Generate uniform distribution +uniform = np.random.uniform(-1, 1, len(gaussian)) # Same number of samples as the Gaussian + +# Plot the distributions +plt.figure(figsize=(12,6)) + +plt.subplot(1, 2, 1) +plt.hist(gaussian, bins=30, density=True, alpha=0.6, color='g') +plt.title('Gaussian Rejection Sampling') + +plt.subplot(1, 2, 2) +plt.hist(uniform, bins=30, density=True, alpha=0.6, color='b') +plt.title('Uniform Distribution') + +plt.show() \ No newline at end of file