Source code for algorithms.distribution.base
[docs]class Distribution(object):
@property
def dim(self):
'''
:return: dimension
'''
raise NotImplementedError
[docs] def kl_sym(self, old_dist_info_vars, new_dist_info_vars):
"""
Compute the symbolic KL divergence of two distributions
"""
raise NotImplementedError
[docs] def kl(self, old_dist_info, new_dist_info):
"""
Compute the KL divergence of two distributions
"""
raise NotImplementedError
[docs] def likelihood_ratio_sym(self, x_var, old_dist_info_vars, new_dist_info_vars):
raise NotImplementedError
[docs] def entropy(self, dist_info):
raise NotImplementedError
[docs] def log_likelihood_sym(self, x_var, dist_info_vars):
raise NotImplementedError
[docs] def log_likelihood(self, xs, dist_info):
raise NotImplementedError
@property
def dist_info_specs(self):
raise NotImplementedError
@property
def dist_info_keys(self):
return [k for k, _ in self.dist_info_specs]