0
나는 pymc3를 사용하여 3D 표면에 가장 잘 맞는 것을 찾습니다. 이것은 내가 사용하고있는 코드입니다.IndexError : 정수, 슬라이스 (`:`), 줄임표 (`...`) 만 있습니다. .
glm.glm('z ~ x**2 + y**2 + x + y + np.sin(x) + np.cos(y)' , flatimage)
오류는 다음과 같습니다 :
with Model() as model:
# specify glm and pass in data. The resulting linear model, its likelihood and
# and all its parameters are automatically added to our model.
glm.glm('z ~ x**2 + y**2 + x + y + np.sin(x) + np.cos(y)' , flatimage)
start = find_MAP()
step = NUTS(scaling=start) # Instantiate MCMC sampling algorithm
trace = sample(2000, step, progressbar=False) # draw 2000 posterior samples using NUTS sampling
나는이 라인에 오류가있어 내가 죄를 변경하여 그것을 해결하기 위해 노력했다
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
를 (x)와 COS (Y) np.sin (x)와 np.cos (y)로 변환 할 수 있지만 작동하지 않아 다른 작업을 수행 할 수 없습니다.
고맙습니다! 이것은 나를 도왔다! @aloctavodia – VD97