
MC-dropout predictive draws from a ConvLSTM fit
Source:R/temporal_posterior.R
temporal_convlstm_mcdropout_predict.RdRuns n_draws forward passes through a fitted edaphos_temporal_convlstm
with dropout active in train mode, producing a Monte-Carlo sample of
the predictive posterior (Gal and Ghahramani 2016). The fit must
have been trained with dropout_p > 0 for this to give a
non-degenerate sample; when the fit has no dropout layers the draws
collapse to the deterministic forward pass.
Usage
temporal_convlstm_mcdropout_predict(
object,
sequence,
n_draws = 50L,
return_sequence = NULL,
seed = NULL
)Arguments
- object
An
edaphos_temporal_convlstmwhose underlyingnn_modulecontainsnn_dropout2dlayers. Fits produced bytemporal_convlstm_fit()with the defaultdropout_p = 0work but produce a degenerate constant draw.- sequence
5-D input tensor
(batch, T, C, H, W)or equivalent R array.- n_draws
Integer; number of MC forward passes.
- return_sequence
Logical override; defaults to the value used at training time.
- seed
Optional integer seed.