initial commit

This commit is contained in:
Niko Feith 2023-02-03 11:34:24 +01:00
parent df79df9808
commit cf400926dc
2 changed files with 3 additions and 5 deletions

View File

@ -10,8 +10,6 @@ import time
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from warnings import catch_warnings, simplefilter
class BayesianOptimization: class BayesianOptimization:
def __init__(self, env, nr_step, nr_init=3, acq='ei', nr_weights=8, policy_seed=None): def __init__(self, env, nr_step, nr_init=3, acq='ei', nr_weights=8, policy_seed=None):
self.env = env self.env = env

View File

@ -38,9 +38,9 @@ class GaussianPolicy:
def plot_policy(self): def plot_policy(self):
x = np.linspace(0, self.nr_steps, self.nr_steps) x = np.linspace(0, self.nr_steps, self.nr_steps)
plt.plot(x, self.trajectory) plt.plot(x, self.trajectory)
for i in self.mean: # for i in self.mean:
gaussian = np.exp(-0.5 * (x - i)**2 / self.std**2) # gaussian = np.exp(-0.5 * (x - i)**2 / self.std**2)
plt.plot(x, gaussian) # plt.plot(x, gaussian)
plt.show() plt.show()