rbnet.multivariate_normal.PairwiseProduct
- class rbnet.multivariate_normal.PairwiseProduct(mean1, mean2, cov1=None, cov2=None, prec1=None, prec2=None)[source]
Bases:
object
Public Data Attributes:
Compute covariance matrix using the least expensive method
Public Methods:
__init__
(mean1, mean2[, cov1, cov2, prec1, ...])Compute mean using the least expensive method
Return the product distribution as torch MultivariateNormal
Compute log-normalisation using the least expensive method
Private Methods:
_cost_comp
(cost1, cost2, comp)Compares cost1 and cost2 using comp. Costs are numpy arrays [i, mm, mv, ma, va] with i indicating the number of matrix inversion, mm that of matrix-matrix multiplications, mv that of matrix-vector multiplications, ma that of matrix-matrix additions, and va that of vector-vector additions. Comparison is performed element-wise in this order, that is::.
_cost_lt
(cost1, cost2)_cov1_cost
()_cov2_cost
()_prec1_cost
()_prec2_cost
()_sum_cov_cost
()_sum_cov_inv_cost
()_prec_v1_cost
()Cost of computing precision by adding prec1 and prec2
_prec_v2_cost
()Cost of computing precision by inverting cov (if cov is not present assume infinite costsfor tie-breaking).
_prec_cost
()_cov_v1
()Compute covariance from prec1 and prec2
_cov_v1_cost
()_cov_v2
()Compute covariance from cov1 and cov2
_cov_v2_cost
()_cov_cost
()_mean_v1
()Compute mean from cov, prec1, and prec2
_mean_v1_cost
()_mean_v2
()Compute mean from cov, prec1, and prec2
_mean_v2_cost
()
- property cov
Compute covariance matrix using the least expensive method
- property cov1
- property cov2
- property log_norm
Compute log-normalisation using the least expensive method
- property mean
Compute mean using the least expensive method
- property prec
- property prec1
- property prec2
- property sum_cov
- property sum_cov_inv
- property torch
Return the product distribution as torch MultivariateNormal