mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-15 06:52:39 +02:00
added initialization
This commit is contained in:
parent
19df064fe9
commit
2f7ebb96ba
1 changed files with 17 additions and 0 deletions
17
GPy/util/initialization.py
Normal file
17
GPy/util/initialization.py
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
'''
|
||||||
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue