Module: tfp.experimental.nn.util

View source on GitHub

Utilitity functions for building neural networks.

Functions

display_imgs(...): Display images as a grid.

expand_dims(...): Like tf.expand_dims but accepts a vector of axes to expand.

flatten_rightmost(...): Flatten rightmost dims.

make_fit_op(...): One training step.

make_kernel_bias(...): Creates kernel and bias as tf.Variables.

make_kernel_bias_posterior_mvn_diag(...): Create learnable posterior for Variational layers with kernel and bias.

make_kernel_bias_prior_spike_and_slab(...): Create prior for Variational layers with kernel and bias.

negloglik(...): Negative log-likelihood.

tfcompile(...): Centralizes TF compilation related options.

trace(...): Returns a function which prints info related to input.

tune_dataset(...): Sets generally recommended parameters for a tf.data.Dataset.

variables_load(...): Assigns values to structure of tf.Variables from filename.

variables_save(...): Saves structure of tf.Variables to filename.

variables_summary(...): Returns a list of summarizing strs.