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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
Quantum Tinkerer
adaptive
Commits
955d4048
Commit
955d4048
authored
Aug 18, 2017
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
fix bug with doubling of scales
parent
c395daf0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner.py
+6
-7
6 additions, 7 deletions
adaptive/learner.py
with
6 additions
and
7 deletions
adaptive/learner.py
+
6
−
7
View file @
955d4048
...
...
@@ -145,8 +145,7 @@ class Learner1D(BaseLearner):
if
self
.
_scale
[
1
]
==
0
:
return
np
.
inf
else
:
return
sqrt
(((
x_right
-
x_left
)
/
self
.
_scale
[
0
])
**
2
+
((
y_right
-
y_left
)
/
self
.
_scale
[
1
])
**
2
)
return
sqrt
(((
x_right
-
x_left
))
**
2
+
((
y_right
-
y_left
))
**
2
)
def
loss
(
self
,
real
=
True
):
losses
=
self
.
real_losses
if
real
else
self
.
losses
...
...
@@ -200,9 +199,9 @@ class Learner1D(BaseLearner):
# Can only happen when `real`.
if
real
:
if
self
.
_scale
>
self
.
_oldscale
*
2
:
self
.
real_losses
=
{
key
:
self
.
interval_loss
(
*
key
,
real
)
self
.
real_losses
=
{
key
:
self
.
interval_loss
(
*
key
,
real
=
True
)
for
key
in
self
.
real_losses
}
self
.
losses
=
{
key
:
self
.
interval_loss
(
*
key
,
real
)
self
.
losses
=
{
key
:
self
.
interval_loss
(
*
key
,
real
=
False
)
for
key
in
self
.
losses
}
self
.
_oldscale
=
self
.
_scale
...
...
@@ -249,8 +248,8 @@ class Learner1D(BaseLearner):
def
remove_unfinished
(
self
):
super
().
remove_unfinished
()
self
.
losses
=
self
.
real_losses
self
.
neighbors
=
self
.
real_neighbors
#
self.losses = self.real_losses
#
self.neighbors = self.real_neighbors
# Update the scale.
self
.
_bbox
[
0
][
0
]
=
min
(
self
.
data
.
keys
())
...
...
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