Closed smcveigh-phunware closed 6 years ago
I have a linear mean function as follows:
from numpy import pi, log10 def free_space_path_loss(X): """ :param X: 2-column array of [theta, radius] :return: free space path loss @ radius """ tx = -40 loss = 20*log10(X[:, 1]) + 20*log10(2402E6) + 20*log10(4*pi/299792458) return tx - loss mean = GPy.mappings.Linear(input_dim=2, output_dim=1, name="free_space") mean.f = free_space_path_loss
And I build a regression model:
m= GPy.models.GPRegression( data[['theta', 'radius']], data['rss'].values.reshape([-1, 1]), kernel=kern, # input_dim = 2 mean_function=mean )
It complains that the output dimensions don't match: 2 -> len(data) rather than 2 -> 1. Am I missing something?
2 -> len(data)
2 -> 1
It looks like your free_space_path_loss function does not return a column array (X[:,1]), have you tried using a column array (X[:, [1]]) as output?
X[:,1]
X[:, [1]]
I have a linear mean function as follows:
And I build a regression model:
It complains that the output dimensions don't match:
2 -> len(data)
rather than2 -> 1
. Am I missing something?