Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rayne Liu
RDStackingProject
Commits
01ee3baa
Commit
01ee3baa
authored
Oct 03, 2020
by
Rayne Liu
Browse files
Use 1 core first
parent
bea8ee52
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/NR_Interpolate-0001_t_10M.py
View file @
01ee3baa
...
...
@@ -33,18 +33,18 @@ import random
#tshift: time shift after the strain peak
#vary_fund: whether you vary the fundamental frequency. Works in the model_dv function.
rootpath
=
"/
Users/R
ayne
L
iu/git/rdstackingproject"
#"/
work/r
ayne
.l
iu/git/rdstackingproject"
rootpath
=
"/
work/r
ayne
.l
iu/git/rdstackingproject"
#"/
Users/R
ayne
L
iu/git/rdstackingproject"
nmax
=
1
tshift
=
10
vary_fund
=
True
#sampler parameters
npoints
=
10
0
nwalkers
=
5
0
npoints
=
10
nwalkers
=
2
0
ntemps
=
16
dim
=
nmax
+
1
ndim
=
4
*
dim
burnin
=
5
0
#How many points do you burn before doing the corner plot. You need to watch the convergence of the chain plot a bit.
burnin
=
5
#How many points do you burn before doing the corner plot. You need to watch the convergence of the chain plot a bit.
#This is trivial but often forgotten: this cannot be more than npoints! I usually use half the points.
numbins
=
42
#corner plot parameter - how many bins you want
datacolor
=
'#105670'
#'#4fa3a7'
...
...
@@ -204,10 +204,10 @@ def log_probability(theta):
#This cell uses the tshift=10 results
#Set the number of cores of your processors
pool
=
choose_pool
(
8
)
pool
.
size
=
8
pool
=
choose_pool
(
1
)
pool
.
size
=
1
np
.
random
.
seed
(
42
)
pos
=
np
.
array
([
random
.
uniform
(
-
0.0
5
,
0.0
5
),
random
.
uniform
(
-
0.
25
,
-
0.15
),
random
.
uniform
(
0.
,
0.8
),
random
.
uniform
(
0.
5
,
1.
),
random
.
uniform
(
0.4
,
0.8
),
random
.
uniform
(
0.5
,
1.
),
random
.
uniform
(
0.5
,
0.6
),
random
.
uniform
(
0.5
,
0.6
)])
pos
=
np
.
array
([
random
.
uniform
(
-
0.0
2
,
0.0
2
),
random
.
uniform
(
-
0.
1
,
0.15
),
random
.
uniform
(
-
0.
2
.
,
0.
0
8
),
random
.
uniform
(
0.
,
1.
),
random
.
uniform
(
0.4
,
0.8
),
random
.
uniform
(
0.5
,
1.
),
random
.
uniform
(
0.5
,
0.6
),
random
.
uniform
(
0.5
,
0.6
)])
pos
=
list
(
pos
)
pos
+=
1e-5
*
np
.
random
.
randn
(
ntemps
,
nwalkers
,
ndim
)
sampler
=
ptemcee
.
Sampler
(
nwalkers
,
ndim
,
log_likelihood
,
log_prior
,
ntemps
=
ntemps
,
pool
=
pool
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment