Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get f(x) value when GP (num_rand_basis = 0) was condcuted? #5

Open
sanosyu opened this issue Mar 2, 2017 · 0 comments
Open

Comments

@sanosyu
Copy link

sanosyu commented Mar 2, 2017

Hello developers,

I have a question about extraction of fmean and fcov after learning.

fmean = policy.predictor.get_post_fmean(policy.training, policy.test)
fcov = policy.predictor.get_post_fcov(policy.training, policy.test)

The above scripts worked when num_rand_basis was not set at 0.
However, it did not work when num_rand_basis was set at 0.

How can I get fmean and fcov values when GP (num_rand_basis = 0) was conducted?

The error message was as below

ValueError Traceback (most recent call last)
in ()
----> 1 fmean = policy.predictor.get_post_fmean(policy.training, policy.test)
2 fcov = policy.predictor.get_post_fcov(policy.training, policy.test)

/usr/local/lib/python2.7/dist-packages/combo/gp/predictor.pyc in get_post_fmean(self, training, test)
32 if self.model.stats is None:
33 self.prepare( training )
---> 34 return self.model.get_post_fmean( training.X, test.X )
35
36 def get_post_fcov( self, training, test, diag = True ):

/usr/local/lib/python2.7/dist-packages/combo/gp/core/model.pyc in get_post_fmean(self, X, Z, params)
102
103 if self.inf is 'exact':
--> 104 post_fmu = inf.exact.get_post_fmean(self, X, Z, params)
105
106 return post_fmu

/usr/local/lib/python2.7/dist-packages/combo/gp/inf/exact.pyc in get_post_fmean(gp, X, Z, params)
92 G = gp.prior.get_cov( X=Z, Z=X, params = prior_params )
93
---> 94 return G.dot(alpha) + fmu
95
96 def get_post_fcov(gp, X, Z, params = None, diag = True ):

ValueError: shapes (81,22) and (21,) not aligned: 22 (dim 1) != 21 (dim 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant