LBBNN0.1.1 package

Latent Binary Bayesian Neural Networks Using 'torch'

alpha_prior

Generate prior inclusion probabilities for the weights of a LBBNN laye...

assign_names

Assign names to nodes.

assign_within_layer_pos

Function for plotting nodes in the network between two layers.

coef.LBBNN_Net

Get model coefficients (local explanations) of an LBBNN_Net object

Custom_activation

Generate a custom activation function.

density_initialization

Generate initializations for the inclusion parameters.

FLOW

Class to generate a normalizing flow

get_adj_mats

Obtain adjacency matrices for igraph plotting

get_dataloaders

Wrapper around torch::dataloader

get_input_inclusions

Function that checks how many times inputs are included, and from whic...

get_local_explanations_gradient

Function to get gradient based local explanations for input-skip LBBNN...

LBBNN_Conv2d

Class to generate an LBBNN convolutional layer.

LBBNN_Linear

Class to generate an LBBNN feed forward layer

LBBNN_Net

Feed-forward Latent Binary Bayesian Neural Network (LBBNN)

LBBNN_plot

Function to plot an input skip structure after removing weights in non...

LBBNN-package

LBBNN: Latent Binary Bayesian Neural Networks Using 'torch'

MLP

Multi layer-perceptron

plot_local_explanations_gradient

Plot the gradient based local explanations for one sample with input-s...

plot.LBBNN_Net

Plot LBBNN_Net objects

predict.LBBNN_Net

Obtain predictions from the variational posterior of an LBBNN model

print.LBBNN_Net

Print summary of an LBBNN_Net object

quants

Function to obtain empirical 95% confidence interval, including the me...

residuals.LBBNN_Net

Residuals from LBBNN fit

RNVP_layer

Single RNVP transform layer.

std_prior

Generate prior standard deviation for weights and biases of either lin...

summary.LBBNN_Net

Summary of LBBNN fit

train_LBBNN

Train an instance of LBBNN_Net.

validate_LBBNN

Validate a trained LBBNN model.

Latent binary Bayesian neural networks (LBBNNs) are implemented using 'torch', an R interface to the LibTorch backend. Supports mean-field variational inference as well as flexible variational posteriors using normalizing flows. The standard LBBNN implementation follows Hubin and Storvik (2024) <doi:10.3390/math12060788>, using the local reparametrization trick as in Skaaret-Lund et al. (2024) <https://openreview.net/pdf?id=d6kqUKzG3V>. Input-skip connections are also supported, as described in Høyheim et al. (2025) <doi:10.48550/arXiv.2503.10496>.

  • Maintainer: Lars Skaaret-Lund
  • License: MIT + file LICENSE
  • Last published: 2025-12-01