Skip to content

Commit

Permalink
less changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tnkuehne committed Jan 15, 2025
1 parent 7107d75 commit 03a70d5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions examples/tester.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
from gmab import Gmab, tester, GmabSearchCV
import random

def test_function(number: list) -> float:
return sum([i ** 2 for i in number])

def rosenbrock_function(number: list):
return sum([100 * (number[i + 1] - number[i] ** 2) ** 2 + (1 - number[i]) ** 2 for i in range(len(number) - 1)])

def random_noise_rosenbrock_function(number: list):
return rosenbrock_function(number) + 0.1 * (2 * random.random() - 1)


if __name__ == '__main__':
bounds = [(-5, 10), (-5, 10)]
gmab = Gmab(random_noise_rosenbrock_function, bounds)
gmab = Gmab(rosenbrock_function, bounds)
evaluation_budget = 10000
result = gmab.optimize(evaluation_budget)
print(result)
Expand Down

0 comments on commit 03a70d5

Please sign in to comment.