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
8a44d2b3
Commit
8a44d2b3
authored
6 years ago
by
Jorn Hoofwijk
Browse files
Options
Downloads
Patches
Plain Diff
raise assertionerror if we cannot find an existing simplex
parent
236d1d6d
No related branches found
No related tags found
1 merge request
!88
refactor LearnerND._ask to be more readable (and faster)
Pipeline
#11584
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner/learnerND.py
+8
-1
8 additions, 1 deletion
adaptive/learner/learnerND.py
with
8 additions
and
1 deletion
adaptive/learner/learnerND.py
+
8
−
1
View file @
8a44d2b3
...
...
@@ -336,7 +336,7 @@ class LearnerND(BaseLearner):
def
_pop_highest_existing_simplex
(
self
):
# find the simplex with the highest loss, we do need to check that the
# simplex hasn't been deleted yet
while
True
:
while
len
(
self
.
_losses_combined
)
:
loss
,
simplex
,
subsimplex
=
heapq
.
heappop
(
self
.
_losses_combined
)
if
(
subsimplex
is
None
and
simplex
in
self
.
tri
.
simplices
...
...
@@ -347,6 +347,13 @@ class LearnerND(BaseLearner):
and
subsimplex
in
self
.
_subtriangulations
[
simplex
].
simplices
):
return
abs
(
loss
),
simplex
,
subsimplex
# Could not find a simplex, this code should never be reached
assert
self
.
tri
is
not
None
raise
AssertionError
(
"""
Could not find a simplex to. Yet there should always be a simplex
available if LearnerND.tri() is not None
"""
)
def
_ask_best_point
(
self
):
assert
self
.
tri
is
not
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