LBBNN0.1.4 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 lbbnn_net object

custom_activation

Generate a custom activation function.

density_initialization

Generate initializations for the inclusion parameters.

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

Get gradient based local explanations for input-skip LBBNNs.

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-package

LBBNN: Latent Binary Bayesian Neural Networks Using 'torch'

mlp

Multi layer-perceptron

normalizing_flow

Class to generate a normalizing flow

plot_active_paths

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

plot_local_explanations_gradient

Plot the gradient based local explanations for one sample.

plot.lbbnn_net

Plot lbbnn_net objects

predict.lbbnn_net

Obtain predictions from the 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: 2026-01-12