forcedotcom / distributions

Low-level primitives for collapsed Gibbs sampling in python and C++
BSD 3-Clause "New" or "Revised" License
33 stars 25 forks source link

Split VectorizedScorer into ValueScorer + DataScorer #49

Closed fritzo closed 10 years ago

fritzo commented 10 years ago

This splits VectorizedScorer into MixtureValueScorer + MixtureDataScorer, and creates in each model two typedefs: FastMixture and SmallMixture. Both mixture types use a fast custom .score_data(...) method, but only FastMixture has uses caching in its score_value method.

This also moves towards @cap 's suggested pattern of splitting complicated objects into pieces: MixtureSlave is now composed of MixtureSlaveGroups + MixtureSlaveValueScorer + MixtureSlaveDataScorer.

Practically, this speeds up loom kind inference by 15-30%.