Thanks, that is definitely needed, but not the source of the problem. The error I get is the following:
File "C:\Users\LocalAdmin\anaconda3\envs\pymc_env\Lib\site-packages\pytensor\tensor\math.py", line 1945, in perform
z[0] = np.asarray(np.dot(x, y))
^^^^^^^^^^^^
ValueError: shapes (1,3) and (2,4) not aligned: 3 (dim 1) != 2 (dim 0)
Apply node that caused the error: dot(ExpandDims{axis=0}.0, [[0 1 2 3] ... [0 1 2 3]])
Toposort index: 15
Inputs types: [TensorType(float64, shape=(1, None)), TensorType(int32, shape=(2, 4))]
Inputs shapes: [(1, 3), (2, 4)]
Inputs strides: [(72, 24), (16, 4)]
Inputs values: [array([[-0.20188156, -0.36012242, -0.21725961]]), 'not shown']
Outputs clients: [[DropDims{axis=0}(dot.0)]]
Backtrace when the node is created (use PyTensor flag traceback__limit=N to make it longer):
File "c:\Users\LocalAdmin\surfdrive\Code\TensorGP\debug_forum", line 63, in <module>
cpd_model = CPD(X,y,prior_cov,4,0.1)
File "c:\Users\LocalAdmin\surfdrive\Code\TensorGP\debug_forum", line 31, in __init__
output = output*pm.math.matmul(feature_test(X[:,d],self.N,self.M),factors[d])
File "c:\Users\LocalAdmin\surfdrive\Code\TensorGP\debug_forum", line 7, in feature_test
return pm.math.sin(x @ matrix)
File "c:\Users\LocalAdmin\surfdrive\Code\TensorGP\debug_forum", line 63, in <module>
cpd_model = CPD(X,y,prior_cov,4,0.1)
File "c:\Users\LocalAdmin\surfdrive\Code\TensorGP\debug_forum", line 31, in __init__
output = output*pm.math.matmul(feature_test(X[:,d],self.N,self.M),factors[d])
HINT: Use the PyTensor flag `exception_verbosity=high` for a debug print-out and storage map footprint of this Apply node.
PS C:\Users\LocalAdmin\surfdrive\Code\TensorGP>
Basically when predicting, I need to change the shape of the output variable, but I am unable to update self.N. It should be trivial, but I am a beginner.