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
bf0107b1
Commit
bf0107b1
authored
7 years ago
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
2D: remove dtype argument from __init__, fix it to float
parent
1569fecf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
implement 2D learner
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner.py
+2
-4
2 additions, 4 deletions
adaptive/learner.py
with
2 additions
and
4 deletions
adaptive/learner.py
+
2
−
4
View file @
bf0107b1
...
...
@@ -582,8 +582,6 @@ class Learner2D(BaseLearner):
bounds : list of 2-tuples
A list ``[(a1, b1), (a2, b2)]`` containing bounds,
one per dimension.
dtype : dtype, optional
Type of data from function. Default: float (real-valued)
Attributes
----------
...
...
@@ -614,14 +612,14 @@ class Learner2D(BaseLearner):
it, your function needs to be slow enough to compute.
"""
def
__init__
(
self
,
function
,
bounds
,
dtype
=
float
):
def
__init__
(
self
,
function
,
bounds
):
self
.
function
=
function
self
.
ndim
=
len
(
bounds
)
if
self
.
ndim
!=
2
:
raise
ValueError
(
"
Only 2-D sampling supported.
"
)
self
.
bounds
=
tuple
([(
float
(
a
),
float
(
b
))
for
a
,
b
in
bounds
])
self
.
_points
=
np
.
zeros
([
100
,
self
.
ndim
])
self
.
_values
=
np
.
zeros
([
100
],
dtype
)
self
.
_values
=
np
.
zeros
([
100
],
dtype
=
float
)
self
.
n
=
0
self
.
nstack
=
10
self
.
_stack
=
[]
...
...
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