Пример #1
0
    def __init__(self, Y, dim):
        self.Xdim = dim
        self.N, self.Ydim = Y.shape
        """Use PCA to initalise the problem. Uses EM version in this case..."""
        myPCA_EM = PCA_EM(Y, dim)
        myPCA_EM.learn(100)
        X = np.array(myPCA_EM.m_Z)

        self.GP = GP.GP(X, Y)  #choose particular kernel here if so desired.
Пример #2
0
	def __init__(self,Y,dim):
		self.Xdim = dim
		self.N,self.Ydim = Y.shape
		
		"""Use PCA to initalise the problem. Uses EM version in this case..."""
		myPCA_EM = PCA_EM(Y,dim)
		myPCA_EM.learn(100)
		X = np.array(myPCA_EM.m_Z)
		
		self.GP = GP.GP(X,Y)#choose particular kernel here if so desired.
Пример #3
0
    def __init__(self, Y, dim, nparticles=100):
        self.Xdim = dim
        self.T, self.Ydim = Y.shape
        """Use PCA to initalise the problem. Uses EM version in this case..."""
        myPCA_EM = PCA_EM(Y, dim)
        myPCA_EM.learn(300)
        X = np.array(myPCA_EM.m_Z)

        self.observation_GP = GP.GP(X, Y)

        #create a linear kernel for the dynamics
        k = kernels.linear(-1, -1)
        self.dynamic_GP = GP.GP(X[:-1], X[1:], k)

        #initialise the samples from the state /latent variables
        self.particles = np.zeros((self.T, nparticles, self.Xdim))

        #sample for x0 TODO: variable priors on X0
        self.particles[0, :, :] = np.random.randn(nparticles, self.Xdim)
Пример #4
0
	def __init__(self,Y,dim,nparticles=100):
		self.Xdim = dim
		self.T,self.Ydim = Y.shape
		
		"""Use PCA to initalise the problem. Uses EM version in this case..."""
		myPCA_EM = PCA_EM(Y,dim)
		myPCA_EM.learn(300)
		X = np.array(myPCA_EM.m_Z)
		
		self.observation_GP = GP.GP(X,Y)
		
		#create a linear kernel for the dynamics
		k = kernels.linear(-1,-1)
		self.dynamic_GP = GP.GP(X[:-1],X[1:],k)
		
		#initialise the samples from the state /latent variables
		self.particles = np.zeros((self.T,nparticles,self.Xdim))
		
		#sample for x0 TODO: variable priors on X0
		self.particles[0,:,:] = np.random.randn(nparticles,self.Xdim)