Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
adaptive-paper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Show more breadcrumbs
Quantum Tinkerer
adaptive-paper
Commits
0d7a9aa8
Commit
0d7a9aa8
authored
5 years ago
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
use np instead of numpy
parent
3511b945
No related branches found
No related tags found
No related merge requests found
Pipeline
#21720
passed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
paper.md
+3
-3
3 additions, 3 deletions
paper.md
with
3 additions
and
3 deletions
paper.md
+
3
−
3
View file @
0d7a9aa8
...
...
@@ -294,7 +294,7 @@ To change the loss function for the `Learner1D` we pass a loss function, like
def
distance_loss
(
xs
,
ys
):
# used by default
dx
=
xs
[
1
]
-
xs
[
0
]
dy
=
ys
[
1
]
-
ys
[
0
]
return
n
umpy
.
hypot
(
dx
,
dy
)
return
n
p
.
hypot
(
dx
,
dy
)
learner
=
Learner1D
(
peak
,
bounds
=
(
-
1
,
1
),
loss_per_interval
=
distance_loss
)
```
...
...
@@ -314,7 +314,7 @@ from adaptive import LearnerND
def
ring
(
xy
):
# pretend this is a slow function
x
,
y
=
xy
a
=
0.2
return
x
+
n
umpy
.
exp
(
-
(
x
**
2
+
y
**
2
-
0.75
**
2
)
**
2
/
a
**
4
)
return
x
+
n
p
.
exp
(
-
(
x
**
2
+
y
**
2
-
0.75
**
2
)
**
2
/
a
**
4
)
learner
=
adaptive
.
LearnerND
(
ring
,
bounds
=
[(
-
1
,
1
),
(
-
1
,
1
)])
runner
=
Runner
(
learner
,
goal
)
...
...
@@ -326,7 +326,7 @@ For example, the loss function used to find the iso-line in Fig. @fig:isoline (b
from
adaptive.learner.learnerND
import
default_loss
def
gaussian
(
x
,
mu
,
sigma
):
return
np
.
exp
(
-
(
x
-
mu
)
**
2
/
sigma
**
2
/
2
)
return
np
.
exp
(
-
(
x
-
mu
)
**
2
/
sigma
**
2
/
2
)
def
isoline_loss_function
(
level
,
sigma
,
priority
):
def
loss
(
simplex
,
values
,
value_scale
):
...
...
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