Я использую pymc3, чтобы найти оптимальное решение для 3D-поверхности. Это код, который я использую.IndexError: только целые числа, срезы (`:`), эллипсис (`...`). ,
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
Я получил сообщение об ошибке в этой строке:
glm.glm('z ~ x**2 + y**2 + x + y + np.sin(x) + np.cos(y)' , flatimage)
Ошибка является:
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Я попытался это исправить, изменив грех (х) и соз (у) к np.sin (x) и np.cos (y), но это не сработало, и я не знаю, что еще делать.
Спасибо! Это помогло мне! @aloctavodia – VD97