Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Error when assign model variable as kernel parameters #140

Open
zhenwendai opened this issue Nov 30, 2018 · 0 comments
Open

Error when assign model variable as kernel parameters #140

zhenwendai opened this issue Nov 30, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@zhenwendai
Copy link
Contributor

Describe the bug
Error when assign model variable as kernel parameters.

from mxfusion import Model, Variable
from mxfusion.components.variables import PositiveTransformation, Softplus
from mxfusion.components.distributions.gp.kernels import RBF
from mxfusion.modules.gp_modules import SparseGPRegression, GPRegression

m = Model()
m.N = Variable()
m.X = Variable(shape=(m.N, X_prepared.shape[-1]))
m.noise_var = Variable(shape=(1,), transformation=PositiveTransformation(), initial_value=0.01)
m.lengthscale = Variable(shape=(X_prepared.shape[-1],), transformation=Softplus(0.01), 
                         initial_value=mx.nd.array([1]*X_prepared.shape[-1], dtype='float64'))
m.kernel = RBF(input_dim=X_prepared.shape[-1], variance=1, lengthscale=m.lengthscale, ARD=True)
m.Y = GPRegression.define_variable(X=m.X, kernel=m.kernel, noise_var=m.noise_var, shape=(m.N, Y_prepared.shape[-1]))

To Reproduce
Steps to reproduce the behavior:

  1. Build a model like '...'
  2. Run inference '...'
  3. See error

Preferably this is in the form of a small snippet of runnable code that reproduces the behavior.

Expected behavior
A clear and concise description of what you expected to happen. A

Desktop (please complete the following information):

  • OS: MacOS
  • Python version 3.6
  • MXNet version 1.3
  • MXFusion version 0.3.0
  • MXNet context CPU
  • MXNet dtype float64

Additional context
Add any other context about the problem here.

@zhenwendai zhenwendai added the bug Something isn't working label Nov 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant