Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris Jewell
covid19uk
Commits
bd11eeec
Commit
bd11eeec
authored
Dec 09, 2020
by
Chris Jewell
Browse files
Correction to summary.py
parent
e0f5eb59
Changes
1
Hide whitespace changes
Inline
Side-by-side
summary.py
View file @
bd11eeec
...
...
@@ -36,7 +36,7 @@ def calc_R_it(param, events, init_state, covar_data, priors):
"""
def
r_fn
(
args
):
beta1_
,
beta2_
,
beta
_
3
,
sigma_
,
xi_
,
gamma0_
,
events_
=
args
beta1_
,
beta2_
,
beta3
_
,
sigma_
,
xi_
,
gamma0_
,
events_
=
args
t
=
events_
.
shape
[
-
2
]
-
1
state
=
compute_state
(
init_state
,
events_
,
model_spec
.
STOICHIOMETRY
)
state
=
tf
.
gather
(
state
,
t
,
axis
=-
2
)
# State on final inference day
...
...
@@ -60,10 +60,10 @@ def calc_R_it(param, events, init_state, covar_data, priors):
par
=
dict
(
beta1
=
beta1_
,
beta2
=
beta2_
,
beta3
=
tf
.
concat
([
beta_3
,
[
0.0
]],
axis
=-
1
)
,
beta3
=
beta3_
,
sigma
=
sigma_
,
gamma0
=
gamma0_
,
xi
=
xi_
,
# tf.reshape(xi_pred.sample(), [1]),
xi
=
xi_
[:
-
1
]
,
# tf.reshape(xi_pred.sample(), [1]),
)
print
(
"xi shape:"
,
par
[
"xi"
].
shape
)
ngm_fn
=
model_spec
.
next_generation_matrix_fn
(
covar_data
,
par
)
...
...
@@ -104,10 +104,10 @@ def predicted_incidence(param, init_state, init_step, num_steps, priors):
par
=
dict
(
beta1
=
beta1_
,
beta2
=
beta2_
,
beta3
=
tf
.
concat
([
beta3_
,
[
0.0
]],
axis
=-
1
)
,
beta3
=
beta3_
,
gamma0
=
gamma0_
,
gamma1
=
gamma1_
,
xi
=
xi_
,
xi
=
xi_
[:
-
1
]
,
)
model
=
model_spec
.
CovidUK
(
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment