Skip to content

Commit

Permalink
replace sphinx, cover pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasplagwitz committed Sep 1, 2020
1 parent e535d02 commit a30bddf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
import warnings
import os
import re
import matplotlib
matplotlib.use('Agg')
import sphinx_gallery
from packaging.version import parse
# import pkg_resources
import sys
import skopt

sys.path.insert(0, os.path.abspath('sphinxext'))
from github_link import make_linkcode_resolve
import matplotlib
matplotlib.use('Agg')
import sphinx_gallery

# __version__ = pkg_resources.get_distribution('skopt').version
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand Down
3 changes: 2 additions & 1 deletion examples/exploration-vs-exploitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

noise_level = 0.1


# Our 1D toy problem, this is the function we are trying to
# minimize
def objective(x, noise_level=noise_level):
Expand All @@ -61,7 +62,7 @@ def objective_wo_noise(x):

#############################################################################

opt = Optimizer([(-2.0, 2.0)], "GP", n_initial_points = 3,
opt = Optimizer([(-2.0, 2.0)], "GP", n_initial_points=3,
acq_optimizer="sampling")

#############################################################################
Expand Down
32 changes: 16 additions & 16 deletions examples/interruptible-optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def obj_fun(x, noise_level=noise_level):

checkpoint_saver = CheckpointSaver("./checkpoint.pkl", compress=9) # keyword arguments will be passed to `skopt.dump`

gp_minimize(obj_fun, # the function to minimize
[(-20.0, 20.0)], # the bounds on each dimension of x
x0=[-20.], # the starting point
acq_func="LCB", # the acquisition function (optional)
n_calls=10, # the number of evaluations of f including at x0
n_random_starts=3, # the number of random initialization points
callback=[checkpoint_saver], # a list of callbacks including the checkpoint saver
random_state=777);
gp_minimize(obj_fun, # the function to minimize
[(-20.0, 20.0)], # the bounds on each dimension of x
x0=[-20.], # the starting point
acq_func="LCB", # the acquisition function (optional)
n_calls=10, # the number of evaluations of f including at x0
n_random_starts=3, # the number of random initial points
callback=[checkpoint_saver], # a list of callbacks including the checkpoint saver
random_state=777);

#############################################################################
# Now let's assume this did not finish at once but took some long time: you
Expand Down Expand Up @@ -107,14 +107,14 @@ def obj_fun(x, noise_level=noise_level):
y0 = res.func_vals

gp_minimize(obj_fun, # the function to minimize
[(-20.0, 20.0)], # the bounds on each dimension of x
x0=x0, # already examined values for x
y0=y0, # observed values for x0
acq_func="LCB", # the acquisition function (optional)
n_calls=10, # the number of evaluations of f including at x0
n_random_starts=3, # the number of random initialization points
callback=[checkpoint_saver],
random_state=777);
[(-20.0, 20.0)], # the bounds on each dimension of x
x0=x0, # already examined values for x
y0=y0, # observed values for x0
acq_func="LCB", # the acquisition function (optional)
n_calls=10, # the number of evaluations of f including at x0
n_random_starts=3, # the number of random initialization points
callback=[checkpoint_saver],
random_state=777);

#############################################################################
# Possible problems
Expand Down
2 changes: 1 addition & 1 deletion examples/store-and-load-results.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def obj_fun(x, noise_level=noise_level):
x0=[0.], # the starting point
acq_func="LCB", # the acquisition function (optional)
n_calls=15, # the number of evaluations of f including at x0
n_random_starts=3, # the number of random initialization points
n_random_starts=3, # the number of random initial points
random_state=777)

#############################################################################
Expand Down

0 comments on commit a30bddf

Please sign in to comment.