Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
adaptive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Quantum Tinkerer
adaptive
Commits
6a1f869e
Commit
6a1f869e
authored
6 years ago
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
SKOptLearner: create 'tell_pending' which deprecates 'tell(x, None)'
parent
a8472d09
No related branches found
No related tags found
No related merge requests found
Pipeline
#12183
failed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner/skopt_learner.py
+11
-6
11 additions, 6 deletions
adaptive/learner/skopt_learner.py
with
11 additions
and
6 deletions
adaptive/learner/skopt_learner.py
+
11
−
6
View file @
6a1f869e
...
...
@@ -27,11 +27,13 @@ class SKOptLearner(Optimizer, BaseLearner):
self
.
function
=
function
super
().
__init__
(
**
kwargs
)
def
tell
(
self
,
x
,
y
,
fit
=
True
):
if
y
is
not
None
:
# 'skopt.Optimizer' takes care of points we
# have not got results for.
super
().
tell
([
x
],
y
,
fit
)
def
tell
(
self
,
x
,
y
,
fit
=
True
):
super
().
tell
([
x
],
y
,
fit
)
def
tell_pending
(
self
,
x
):
# 'skopt.Optimizer' takes care of points we
# have not got results for.
pass
def
remove_unfinished
(
self
):
pass
...
...
@@ -46,7 +48,10 @@ class SKOptLearner(Optimizer, BaseLearner):
# estimator of loss, but it is the cheapest.
return
1
-
model
.
score
(
self
.
Xi
,
self
.
yi
)
def
ask
(
self
,
n
,
add_data
=
True
):
def
ask
(
self
,
n
,
tell_pending
=
True
):
if
not
tell_pending
:
raise
NotImplementedError
(
'
Asking points is an irreversible
'
'
action, so use `ask(n, tell_pending=True`.
'
)
points
=
super
().
ask
(
n
)
# TODO: Choose a better estimate for the loss improvement.
if
self
.
space
.
n_dims
>
1
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment