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
a0c714de
Commit
a0c714de
authored
6 years ago
by
Kipp Cannon
Browse files
Options
Downloads
Patches
Plain Diff
inspiral_lr: fix template_id selection in .random_params()
parent
320fcf6f
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-inspiral/python/stats/inspiral_lr.py
+4
-2
4 additions, 2 deletions
gstlal-inspiral/python/stats/inspiral_lr.py
with
4 additions
and
2 deletions
gstlal-inspiral/python/stats/inspiral_lr.py
+
4
−
2
View file @
a0c714de
...
@@ -765,6 +765,8 @@ class LnNoiseDensity(LnLRDensity):
...
@@ -765,6 +765,8 @@ class LnNoiseDensity(LnLRDensity):
segment
=
segments
.
segment
segment
=
segments
.
segment
twopi
=
2.
*
math
.
pi
twopi
=
2.
*
math
.
pi
ln_1_2
=
math
.
log
(
0.5
)
ln_1_2
=
math
.
log
(
0.5
)
lnP_template_id
=
-
math
.
log
(
len
(
self
.
template_ids
))
template_ids
=
tuple
(
self
.
template_ids
)
def
nCk
(
n
,
k
):
def
nCk
(
n
,
k
):
return
math
.
factorial
(
n
)
//
math
.
factorial
(
k
)
//
math
.
factorial
(
n
-
k
)
return
math
.
factorial
(
n
)
//
math
.
factorial
(
k
)
//
math
.
factorial
(
n
-
k
)
while
1
:
while
1
:
...
@@ -807,7 +809,7 @@ class LnNoiseDensity(LnLRDensity):
...
@@ -807,7 +809,7 @@ class LnNoiseDensity(LnLRDensity):
# FIXME random_params needs to be given a meaningful
# FIXME random_params needs to be given a meaningful
# template_id, but for now it is not used in the
# template_id, but for now it is not used in the
# likelihood-ratio assignment so we don't care
# likelihood-ratio assignment so we don't care
kwargs
[
"
template_id
"
]
=
None
kwargs
[
"
template_id
"
]
=
random
.
choice
(
template_ids
)
# NOTE: I think the result of this sum is, in
# NOTE: I think the result of this sum is, in
# fact, correctly normalized, but nothing requires
# fact, correctly normalized, but nothing requires
# it to be (only that it be correct up to an
# it to be (only that it be correct up to an
...
@@ -815,7 +817,7 @@ class LnNoiseDensity(LnLRDensity):
...
@@ -815,7 +817,7 @@ class LnNoiseDensity(LnLRDensity):
# so the documentation doesn't promise that it is.
# so the documentation doesn't promise that it is.
# FIXME: no, it's not normalized until the dt_dphi
# FIXME: no, it's not normalized until the dt_dphi
# bit is corrected for other than H1L1
# bit is corrected for other than H1L1
yield
(),
kwargs
,
sum
(
seq
[
1
::
2
],
lnP_t
+
lnP_instruments
)
yield
(),
kwargs
,
sum
(
seq
[
1
::
2
],
lnP_t
+
lnP_instruments
+
lnP_template_id
)
def
to_xml
(
self
,
name
):
def
to_xml
(
self
,
name
):
xml
=
super
(
LnNoiseDensity
,
self
).
to_xml
(
name
)
xml
=
super
(
LnNoiseDensity
,
self
).
to_xml
(
name
)
...
...
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