Computes metrics on a validation dataset without computing gradients.
Supports model averaging (recommended) by sampling from the variational posterior (num_samples > 1)
to improve predictions. Returns metrics for both the full model and the sparse model.
validate_LBBNN(LBBNN, num_samples, test_dl, device = "cpu")A list containing the following elements:
Classification accuracy of the full (dense) model (if classification).
Classification accuracy using only weights in active paths (if classification).
Root mean squared error for the full model (if regression).
Root mean squared error using only weights in active paths (if regression).
Proportion of weights with posterior inclusion probability > 0.5 in the whole network.
Proportion of weights with inclusion probability > 0.5 after removing weights not in active paths.
An instance of a trained LBBNN_Net to be validated.
integer, the number of samples from the variational posterior to be used for model averaging.
An instance of torch::dataloader, containing the validation data.
The device to perform validation on. Default is 'cpu'; other options include 'gpu' and 'mps'.