Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 9, 2023
1 parent f9c5ac1 commit 51c6359
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 124 deletions.
1 change: 0 additions & 1 deletion examples/3-blobs/3blobs1line.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@
"outputs": [],
"source": [
"def plot_epoch(axs, data, key):\n",
"\n",
" label = \"Data space\"\n",
" plot_data_space(axs[label], data[label], key)\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/basic-1-bin/dummyproblem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"def yields(x):\n",
" s = 15 + x\n",
" b = 45 - 2 * x\n",
" db = 1 + 0.2 * x ** 2\n",
" db = 1 + 0.2 * x**2\n",
" return jnp.asarray([s]), jnp.asarray([b]), jnp.asarray([db])"
]
},
Expand Down Expand Up @@ -284,7 +284,7 @@
"x = np.linspace(0, 10)\n",
"s = 15 + x\n",
"b = 45 - 2 * x\n",
"db = 1 + 0.2 * x ** 2\n",
"db = 1 + 0.2 * x**2\n",
"\n",
"\n",
"def get_cls(s, b, db):\n",
Expand Down
3 changes: 0 additions & 3 deletions examples/basic-1-bin/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def make_model(model_pars):
exp_bonly_data = m.expected_data(bonlypars, include_auxdata=True)

def expected_logpdf(pars): # maps pars to bounded space if pdf_transform = True

return (
m.logpdf(to_bounded_vec(pars, bounds), exp_bonly_data)
if pdf_transform
Expand Down Expand Up @@ -106,7 +105,6 @@ def constrained_fit(
adam_init, adam_update, adam_get_params = optimizers.adam(learning_rate)

def make_model(hyper_pars):

model_pars, constrained_mu = hyper_pars
m, bonlypars = model_constructor(model_pars)

Expand All @@ -118,7 +116,6 @@ def make_model(hyper_pars):
exp_bonly_data = m.expected_data(bonlypars, include_auxdata=True)

def expected_logpdf(pars): # maps pars to bounded space if pdf_transform = True

return (
m.logpdf(to_bounded_vec(pars, bounds), exp_bonly_data)
if pdf_transform
Expand Down
1 change: 1 addition & 0 deletions examples/basic-1-bin/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# avoid those precision errors!
jax.config.update("jax_enable_x64", True)


# Cell
# [-inf, inf] -> [a,b] (vectors)
def to_bounded_vec(param, bounds):
Expand Down
Loading

0 comments on commit 51c6359

Please sign in to comment.