You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello i am trying to save and load SparseGPRegression model using the code
Saving models in a consistent way across versions:
let X, Y be data loaded above
Model creation:
m = GPy.models.GPRegression(X, Y)
m.optimize()
# 1: Saving a model:
np.save('model_save.npy', m.param_array)
# 2: loading a model
# Model creation, without initialization:
m_load = GPy.models.GPRegression(X, Y, initialize=False)
m_load.update_model(False) # do not call the underlying expensive algebra on load
m_load.initialize_parameter() # Initialize the parameters (connect the parameters up)
m_load[:] = np.load('model_save.npy') # Load the parameters
m_load.update_model(True) # Call the algebra only once
print(m_load)
My code :
sgp = GPy.models.SparseGPRegression(x_test, y_test, num_inducing=100,kernel=GPy.kern.RBF(5,ARD=True))
sgp.optimize()
np.save('smodel_save.npy', sgp.param_array)
m_load = GPy.models.SparseGPRegression(x_test, y_test, initialize=False)
m_load.update_model(False) # do not call the underlying expensive algebra on load
m_load.initialize_parameter() # Initialize the parameters (connect the parameters up)
m_load[:] = np.load('smodel_save.npy') # Load the parameters
m_load.update_model(True) # Call the algebra only once
print(m_load)
ValueError: Setting by slice or index only allowed with array-like
do you know how to make it works ??
does the above code work only for GPRegression model ??
The text was updated successfully, but these errors were encountered:
hello i am trying to save and load SparseGPRegression model using the code
Saving models in a consistent way across versions:
let X, Y be data loaded above
Model creation:
My code :
ValueError: Setting by slice or index only allowed with array-like
do you know how to make it works ??
does the above code work only for GPRegression model ??
The text was updated successfully, but these errors were encountered: