inferpy.queries package

Submodules

inferpy.queries.query module

class inferpy.queries.query.Query(variables, target_names=None, data={}, enable_interceptor_variables=(None, None))[source]

Bases: object

log_prob()[source]

Computes the log probabilities of a (set of) sample(s)

parameters(names=None)[source]

Return the parameters of the Random Variables of the model. If names is None, then return all the parameters of all the Random Variables. If names is a list, then return the parameters specified in the list (if exists) for all the Random Variables. If names is a dict, then return all the parameters specified (value) for each Random Variable (key).

Note

If tf_run=True, but any of the returned parameters is not a Tensor and therefore cannot be evaluated) this returns a not evaluated dict (because the evaluation will raise an Exception)

Parameters:

names – A list, a dict or None. Specify the parameters for the Random Variables to be obtained.

Returns:

A dict, where the keys are the names of the Random Variables and the values a dict of parameters (name-value)

sample(size=1)[source]

Generates a sample for eache variable in the model

sum_log_prob()[source]

Computes the sum of the log probabilities (evaluated) of a (set of) sample(s)

inferpy.queries.query.flatten_result(f)[source]

Module contents

class inferpy.queries.Query(variables, target_names=None, data={}, enable_interceptor_variables=(None, None))[source]

Bases: object

log_prob()[source]

Computes the log probabilities of a (set of) sample(s)

parameters(names=None)[source]

Return the parameters of the Random Variables of the model. If names is None, then return all the parameters of all the Random Variables. If names is a list, then return the parameters specified in the list (if exists) for all the Random Variables. If names is a dict, then return all the parameters specified (value) for each Random Variable (key).

Note

If tf_run=True, but any of the returned parameters is not a Tensor and therefore cannot be evaluated) this returns a not evaluated dict (because the evaluation will raise an Exception)

Parameters:

names – A list, a dict or None. Specify the parameters for the Random Variables to be obtained.

Returns:

A dict, where the keys are the names of the Random Variables and the values a dict of parameters (name-value)

sample(size=1)[source]

Generates a sample for eache variable in the model

sum_log_prob()[source]

Computes the sum of the log probabilities (evaluated) of a (set of) sample(s)