From 1307a8bed92d28f7864c781538185196d42d833c Mon Sep 17 00:00:00 2001 From: Peter Fackeldey Date: Wed, 20 Mar 2024 10:23:01 +0100 Subject: [PATCH] update README.md; hide compiletime stress test --- .gitignore | 2 +- README.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a6d4b7d..5d663aa 100644 --- a/.gitignore +++ b/.gitignore @@ -167,7 +167,7 @@ plots_analysis_opt/ # presentation code snippets examples/presentation_snippets.py -# compiletime stress test +# compile time stress test examples/compiletime.py test/ diff --git a/README.md b/README.md index 498cca4..384f84b 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ jax.config.update("jax_enable_x64", True) # define a simple model with two processes and two parameters class Model(eqx.Module): - mu: evm.Parameter - syst: evm.Parameter + mu: evm.FreeFloating + syst: evm.NormalConstrained def __call__(self, hists: dict[str, Array]) -> Array: mu_modifier = self.mu.unconstrained() @@ -61,7 +61,7 @@ def loss(model: Model, hists: dict[str, Array], observation: Array) -> Array: # Poisson NLL of the expectation and observation log_likelihood = nll(expectation, observation) # Add parameter constraints from logpdfs - constraints = evm.loss.get_param_constraints(model) + constraints = evm.loss.get_logpdf_constraints(model) log_likelihood += evm.util.sum_leaves(constraints) return -jnp.sum(log_likelihood) @@ -69,7 +69,7 @@ def loss(model: Model, hists: dict[str, Array], observation: Array) -> Array: # setup model and data hists = {"signal": jnp.array([3]), "bkg": jnp.array([10])} observation = jnp.array([15]) -model = Model(mu=evm.Parameter(1.0), syst=evm.Parameter(0.0)) +model = Model(mu=evm.FreeFloating(), syst=evm.NormalConstrained()) # negative log-likelihood loss_val = loss(model, hists, observation)