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
3001751f
Commit
3001751f
authored
7 years ago
by
Chad Hanna
Browse files
Options
Downloads
Patches
Plain Diff
treebank: reuse the metric more often
parent
76b7ce4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gstlal-ugly/bin/gstlal_inspiral_treebank
+1
-1
1 addition, 1 deletion
gstlal-ugly/bin/gstlal_inspiral_treebank
gstlal-ugly/python/tree.py
+9
-9
9 additions, 9 deletions
gstlal-ugly/python/tree.py
with
10 additions
and
10 deletions
gstlal-ugly/bin/gstlal_inspiral_treebank
+
1
−
1
View file @
3001751f
...
...
@@ -245,7 +245,7 @@ for n, c in enumerate(nodes):
row
.
mass1
=
row
.
mass2
row
.
mass2
=
mass1
row
.
process_id
=
process
.
process_id
if
coord_limits
[
0
][
0
]
*
0.9
8
<=
row
.
mass1
<=
coord_limits
[
0
][
1
]
*
1.1
and
coord_limits
[
1
][
0
]
*
0.9
8
<=
row
.
mass2
<=
coord_limits
[
1
][
1
]
*
1.1
and
(
row
.
mass1
+
row
.
mass2
<
args
.
max_mtotal
)
and
(
row
.
mass1
/
row
.
mass2
<
args
.
max_q
):
if
coord_limits
[
0
][
0
]
*
0.9
7
<=
row
.
mass1
<=
coord_limits
[
0
][
1
]
*
1.1
and
coord_limits
[
1
][
0
]
*
0.9
7
<=
row
.
mass2
<=
coord_limits
[
1
][
1
]
*
1.1
and
(
row
.
mass1
+
row
.
mass2
<
args
.
max_mtotal
)
and
(
row
.
mass1
/
row
.
mass2
<
args
.
max_q
):
#if (row.mass1+row.mass2 < args.max_mtotal) and (row.mass1 / row.mass2 < args.max_q):
tbl
.
append
(
row
)
previous_tiles
.
append
(
t
)
...
...
This diff is collapsed.
Click to expand it.
gstlal-ugly/python/tree.py
+
9
−
9
View file @
3001751f
...
...
@@ -68,7 +68,7 @@ def packing_density(n):
# this packing density puts two in a cell, we split if there is more
# than this expected in a cell
# From: http://mathworld.wolfram.com/HyperspherePacking.html
prefactor
=
1.
/
2
**
.
5
prefactor
=
1.
0
if
n
==
1
:
return
prefactor
if
n
==
2
:
...
...
@@ -308,23 +308,23 @@ class Node(object):
numtmps
=
self
.
cube
.
num_templates
(
mismatch
)
#
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
#
metric_diff2 = self.cube.metric_tensor - self.parent.cube.metric_tensor
#
metric_diff2 = numpy.linalg.norm(metric_diff2) / numpy.linalg.norm(self.cube.metric_tensor)**.5 / numpy.linalg.norm(self.parent.cube.metric_tensor)**.5
#
metric_diff = max(metric_diff, metric_diff2)
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
metric_diff2
=
self
.
cube
.
metric_tensor
-
self
.
parent
.
cube
.
metric_tensor
metric_diff2
=
numpy
.
linalg
.
norm
(
metric_diff2
)
/
numpy
.
linalg
.
norm
(
self
.
cube
.
metric_tensor
)
**
.
5
/
numpy
.
linalg
.
norm
(
self
.
parent
.
cube
.
metric_tensor
)
**
.
5
metric_diff
=
max
(
metric_diff
,
metric_diff2
)
#metric_cond = (not self.cube.metric_is_valid) or (metric_diff > metric_tol) or (sib_numtmps + numtmps > (1.0 + metric_tol) * par_numtmps) or (numtmps > (1.0 + metric_tol) * sib_numtmps)
metric_diff
=
max
(
abs
(
self
.
sibling
.
cube
.
eigv
-
self
.
cube
.
eigv
)
/
(
self
.
sibling
.
cube
.
eigv
+
self
.
cube
.
eigv
)
/
2.
)
#
metric_diff = max(abs(self.sibling.cube.eigv - self.cube.eigv) / (self.sibling.cube.eigv + self.cube.eigv) / 2.)
# take the bigger of self, sibling and parent
numtmps
=
max
(
max
(
numtmps
,
par_numtmps
/
2.0
),
sib_numtmps
)
# * aspect_factor
#if self.cube.constraint_func(self.cube.vertices + [self.cube.center]) and ((numtmps >= split_num_templates) or (numtmps >= split_num_templates/2.0 and metric_cond)):
if
self
.
cube
.
constraint_func
(
self
.
cube
.
vertices
+
[
self
.
cube
.
center
])
and
((
numtmps
>=
split_num_templates
)
or
(
False
>
mismatch
and
numtmps
>
split_num_templates
/
2.0
))
or
bifurcation
<
2
:
if
self
.
cube
.
constraint_func
(
self
.
cube
.
vertices
+
[
self
.
cube
.
center
])
and
((
numtmps
>=
split_num_templates
)
or
(
metric_diff
>
0.05
and
numtmps
>
split_num_templates
/
2.0
**
.
5
))
or
bifurcation
<
2
:
bifurcation
+=
1
#if False:# (self.cube.num_templates(0.02) < len(size)**2/2. or numtmps < 2 * split_num_templates) and metric_diff < 0.1:
if
(
numtmps
<
2
**
len
(
size
)
*
self
.
cube
.
num_templates
(
0.003
))
and
metric_diff
<
0.0
03
:
if
metric_diff
<
=
0.0
5
:
#if self.cube.metric_is_valid:# and aspect_factor <= 1.0:
#if not metric_cond:
#if metric_diff <= metric_tol and self.cube.metric_is_valid:# and aspect_factor <= 1.0:
...
...
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