Ejemplo n.º 1
0
def cov_embedding(covariances):
    """Returns for a list of matrices a list of transformed
    matrices in matrix form, with 1. on the diagonal
    """
    ce = CovEmbedding()
    covariances = ce.fit_transform(covariances)  # shape n(n+1)/2
    if covariances is None:
        return None
    # changed from k=1 to k=0 by Salma
    return np.asarray([untri(c, k=0, fill=1.) for c in covariances])
Ejemplo n.º 2
0
def cov_embedding(covariances):
    ce = CovEmbedding()
    covariances = ce.fit_transform(covariances)
    if covariances is None:
        return None
    return np.asarray([untri(c, k=1, fill=1.0) for c in covariances])