本文整理匯總了Python中vggish_params.PCA_EIGEN_VECTORS_NAME屬性的典型用法代碼示例。如果您正苦於以下問題:Python vggish_params.PCA_EIGEN_VECTORS_NAME屬性的具體用法?Python vggish_params.PCA_EIGEN_VECTORS_NAME怎麽用?Python vggish_params.PCA_EIGEN_VECTORS_NAME使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類vggish_params
的用法示例。
在下文中一共展示了vggish_params.PCA_EIGEN_VECTORS_NAME屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import vggish_params [as 別名]
# 或者: from vggish_params import PCA_EIGEN_VECTORS_NAME [as 別名]
def __init__(self, pca_params_npz_path):
"""Constructs a postprocessor.
Args:
pca_params_npz_path: Path to a NumPy-format .npz file that
contains the PCA parameters used in postprocessing.
"""
params = np.load(pca_params_npz_path)
self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
# Load means into a column vector for easier broadcasting later.
self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
assert self._pca_matrix.shape == (
vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
'Bad PCA means shape: %r' % (self._pca_means.shape,))