TensorFlow 2.0 Beta is available Learn more

tfp.trainable_distributions.tril_with_diag_softplus_and_shift

Converts (batch of) vectors to (batch of) lower-triangular scale matrices.

tfp.trainable_distributions.tril_with_diag_softplus_and_shift(
    x,
    diag_shift=1e-05,
    name=None
)

Defined in python/trainable_distributions/trainable_distributions_lib.py.

Args:

  • x: (Batch of) float-like Tensor representing vectors which will be transformed into lower-triangular scale matrices with positive diagonal elements. Rightmost shape n must be such that n = dims * (dims + 1) / 2 for some positive, integer dims.
  • diag_shift: Tensor added to softplus transformation of diagonal elements. Default value: 1e-5.
  • name: A name_scope name for operations created by this function. Default value: None (i.e., "tril_with_diag_softplus_and_shift").

Returns:

  • scale_tril: (Batch of) lower-triangular Tensor with x.dtype and rightmost shape [dims, dims] where n = dims * (dims + 1) / 2 where n = x.shape[-1].