tfp.experimental.substrates.jax.experimental.inference_gym.targets.SparseLogisticRegression

Bayesian logistic regression with a sparsity-inducing prior.

Inherits From: BayesianModel

train_features Floating-point Tensor with shape [num_train_points, num_features]. Training features.
train_labels Integer Tensor with shape [num_train_points]. Training labels.
test_features Floating-point Tensor with shape [num_test_points, num_features]. Testing features. Can be None, in which case test-related sample transformations are not computed.
test_labels Integer Tensor with shape [num_test_points]. Testing labels. Can be None, in which case test-related sample transformations are not computed.
name Python str name prefixed to Ops created by this class.
pretty_name A Python str. The pretty name of this model.

ValueError If test_features and test_labels are either not both None or not both specified.

default_event_space_bijector Bijector mapping the reals (R**n) to the event space of this model.
dtype The DType of Tensors handled by this model.
event_shape Shape of a single sample from as a TensorShape.

May be partially defined or unknown.

name Python str name prefixed to Ops created by this class.
sample_transformations A dictionary of names to SampleTransformations.

Child Classes

class SampleTransformation

Methods

log_likelihood

View source

Evaluates the log_likelihood at value.

prior_distribution

View source

The prior distribution over the model parameters.

unnormalized_log_prob

View source

The un-normalized log density of evaluated at a point.

This corresponds to the target distribution associated with the model, often its posterior.

Args
value A (nest of) Tensor to evaluate the log density at.
name Python str name prefixed to Ops created by this method.

Returns
unnormalized_log_prob A floating point Tensor.