Skip to content

Commit

Permalink
s/logprob/logdensity
Browse files Browse the repository at this point in the history
The library currently uses `logprob` to designate the target model's
joint log-density. We adopt the mathematical terminology instead and
replace `logprob` with `logdensity`.
  • Loading branch information
junpenglao authored and rlouf committed Dec 22, 2022
1 parent cc5d3f5 commit 19485f4
Show file tree
Hide file tree
Showing 44 changed files with 326 additions and 317 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ import numpy as np
import blackjax

observed = np.random.normal(10, 20, size=1_000)
def logprob_fn(x):
def logdensity_fn(x):
logpdf = stats.norm.logpdf(observed, x["loc"], x["scale"])
return jnp.sum(logpdf)

# Build the kernel
step_size = 1e-3
inverse_mass_matrix = jnp.array([1., 1.])
nuts = blackjax.nuts(logprob_fn, step_size, inverse_mass_matrix)
nuts = blackjax.nuts(logdensity_fn, step_size, inverse_mass_matrix)

# Initialize the state
initial_position = {"loc": 1., "scale": 2.}
Expand Down
Loading

0 comments on commit 19485f4

Please sign in to comment.