-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
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.
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":
Performance Impact
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.