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
be74ad62
Commit
be74ad62
authored
6 years ago
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
round the losses to 12 digits to make them equal
Then equal losses will be sorted on x-coordinates.
parent
c589a2f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!135
test all the different loss functions in each test
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner/learner1D.py
+7
-2
7 additions, 2 deletions
adaptive/learner/learner1D.py
with
7 additions
and
2 deletions
adaptive/learner/learner1D.py
+
7
−
2
View file @
be74ad62
...
...
@@ -563,8 +563,13 @@ class Learner1D(BaseLearner):
def
finite_loss
(
loss
,
xs
):
# If the loss is infinite we return the
# distance between the two points.
return
(
loss
if
not
math
.
isinf
(
loss
)
else
(
xs
[
1
]
-
xs
[
0
])
/
self
.
_scale
[
0
])
if
math
.
isinf
(
loss
):
loss
=
(
xs
[
1
]
-
xs
[
0
])
/
self
.
_scale
[
0
]
# We round the loss to 12 digits such that losses
# are equal up to numerical precision will be considered
# equal.
return
round
(
loss
,
ndigits
=
12
)
quals
=
[(
-
finite_loss
(
loss
,
x
),
x
,
1
)
for
x
,
loss
in
self
.
losses_combined
.
items
()]
...
...
This diff is collapsed.
Click to expand it.
Jorn Hoofwijk
@Jorn
mentioned in merge request
!139 (merged)
·
6 years ago
mentioned in merge request
!139 (merged)
mentioned in merge request !139
Toggle commit list
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