-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed redundant options in lci.pcmaes call by detecting parameter o…
- Loading branch information
Emmanuel Benazera
committed
Feb 20, 2015
1 parent
5daa2e2
commit 50dfc28
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import lcmaes_interface as lci | ||
|
||
# setup input parameters | ||
myfun = lambda x: sum([xi**2 for xi in x]) # myfun accepts a list of numbers as input | ||
x0 = [2.1] * 10 | ||
sigma0 = 0.1 | ||
mlbounds = [-4]*10 | ||
mubounds = [4]*10 | ||
|
||
# run optimization via lci | ||
res = lci.pcmaes(lci.to_fitfunc(myfun), | ||
lci.to_params(x0, sigma0, | ||
str_algo=b'abipop',quiet=True, # b=bytes, unicode fails | ||
lbounds=mlbounds,ubounds=mubounds, | ||
scaling=False, | ||
restarts=2)) | ||
lci.plot() # plot from file set in lci.to_params |