2
DensityDist
을 사용하여 균일 한 이전에 맞춤 분포의 샘플을 사용하고 싶습니다. 의 정신으로 뭔가 : star
는 않은 정규화 된 로그 우도 함수에 2D 직교 점을 매핑 기능이PyMC3에서 다변량 유니폼 샘플링
import theano.tensor as T
from pymc3 import DensityDist, Uniform, Model
with Model() as model:
lim = 3
x0 = Uniform('x0', -lim, lim)
x1 = Uniform('x1', -lim, lim)
x = T.concatenate([x0,x1])
# Create custom densities
star = DensityDist('star', lambda x: star(x[:,0],x[:,1]))
. Metropolis-Hastings를 사용하여 샘플링하려는 기능입니다.
많은 변형을 시도했지만 아무 것도 효과가 없었습니다. 현재 코드가 다음과 같이 실패합니다.
ValueError: The index list is longer (size 2) than the number of dimensions of the tensor(namely 0). You are asking for a dimension of the tensor that does not exist! You might need to use dimshuffle to add extra dimension to your tensor.
도움이 되었습니까?