python - Setting deterministic distributions in PyMC3 -
i'm new pymc3 here pymc2 - need specific compile in theano convert pymc3 code?
@pymc.deterministic def away_theta(home_team=home_team, away_team=away_team, home=home, atts=atts, defs=defs, intercept=intercept): return np.exp(intercept + atts[away_team] + defs[home_team]) i error like
astensorerror: ('cannot convert home_theta tensortype', <class 'pymc.pymcobjects.deterministic'>)
yes, determinstic transformations need theano expressions in pymc3. instead of using np.exp you'd use theano.tensor.exp:
import theano.tensor t import pymc3 pm model(): ... regression = pm.deterministic('regression', t.exp(intercept + atts[away_team] + defs[home_team])) ...
Comments
Post a Comment