You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of data conditioning in the server uses a "with-replacement approximation" of the likelihood function, i.e. it uses pow() instead of gamma() or factorial(). This design decision was based on an early non-vectorized implementation, where calling gamma() was very slow; however the server is now vectorized, so it should be cheap to implement exact likelihood computations.
Results from treecat.profile serve show that the majority of time is spent on np.dot() in propagation. Therefore there should be negligible cost in switching from np.pow to scipy.special.gammaln.
The text was updated successfully, but these errors were encountered:
The current implementation of data conditioning in the server uses a "with-replacement approximation" of the likelihood function, i.e. it uses
pow()
instead ofgamma()
orfactorial()
. This design decision was based on an early non-vectorized implementation, where callinggamma()
was very slow; however the server is now vectorized, so it should be cheap to implement exact likelihood computations.How?
For math details, see Stephen Tu's excellent writeup or Wikipedia.
Where?
This approximation is pervasive in
serving.py
, simply search for "with-replacement":TreeCatServer.sample()
TreeCatServer.logprob()
TreeCatServer.marginals()
Performance Impact
Results from
treecat.profile serve
show that the majority of time is spent onnp.dot()
in propagation. Therefore there should be negligible cost in switching fromnp.pow
toscipy.special.gammaln
.The text was updated successfully, but these errors were encountered: