Skip to content

Commit

Permalink
add comment for why we divide by subsample_size at z_0 log prob
Browse files Browse the repository at this point in the history
  • Loading branch information
fehiepsi committed Jun 30, 2023
1 parent 96a7be4 commit 3450771
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion numpyro/infer/autoguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,8 +1420,11 @@ def base_z_dist_log_prob(z):
/ scale
)

# The log_prob of z_0 will be broadcasted to `subsample_size` because this statement
# is run under the subsample plate. Hence we divide the log_prob by `subsample_size`.
numpyro.factor(
"{}_z_0_factor".format(self.prefix), base_z_dist_log_prob(z_0) / subsample_size
"{}_z_0_factor".format(self.prefix),
base_z_dist_log_prob(z_0) / subsample_size,
)
else:
z_0_loc_init = jnp.zeros((N, D))
Expand Down

0 comments on commit 3450771

Please sign in to comment.