You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: usage/stochastic-gradient-samplers/index.qmd
+33-23Lines changed: 33 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -70,35 +70,43 @@ end
70
70
model = gaussian_model(data)
71
71
```
72
72
73
-
SGLD requires very small step sizes to ensure stability. We use a `PolynomialStepsize` that decreases over time. Note: Currently, `PolynomialStepsize` is the primary stepsize schedule available in Turing for SGLD:
73
+
SGLD requires very small step sizes to ensure stability. We use a `PolynomialStepsize` that decreases over time. Note: Currently, `PolynomialStepsize` is the primary stepsize schedule available in Turing for SGLD.
74
+
75
+
**Important Note on Convergence**: The examples below use longer chains (10,000-15,000 samples) with the first half discarded as burn-in to ensure proper convergence. This is typical for stochastic gradient samplers, which require more samples than standard HMC/NUTS to achieve reliable results:
-**SGLD** exhibits slower convergence and higher variance due to the injected noise, requiring longer chains to achieve stable estimates
132
-
-**SGHMC** shows slightly better mixing than SGLD due to the momentum term, but still requires careful tuning
133
-
-**HMC** converges quickly and efficiently explores the posterior, demonstrating why it's preferred for small to medium-sized problems
139
+
The comparison shows that (using converged portions after burn-in):
140
+
-**SGLD** exhibits slower convergence and higher variance due to the injected noise, requiring longer chains (10,000+ samples) and discarding burn-in to achieve stable estimates
141
+
-**SGHMC** shows slightly better mixing than SGLD due to the momentum term, but still requires careful tuning and burn-in period
142
+
-**HMC** converges quickly and efficiently explores the posterior from the start, demonstrating why it's preferred for small to medium-sized problems
0 commit comments