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
aa595a6a
Commit
aa595a6a
authored
4 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Fix bugs in fixed burnin
parent
c39f657f
No related branches found
No related tags found
1 merge request
!842
Add a mean-log-likelihood method to improve the ACT estimation
Pipeline
#160678
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bilby/core/sampler/ptemcee.py
+9
-9
9 additions, 9 deletions
bilby/core/sampler/ptemcee.py
with
9 additions
and
9 deletions
bilby/core/sampler/ptemcee.py
+
9
−
9
View file @
aa595a6a
...
...
@@ -648,8 +648,8 @@ def check_iteration(
nwalkers
,
nsteps
,
ndim
=
samples
.
shape
# Compute ACT tau for 0-temperature chains
tau_array
=
np
.
zeros
((
nwalkers
,
ndim
))
if
nsteps
>
ci
.
burn_in_fixed_discard
:
tau_array
=
np
.
zeros
((
nwalkers
,
ndim
))
for
ii
in
range
(
nwalkers
):
for
jj
,
key
in
enumerate
(
search_parameter_keys
):
if
ci
.
ignore_keys_for_tau
and
ci
.
ignore_keys_for_tau
in
key
:
...
...
@@ -662,7 +662,7 @@ def check_iteration(
except
emcee
.
autocorr
.
AutocorrError
:
tau_array
[
ii
,
jj
]
=
np
.
inf
else
:
tau_array
=
np
.
ones
((
nwalkers
,
ndim
))
*
np
.
inf
tau_array
+
=
np
.
inf
# Maximum over parameters, mean over walkers
tau
=
np
.
max
(
np
.
mean
(
tau_array
,
axis
=
0
))
...
...
@@ -678,16 +678,16 @@ def check_iteration(
Q
=
get_Q_convergence
(
samples
)
Q_list
.
append
(
Q
)
# Convert to an integer
tau_int
=
int
(
np
.
ceil
(
tau
))
if
not
np
.
isnan
(
tau
)
else
tau
if
np
.
isnan
(
tau_int
)
or
np
.
isinf
(
tau_int
):
if
np
.
isnan
(
tau
)
or
np
.
isinf
(
tau
):
print_progress
(
iteration
,
sampler
,
time_per_check
,
np
.
nan
,
np
.
nan
,
np
.
nan
,
np
.
nan
,
False
,
convergence_inputs
,
np
.
nan
,
np
.
nan
,
False
,
convergence_inputs
,
np
.
nan
,
)
return
False
,
np
.
nan
,
np
.
nan
,
np
.
nan
,
np
.
nan
# Convert to an integer
tau_int
=
int
(
np
.
ceil
(
tau
))
# Calculate the effective number of samples available
nburn
=
ci
.
burn_in_fixed_discard
+
int
(
ci
.
burn_in_nact
*
tau_int
)
thin
=
int
(
np
.
max
([
1
,
ci
.
thin_by_nact
*
tau_int
]))
...
...
@@ -890,8 +890,8 @@ def plot_walkers(walkers, nburn, thin, parameter_labels, outdir, label,
for
i
,
(
ax
,
axh
)
in
enumerate
(
axes
):
ax
.
plot
(
idxs
[:
nburn_fixed
],
walkers
[:,
:
nburn
,
i
].
T
,
color
=
"
k
"
,
walkers
[:,
:
nburn
_fixed
,
i
].
T
,
color
=
"
gray
"
,
**
scatter_kwargs
)
...
...
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