GPy/GPy/util/initialization.py

17 lines
317 B
Python
Raw Normal View History

2014-02-24 14:56:28 +00:00
'''
Created on 24 Feb 2014
@author: maxz
'''
import numpy as np
from linalg import PCA
def initialize_latent(init, input_dim, Y):
Xr = np.random.randn(Y.shape[0], input_dim)
if init == 'PCA':
PC = PCA(Y, input_dim)[0]
Xr[:PC.shape[0], :PC.shape[1]] = PC
else:
pass
return Xr