Skip to content

Commit

Permalink
fix: typos for 0.20 zfit
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-eschle committed Apr 11, 2024
1 parent 26f717c commit 198ba2b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
12 changes: 6 additions & 6 deletions _website/tutorials/components/20 - Composite Models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@
"source": [
"## creating an extended PDF\n",
"\n",
"An extended PDF can either be created with the `create_extended(yield_param)` method or with the simple Python\n",
"syntax of multiplying a PDF with the parameter."
"An extended PDF can be created using the `extended` argument in the initialization.\n",
" \n",
"Alternatively, an extended PDF from a non-extended PDF can be created with the `create_extended(yield_param)` method."
]
},
{
Expand All @@ -153,7 +154,8 @@
"metadata": {},
"outputs": [],
"source": [
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)"
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)\n",
"gauss3 = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
]
},
{
Expand All @@ -170,9 +172,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gauss3_ext = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
]
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion _website/tutorials/components/33 - Binned fits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@
"source": [
"modifier_constraints = zfit.constraint.GaussianConstraint(params=list(modifiers.values()), observation=np.ones(len(modifiers)),\n",
" uncertainty=0.1 * np.ones(len(modifiers)))\n",
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, 1)"
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, sigma=1)"
]
},
{
Expand Down
13 changes: 10 additions & 3 deletions _website/tutorials/components/50 - Custom code and run mode.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
"outputs": [],
"source": [
"%%timeit -n1 -r1\n",
"zfit.run.set_mode(graph=True) # running in graph mode\n",
"zfit.run.set_graph_mode(True) # running in graph mode\n",
"for i in range(100):\n",
" for _ in range(n_evals):\n",
" graph_func2(i)"
Expand All @@ -424,7 +424,7 @@
"source": [
"%%timeit -n1 -r1\n",
"zfit.run.clear_graph_cache()\n",
"zfit.run.set_mode(graph=True) # running in graph mode but clearing unused caches\n",
"zfit.run.set_graph_mode(graph=True) # running in graph mode but clearing unused caches\n",
"for i in range(100):\n",
" zfit.run.clear_graph_cache()\n",
" for _ in range(n_evals):\n",
Expand Down Expand Up @@ -486,7 +486,7 @@
"metadata": {},
"outputs": [],
"source": [
"zfit.run.set_mode(graph=False) # test first in eager mode"
"zfit.run.set_graph_mode(False) # test first in eager mode"
]
},
{
Expand Down Expand Up @@ -548,6 +548,13 @@
"source": [
"That's a significant speedup! It is clear that for a few evaluations, it does not matter _too much_. But this is about the scalability: imagine we have a large fit, where a minimizer needs hundreds or thousands of evaluations: that's when the initial Graph building becomes neglectible and the speedup matters."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
12 changes: 6 additions & 6 deletions components/20 - Composite Models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@
"source": [
"## creating an extended PDF\n",
"\n",
"An extended PDF can either be created with the `create_extended(yield_param)` method or with the simple Python\n",
"syntax of multiplying a PDF with the parameter."
"An extended PDF can be created using the `extended` argument in the initialization.\n",
" \n",
"Alternatively, an extended PDF from a non-extended PDF can be created with the `create_extended(yield_param)` method."
]
},
{
Expand All @@ -153,7 +154,8 @@
"metadata": {},
"outputs": [],
"source": [
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)"
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)\n",
"gauss3 = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
]
},
{
Expand All @@ -170,9 +172,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gauss3_ext = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
]
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion components/33 - Binned fits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@
"source": [
"modifier_constraints = zfit.constraint.GaussianConstraint(params=list(modifiers.values()), observation=np.ones(len(modifiers)),\n",
" uncertainty=0.1 * np.ones(len(modifiers)))\n",
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, 1)"
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, sigma=1)"
]
},
{
Expand Down
13 changes: 10 additions & 3 deletions components/50 - Custom code and run mode.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
"outputs": [],
"source": [
"%%timeit -n1 -r1\n",
"zfit.run.set_mode(graph=True) # running in graph mode\n",
"zfit.run.set_graph_mode(True) # running in graph mode\n",
"for i in range(100):\n",
" for _ in range(n_evals):\n",
" graph_func2(i)"
Expand All @@ -424,7 +424,7 @@
"source": [
"%%timeit -n1 -r1\n",
"zfit.run.clear_graph_cache()\n",
"zfit.run.set_mode(graph=True) # running in graph mode but clearing unused caches\n",
"zfit.run.set_graph_mode(graph=True) # running in graph mode but clearing unused caches\n",
"for i in range(100):\n",
" zfit.run.clear_graph_cache()\n",
" for _ in range(n_evals):\n",
Expand Down Expand Up @@ -486,7 +486,7 @@
"metadata": {},
"outputs": [],
"source": [
"zfit.run.set_mode(graph=False) # test first in eager mode"
"zfit.run.set_graph_mode(False) # test first in eager mode"
]
},
{
Expand Down Expand Up @@ -548,6 +548,13 @@
"source": [
"That's a significant speedup! It is clear that for a few evaluations, it does not matter _too much_. But this is about the scalability: imagine we have a large fit, where a minimizer needs hundreds or thousands of evaluations: that's when the initial Graph building becomes neglectible and the speedup matters."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 198ba2b

Please sign in to comment.