I’m using v5.InErros when calling a function when using pymc3,I asked how to accomplish conclave.Thanks community,I know the way.But I got more problems,I followed this example
kernel = pt.full((window_size, ), 1/window_size)
smooth2 = conv.causal_conv1d(data[None, None, :], kernel[None, None, :], filter_shape=(1, 1, 10), input_shape=(1, 1, 100)).eval()
plt.plot(data)
plt.plot(smooth2.squeeze())
I write my codes like this
def Ft(A,sigma2,mu2,a):
t_min=0
t_max=(t4_s.shape[0]-nor_resp.shape[0]+1)*(t4_s[1]-t4_s[0])
num=t4_s.shape[0]-nor_resp.shape[0]+1
t=np.linspace(t_min,t_max,num)
tau=1/sigma2**2
ft1=A*pm.math.sqrt(tau/(2*np.pi))*pm.math.exp(-tau/2*(t+a-mu2)**2)
ft=conv.causal_conv1d(ft1[None, None, :], nor_resp[None, None, :],filter_shape=(1, 1,nor_resp.shape[0]),input_shape=(1,1,t.shape[0])).eval()
return ft
I got errors:
ValueError: Size length is incompatible with batched dimensions of parameter 0 [[[-3.4415 ... 820e-02]]]:
len(size) = 1, len(batched dims [[[-3.4415 ... 820e-02]]]) = 3. Size length must be 0 or >= 3
I don’t know why, maybe I passed error parameters when using conv.causal_conv1d, the fist array in my convolve is from pymc,the second is an array, which type is (336,).