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
3a167400
Commit
3a167400
authored
6 years ago
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
improve readability of 'update_losses'
parent
668b2ace
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!100
Resolve "Learner1D doesn't correctly set the interpolated loss when a point is added"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner/learner1D.py
+5
-3
5 additions, 3 deletions
adaptive/learner/learner1D.py
with
5 additions
and
3 deletions
adaptive/learner/learner1D.py
+
5
−
3
View file @
3a167400
...
...
@@ -170,10 +170,12 @@ class Learner1D(BaseLearner):
losses_combined
[
a
,
x
]
=
(
x
-
a
)
*
loss
/
dx
losses_combined
[
x
,
b
]
=
(
b
-
x
)
*
loss
/
dx
not_real_cond
=
((
not
real
)
and
(
x_left
is
None
or
x_right
is
None
))
if
(
a
is
not
None
)
and
((
real
and
x_left
is
None
)
or
not_real_cond
):
real_left
=
real
and
x_left
is
None
real_right
=
real
and
x_right
is
None
not_real
=
(
not
real
)
and
(
x_left
is
None
or
x_right
is
None
)
if
(
a
is
not
None
)
and
(
real_left
or
not_real
):
losses_combined
[
a
,
x
]
=
float
(
'
inf
'
)
if
(
b
is
not
None
)
and
(
(
real
and
x
_right
is
None
)
or
not_real
_cond
):
if
(
b
is
not
None
)
and
(
real_right
or
not_real
):
losses_combined
[
x
,
b
]
=
float
(
'
inf
'
)
losses_combined
.
pop
((
a
,
b
),
None
)
...
...
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