Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions notebooks/features/expectation_propagation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,16 @@
"__Full EP Fit__\n",
"\n",
"That is the entire algorithm. The high-level API runs this loop for us: `factor_graph.optimise(...)` cycles the\n",
"factors, manages damping, tracks the history and writes results to the output folder.\n",
"factors, tracks the history and writes results to the output folder. By default it uses full updates (`delta=1.0`),\n",
"so damping is not enabled unless we explicitly pass an updater.\n",
"\n",
"Each `AnalysisFactor` is fitted by its own `DynestyStatic`; the `LaplaceOptimiser` passed here is the *default* for\n",
"the remaining factors \u2014 the `PriorFactor`'s \u2014 whose updates are cheap."
"the remaining factors \u2014 the `PriorFactor`'s \u2014 whose updates are cheap.\n",
"\n",
"For a problem where partial updates are worth testing, add\n",
"`updater=af.SimplerUpdater(delta=0.7)` to the call below. This is deliberately commented out: damping is\n",
"problem-dependent and has made hierarchical scale collapse worse in repeated-run diagnostics, so it should be\n",
"validated across repeated fits rather than enabled routinely."
]
},
{
Expand All @@ -456,6 +462,7 @@
" optimiser=laplace,\n",
" paths=paths,\n",
" ep_history=af.EPHistory(kl_tol=0.05),\n",
" # updater=af.SimplerUpdater(delta=0.7), # Optional; no damping by default.\n",
" max_steps=5,\n",
")"
],
Expand Down
9 changes: 8 additions & 1 deletion scripts/features/expectation_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,16 @@
__Full EP Fit__

That is the entire algorithm. The high-level API runs this loop for us: `factor_graph.optimise(...)` cycles the
factors, manages damping, tracks the history and writes results to the output folder.
factors, tracks the history and writes results to the output folder. By default it uses full updates (`delta=1.0`),
so damping is not enabled unless we explicitly pass an updater.

Each `AnalysisFactor` is fitted by its own `DynestyStatic`; the `LaplaceOptimiser` passed here is the *default* for
the remaining factors — the `PriorFactor`'s — whose updates are cheap.

For a problem where partial updates are worth testing, add
`updater=af.SimplerUpdater(delta=0.7)` to the call below. This is deliberately commented out: damping is
problem-dependent and has made hierarchical scale collapse worse in repeated-run diagnostics, so it should be
validated across repeated fits rather than enabled routinely.
"""
laplace = af.LaplaceOptimiser()

Expand All @@ -298,6 +304,7 @@
optimiser=laplace,
paths=paths,
ep_history=af.EPHistory(kl_tol=0.05),
# updater=af.SimplerUpdater(delta=0.7), # Optional; no damping by default.
max_steps=5,
)

Expand Down
Loading