#NEWLINE# def add_data( self , Z , X , fixed_kernel = True ) : #NEWLINE# #INDENT# assert ( ( Z . ndim == 2 ) and ( Z . shape [ 1 ] == self . D ) ) #NEWLINE# M = Z . shape [ 0 ] #NEWLINE# assert ( X . shape == ( M , self . K ) ) , 'X must be MxK' #NEWLINE# psi = np . zeros ( ( M , self . K ) ) #NEWLINE# if C : #NEWLINE# #INDENT# C = self . kernel . K ( Z ) #NEWLINE# C += ( 1e-06 * np . eye ( M ) ) #NEWLINE# C_inv = np . linalg . inv ( C ) #NEWLINE# L = np . linalg . cholesky ( C ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# C = None #NEWLINE# C_inv = None #NEWLINE# L = None #NEWLINE# #UNINDENT# augmented_data = { #NEWLINE# #INDENT# 'X' : X , #NEWLINE# 'Z' : Z , #NEWLINE# 'M' : M , #NEWLINE# 'C' : C , #NEWLINE# 'C_inv' : C_inv , #NEWLINE# 'L' : L , #NEWLINE# 'psi' : psi , #NEWLINE# #UNINDENT# } #NEWLINE# self . data_list . append ( augmented_data ) #NEWLINE# return augmented_data