Skip to content

Commit

Permalink
changed func for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronkl committed Nov 28, 2016
1 parent 5c682e3 commit d05eef2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions examples/example_bohamiann.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@

logging.basicConfig(level=logging.INFO)

f = Branin()
info = f.get_meta_information()
bounds = np.array(info['bounds'])

def objective_function(x):
y = np.sin(3 * x[0]) * 4 * (x[0] - 1) * (x[0] + 2)
return y

# Defining the bounds and dimensions of the input space
lower = np.array([0])
upper = np.array([6])

# Start Bayesian optimization to optimize the objective function
results = bohamiann(f, bounds[:, 0], bounds[:, 1], num_iterations=20)
results = bohamiann(objective_function, lower, upper, num_iterations=20)
print(results["x_opt"])
print(results["f_opt"])
2 changes: 2 additions & 0 deletions examples/example_fmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import logging
logging.basicConfig(level=logging.INFO)


# The optimization function that we want to optimize.
# It gets a numpy array with shape (1,D) where D is the number of input dimensions
def objective_function(x):
Expand Down

0 comments on commit d05eef2

Please sign in to comment.