This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Upload folder to Google Drive | |
""" | |
# Enable Python3 compatibility | |
from __future__ import (unicode_literals, absolute_import, print_function, | |
division) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def log_multivariate_normal_density(X, means, covars, min_covar=1.e-7): | |
"""Log probability for full covariance matrices. """ | |
if hasattr(linalg, 'solve_triangular'): | |
# only in scipy since 0.9 | |
solve_triangular = linalg.solve_triangular | |
else: | |
# slower, but works | |
solve_triangular = linalg.solve | |
n_samples, n_dim = X.shape | |
nmix = len(means) |