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
3684a0d0
Commit
3684a0d0
authored
5 years ago
by
Moritz Huebner
Browse files
Options
Downloads
Patches
Plain Diff
Fix dynesty state plotting
parent
4b38827b
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
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
bilby/core/sampler/dynesty.py
+16
-6
16 additions, 6 deletions
bilby/core/sampler/dynesty.py
with
18 additions
and
6 deletions
CHANGELOG.md
+
2
−
0
View file @
3684a0d0
...
@@ -11,6 +11,8 @@ This breaks backward compatibility.
...
@@ -11,6 +11,8 @@ This breaks backward compatibility.
The options to
`boundary`
are
`{'periodic', 'reflective', None}`
.
The options to
`boundary`
are
`{'periodic', 'reflective', None}`
.
Periodic boundaries are supported as before.
Periodic boundaries are supported as before.
Reflective boundaries are supported in
`dynesty`
and
`cpnest`
.
Reflective boundaries are supported in
`dynesty`
and
`cpnest`
.
-
Added state plotting for dynesty. Use
`check_point_plot=True`
in the
`run_sampler`
function to create trace plots during the dynesty checkpoints
### Removed
### Removed
-
-
...
...
This diff is collapsed.
Click to expand it.
bilby/core/sampler/dynesty.py
+
16
−
6
View file @
3684a0d0
...
@@ -5,6 +5,7 @@ import sys
...
@@ -5,6 +5,7 @@ import sys
import
pickle
import
pickle
import
signal
import
signal
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
numpy
as
np
from
pandas
import
DataFrame
from
pandas
import
DataFrame
...
@@ -89,7 +90,7 @@ class Dynesty(NestedSampler):
...
@@ -89,7 +90,7 @@ class Dynesty(NestedSampler):
def
__init__
(
self
,
likelihood
,
priors
,
outdir
=
'
outdir
'
,
label
=
'
label
'
,
def
__init__
(
self
,
likelihood
,
priors
,
outdir
=
'
outdir
'
,
label
=
'
label
'
,
use_ratio
=
False
,
plot
=
False
,
skip_import_verification
=
False
,
use_ratio
=
False
,
plot
=
False
,
skip_import_verification
=
False
,
check_point
=
True
,
check_point_plot
=
Fals
e
,
n_check_point
=
None
,
check_point
=
True
,
check_point_plot
=
Tru
e
,
n_check_point
=
None
,
check_point_delta_t
=
600
,
resume
=
True
,
**
kwargs
):
check_point_delta_t
=
600
,
resume
=
True
,
**
kwargs
):
NestedSampler
.
__init__
(
self
,
likelihood
=
likelihood
,
priors
=
priors
,
NestedSampler
.
__init__
(
self
,
likelihood
=
likelihood
,
priors
=
priors
,
outdir
=
outdir
,
label
=
label
,
use_ratio
=
use_ratio
,
outdir
=
outdir
,
label
=
label
,
use_ratio
=
use_ratio
,
...
@@ -397,11 +398,20 @@ class Dynesty(NestedSampler):
...
@@ -397,11 +398,20 @@ class Dynesty(NestedSampler):
if
plot
and
self
.
check_point_plot
:
if
plot
and
self
.
check_point_plot
:
import
dynesty.plotting
as
dyplot
import
dynesty.plotting
as
dyplot
labels
=
self
.
search_parameter_keys
labels
=
[
label
.
replace
(
'
_
'
,
'
'
)
for
label
in
self
.
search_parameter_keys
]
fn
=
"
{}/{}_checkpoint_trace.png
"
.
format
(
self
.
outdir
,
self
.
label
)
filename
=
"
{}/{}_checkpoint_trace.png
"
.
format
(
self
.
outdir
,
self
.
label
)
fig
=
dyplot
.
traceplot
(
self
.
sampler
.
results
,
labels
=
labels
)[
0
]
try
:
fig
.
tight_layout
()
truths
=
None
fig
.
savefig
(
fn
)
if
self
.
injection_parameters
is
not
None
:
truths
=
[
self
.
injection_parameters
[
key
]
for
key
in
self
.
search_parameter_keys
]
fig
=
dyplot
.
traceplot
(
self
.
sampler
.
results
,
labels
=
labels
,
truths
=
truths
)[
0
]
fig
.
tight_layout
()
fig
.
savefig
(
filename
)
plt
.
close
(
'
all
'
)
except
(
RuntimeError
,
np
.
linalg
.
linalg
.
LinAlgError
)
as
e
:
logger
.
warning
(
e
)
logger
.
warning
(
'
Failed to create dynesty state plot at checkpoint
'
)
def
generate_trace_plots
(
self
,
dynesty_results
):
def
generate_trace_plots
(
self
,
dynesty_results
):
check_directory_exists_and_if_not_mkdir
(
self
.
outdir
)
check_directory_exists_and_if_not_mkdir
(
self
.
outdir
)
...
...
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