Stumped: Gaussian Process w/ Polynomial Kernel - Incompatible Elemwise input shapes

Chris - thanks for your comment. features is the list of features. But your comment helped me think a bit more about it -

Changing (removing the shape=2)

    c = pm.Normal("c", 0, 1, shape=2)
    offset = pm.Normal("offset", 0, 1, shape=2)
    d = pm.Normal("d", 0, 1, shape=2)

to

    c = pm.Normal("c", 0, 1, shape=2)
    offset = pm.Normal("offset", 0, 1)
    d = pm.Normal("d", 0, 1)

actually makes it work. I hadn’t necessarily understood what the Polynomial was expanding out, but it looks like one set of coefficients c at the power d, and a single offset or intercept term is what the Polynomial is actually doing. I think to do what I want I need to specify the d anyway so I’ve learned something - thank you!

2 Likes