VariationalChain¶
-
class
tfsnippet.VariationalChain(variational, model, log_joint=None, latent_names=None, latent_axis=None)¶ Bases:
objectChain of the variational and model nets for variational inference.
In the context of variational inference, it is a common usage for chaining the variational net and the model net, by feeding the samples of latent variables from the variational net as the observations of the model net.
VariationalChainholds theBayesianNetinstances of the variational and the model nets, and theVariationalInferenceobject for this chain.See also
tfsnippet.bayes.BayesianNet.variational_chain()Attributes Summary
latent_axisGet the axes of sampling dimensions of latent variables. latent_namesGet the names of the latent variables for variational inference. log_jointGet the log-joint of the model. modelGet the model net. variationalGet the variational net. viGet the variational inference object. Attributes Documentation
-
latent_axis¶ Get the axes of sampling dimensions of latent variables.
-
latent_names¶ Get the names of the latent variables for variational inference.
Returns: The names of the latent variables. Return type: tuple[str]
-
log_joint¶ Get the log-joint of the model.
Returns: The log-joint of the model. Return type: tf.Tensor
-
model¶ Get the model net.
Returns: The model net. Return type: BayesianNet
-
variational¶ Get the variational net.
Returns: The variational net. Return type: BayesianNet
-
vi¶ Get the variational inference object.
Returns: The variational inference object. Return type: VariationalInference
-