Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyFstat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gregory Ashton
PyFstat
Commits
5f1ea2d2
Commit
5f1ea2d2
authored
Nov 21, 2017
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Improvements to estimated run time
parent
e660f2f0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/semi_coherent_search_using_MCMC.py
+2
-2
2 additions, 2 deletions
examples/semi_coherent_search_using_MCMC.py
pyfstat/mcmc_based_searches.py
+22
-5
22 additions, 5 deletions
pyfstat/mcmc_based_searches.py
with
24 additions
and
7 deletions
examples/semi_coherent_search_using_MCMC.py
+
2
−
2
View file @
5f1ea2d2
...
@@ -17,7 +17,7 @@ tref = .5*(tstart+tend)
...
@@ -17,7 +17,7 @@ tref = .5*(tstart+tend)
depth
=
10
depth
=
10
h0
=
sqrtSX
/
depth
h0
=
sqrtSX
/
depth
label
=
'
semi
_
coherent_search_using_MCMC
'
label
=
'
semicoherent_search_using_MCMC
'
outdir
=
'
data
'
outdir
=
'
data
'
data
=
pyfstat
.
Writer
(
data
=
pyfstat
.
Writer
(
...
@@ -53,7 +53,7 @@ nwalkers = 100
...
@@ -53,7 +53,7 @@ nwalkers = 100
nsteps
=
[
300
,
300
]
nsteps
=
[
300
,
300
]
mcmc
=
pyfstat
.
MCMCSemiCoherentSearch
(
mcmc
=
pyfstat
.
MCMCSemiCoherentSearch
(
label
=
label
,
outdir
=
outdir
,
nsegs
=
3
,
label
=
label
,
outdir
=
outdir
,
nsegs
=
10
,
sftfilepattern
=
'
{}/*{}*sft
'
.
format
(
outdir
,
label
),
sftfilepattern
=
'
{}/*{}*sft
'
.
format
(
outdir
,
label
),
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
theta_prior
=
theta_prior
,
tref
=
tref
,
minStartTime
=
tstart
,
maxStartTime
=
tend
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
nsteps
=
nsteps
,
nwalkers
=
nwalkers
,
ntemps
=
ntemps
,
...
...
This diff is collapsed.
Click to expand it.
pyfstat/mcmc_based_searches.py
+
22
−
5
View file @
5f1ea2d2
...
@@ -416,14 +416,30 @@ class MCMCSearch(core.BaseSearchClass):
...
@@ -416,14 +416,30 @@ class MCMCSearch(core.BaseSearchClass):
tau0S
=
7.3e-5
tau0S
=
7.3e-5
tau0LD
=
4.2e-7
tau0LD
=
4.2e-7
else
:
else
:
tau0S
=
5.0e-5
tau0LD
=
6.2e-8
tau0LD
=
6.2e-8
tau0T
=
1.5e-8
tau0S
=
5.0e-5
tau0C
=
5.6e-6
Nsfts
=
(
self
.
maxStartTime
-
self
.
minStartTime
)
/
1800.
Nsfts
=
(
self
.
maxStartTime
-
self
.
minStartTime
)
/
1800.
if
hasattr
(
self
,
'
run_setup
'
):
ts
=
[]
for
row
in
self
.
run_setup
:
nsteps
=
row
[
0
]
nsegs
=
row
[
1
]
numb_evals
=
np
.
sum
(
nsteps
)
*
self
.
nwalkers
*
self
.
ntemps
t
=
(
tau0S
+
tau0LD
*
Nsfts
)
*
numb_evals
if
nsegs
>
1
:
t
+=
(
tau0C
+
tau0T
*
Nsfts
)
*
nsegs
*
numb_evals
ts
.
append
(
t
)
time
=
np
.
sum
(
ts
)
else
:
numb_evals
=
np
.
sum
(
self
.
nsteps
)
*
self
.
nwalkers
*
self
.
ntemps
numb_evals
=
np
.
sum
(
self
.
nsteps
)
*
self
.
nwalkers
*
self
.
ntemps
a
=
tau0S
*
numb_evals
time
=
(
tau0S
+
tau0LD
*
Nsfts
)
*
numb_evals
b
=
tau0LD
*
Nsfts
*
numb_evals
if
getattr
(
self
,
'
nsegs
'
,
1
)
>
1
:
time
+=
(
tau0C
+
tau0T
*
Nsfts
)
*
self
.
nsegs
*
numb_evals
logging
.
info
(
'
Estimated run-time = {} s = {:1.0f}:{:1.0f} m
'
.
format
(
logging
.
info
(
'
Estimated run-time = {} s = {:1.0f}:{:1.0f} m
'
.
format
(
a
+
b
,
*
divmod
(
a
+
b
,
60
)))
time
,
*
divmod
(
time
,
60
)))
def
run
(
self
,
proposal_scale_factor
=
2
,
create_plots
=
True
,
window
=
50
,
def
run
(
self
,
proposal_scale_factor
=
2
,
create_plots
=
True
,
window
=
50
,
**
kwargs
):
**
kwargs
):
...
@@ -2053,6 +2069,7 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
...
@@ -2053,6 +2069,7 @@ class MCMCFollowUpSearch(MCMCSemiCoherentSearch):
run_setup
,
NstarMax
=
NstarMax
,
Nsegs0
=
Nsegs0
,
log_table
=
log_table
,
run_setup
,
NstarMax
=
NstarMax
,
Nsegs0
=
Nsegs0
,
log_table
=
log_table
,
gen_tex_table
=
gen_tex_table
)
gen_tex_table
=
gen_tex_table
)
self
.
run_setup
=
run_setup
self
.
run_setup
=
run_setup
self
.
_estimate_run_time
()
self
.
old_data_is_okay_to_use
=
self
.
_check_old_data_is_okay_to_use
()
self
.
old_data_is_okay_to_use
=
self
.
_check_old_data_is_okay_to_use
()
if
self
.
old_data_is_okay_to_use
is
True
:
if
self
.
old_data_is_okay_to_use
is
True
:
...
...
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