Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Duncan Macleod
gstlal
Commits
fda053ec
Commit
fda053ec
authored
7 years ago
by
Chad Hanna
Browse files
Options
Downloads
Patches
Plain Diff
tree.py: tweak a few things
parent
e86269e8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gstlal-ugly/python/tree.py
+14
-6
14 additions, 6 deletions
gstlal-ugly/python/tree.py
with
14 additions
and
6 deletions
gstlal-ugly/python/tree.py
+
14
−
6
View file @
fda053ec
...
...
@@ -41,8 +41,7 @@ def packing_density(n):
# this packing density puts two in a cell, we split if there are two or
# more expected in a cell
return
1.0
return
0.50
#prefactor = 0.5
#prefactor = 1.
# From: http://mathworld.wolfram.com/HyperspherePacking.html
if
n
==
1
:
return
prefactor
...
...
@@ -86,10 +85,10 @@ class HyperCube(object):
self
.
metric
=
metric
if
self
.
metric
is
not
None
and
metric_tensor
is
None
:
try
:
self
.
metric_tensor
,
self
.
effective_dimension
,
self
.
det
=
self
.
metric
(
self
.
center
-
self
.
deltas
/
1
000
.0
,
self
.
deltas
/
50
000.
)
self
.
metric_tensor
,
self
.
effective_dimension
,
self
.
det
=
self
.
metric
(
self
.
center
-
self
.
deltas
/
1
234
.0
,
self
.
deltas
/
1
000.
)
except
RuntimeError
:
print
"
metric @
"
,
self
.
center
-
self
.
deltas
/
1000.0
,
"
failed, trying,
"
,
self
.
center
-
self
.
deltas
/
10
0.0
self
.
metric_tensor
,
self
.
effective_dimension
,
self
.
det
=
self
.
metric
(
self
.
center
-
self
.
deltas
/
1
00
.0
,
self
.
deltas
/
50
000.
)
print
"
metric @
"
,
self
.
center
-
self
.
deltas
/
1000.0
,
"
failed, trying,
"
,
self
.
center
-
self
.
deltas
/
6
0.0
self
.
metric_tensor
,
self
.
effective_dimension
,
self
.
det
=
self
.
metric
(
self
.
center
-
self
.
deltas
/
1
23
.0
,
self
.
deltas
/
1
000.
)
else
:
self
.
metric_tensor
=
metric_tensor
self
.
effective_dimension
=
effective_dimension
...
...
@@ -236,15 +235,24 @@ class Node(object):
metric_diff
=
self
.
cube
.
metric_tensor
-
self
.
sibling
.
cube
.
metric_tensor
metric_diff
=
numpy
.
linalg
.
norm
(
metric_diff
)
/
numpy
.
linalg
.
norm
(
self
.
cube
.
metric_tensor
)
**
.
5
/
numpy
.
linalg
.
norm
(
self
.
sibling
.
cube
.
metric_tensor
)
**
.
5
#w, v = numpy.linalg.eigh(self.cube.metric_tensor)
#ws, vs = numpy.linalg.eigh(self.sibling.cube.metric_tensor)
#offsets = numpy.arccos([numpy.dot(v[i], vs[j]) for i, j in zip(numpy.argsort(w), numpy.argsort(ws))])
#print "offsets: ", offsets
#metric_diff = max(offsets)
# check that the metric is not varying too much
sib_vratio
=
numtmps
/
sib_numtmps
volume_split_condition
=
(
1.
/
vtol
<
sib_vratio
<
vtol
)
# take the bigger of self, sibling and parent
numtmps
=
max
(
max
(
numtmps
,
par_numtmps
),
sib_numtmps
)
q
=
self
.
cube
.
center
[
1
]
/
self
.
cube
.
center
[
0
]
#q_condition = (1.0 >= q >= 0.95) or (0.54 >= q >= 0.44) or (0.27 >= q >= 0.22) or (0.145 >= q >= 0.105)
metric_tol
=
0.1
if
self
.
cube
.
constraint_func
(
self
.
cube
.
vertices
+
[
self
.
cube
.
center
])
and
(
numtmps
>=
split_num_templates
or
metric_diff
>
metric_tol
):
#if self.cube.constraint_func(self.cube.vertices + [self.cube.center]) and (numtmps >= split_num_templates or ((numtmps >= split_num_templates/2.) and metric_diff > metric_tol)):
if
self
.
cube
.
constraint_func
(
self
.
cube
.
vertices
+
[
self
.
cube
.
center
])
and
(
numtmps
>=
split_num_templates
):
self
.
template_count
[
0
]
=
self
.
template_count
[
0
]
+
1
bifurcation
+=
1
#if numtmps < 5**len(size) and metric_diff < max(mismatch, 0.01):#volume_split_condition:
...
...
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