
Train a deep ensemble of Neural ODEs for uncertainty quantification
Source:R/piml_neural_ode_ensemble.R
piml_neural_ode_fit_ensemble.RdWraps piml_neural_ode_fit() in a K-member ensemble, each member
trained from an independent random initialisation. The returned
object behaves like a single edaphos_piml_neural_ode for the
purposes of predict() — except that the method returns the full
K × length(newdepths) matrix of member-wise predictions, or
(optionally) a tidy (mean, sd, lower, upper) credible-interval
summary.
Usage
piml_neural_ode_fit_ensemble(
depths,
values,
y_surface = NULL,
K = 5L,
hidden = c(16L, 16L),
n_steps = 4L,
epochs = 500L,
lr = 0.01,
seed = NULL,
verbose = FALSE
)Arguments
Forwarded to
piml_neural_ode_fit()member-by-member. See there for details.- K
Integer — number of ensemble members. Default 5 for a reasonable speed/variance trade-off; 10 is the recommended ceiling on laptop-scale problems.
- seed
Optional integer — seeds the ensemble. Member
kis trained withseed = seed + k - 1L.
Value
An edaphos_piml_neural_ode_ensemble carrying:
- members
A list of
Kfittededaphos_piml_neural_odeobjects.- K, hidden, n_steps, y_surface
Configuration echo.
- fitted
A
K × n_obsmatrix of in-sample predictions.- fitted_mean, fitted_sd
Ensemble mean / standard deviation of
fitted.- rmse
RMSE of the ensemble mean against the training observations.
Details
The theoretical justification for the ensemble as a posterior approximation is developed in Lakshminarayanan et al. 2017 and Wilson & Izmailov 2020 (see the @references section). In short: for wide neural networks, different SGD trajectories converge to different basins of the loss surface, and the resulting member-wise spread is a well-calibrated proxy for the Bayesian posterior predictive variance.
References
Lakshminarayanan, B., Pritzel, A. and Blundell, C. (2017). Simple and scalable predictive uncertainty estimation using deep ensembles. NeurIPS 30, 6402–6413.
Wilson, A. G. and Izmailov, P. (2020). Bayesian deep learning and a probabilistic perspective of generalization. NeurIPS 33, 4697–4708.
See also
predict.edaphos_piml_neural_ode_ensemble(),
piml_neural_ode_fit() for the single-member variant,
piml_profile_fit_bayesian() for the parametric-ODE analogue.