Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container Registry
Model registry
Operate
Environments
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
lscsoft
bilby
Commits
57781941
Commit
57781941
authored
6 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Allow prob to take in kwargs which are passed to product
parent
d4c24a07
No related branches found
No related tags found
1 merge request
!248
Allow prob to take in kwargs which are passed to product
Pipeline
#34808
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bilby/core/prior.py
+4
-2
4 additions, 2 deletions
bilby/core/prior.py
with
4 additions
and
2 deletions
bilby/core/prior.py
+
4
−
2
View file @
57781941
...
...
@@ -187,20 +187,22 @@ class PriorSet(OrderedDict):
logger
.
debug
(
'
{} not a known prior.
'
.
format
(
key
))
return
samples
def
prob
(
self
,
sample
):
def
prob
(
self
,
sample
,
**
kwargs
):
"""
Parameters
----------
sample: dict
Dictionary of the samples of which we want to have the probability of
kwargs:
The keyword arguments are passed directly to `np.product`
Returns
-------
float: Joint probability of all individual sample probabilities
"""
return
np
.
product
([
self
[
key
].
prob
(
sample
[
key
])
for
key
in
sample
])
return
np
.
product
([
self
[
key
].
prob
(
sample
[
key
])
for
key
in
sample
]
,
**
kwargs
)
def
ln_prob
(
self
,
sample
):
"""
...
...
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