Skip to content

Commit

Permalink
add bounds for parameter in toy example (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixzinn authored Nov 15, 2024
1 parent dc59716 commit 5faecff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/toy_generation.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import equinox as eqx
import jax
import jax.numpy as jnp
from jaxtyping import Array, PRNGKeyArray
from model import hists, model, observation

import evermore as evm

key = jax.random.PRNGKey(0)

# set lower and upper bounds for the mu parameter
model = eqx.tree_at(lambda t: t.mu.lower, model, jnp.array([0.0]))
model = eqx.tree_at(lambda t: t.mu.upper, model, jnp.array([10.0]))

# generate a new model with sampled parameters according to their constraint pdfs
toymodel = evm.parameter.sample(model, key)

Expand Down

0 comments on commit 5faecff

Please sign in to comment.