def overlappingOccurenceCounts(self, model): counts = sequitur_.EvidenceStore() counts.setSequenceModel(model) accumulator = sequitur_.OneForAllAccumulator() accumulator.setTarget(counts) for eg in self.graphs(model): accumulator.accumulate(eg, 1.0) return counts
def evidence(self, model, useMaximumApproximation): evidences = sequitur_.EvidenceStore() evidences.setSequenceModel(model) if useMaximumApproximation: accumulator = sequitur_.ViterbiAccumulator() else: accumulator = sequitur_.Accumulator() accumulator.setTarget(evidences) logLik = 0.0 for eg in self.graphs(model): logLik += accumulator.accumulate(eg, 1.0) misc.reportMemoryUsage() return evidences, logLik