def compute_prior(self): """ Assign 0-probability to hypotheses with repeat values. BUT we only discover repeat values by reducing. """ seen = set() for k, v in self.value.items(): try: reduced = str(lambda_reduce(v.value)) except EvaluationException: return -Infinity if reduced in seen: return -Infinity else: seen.add(reduced) return SimpleLexicon.compute_prior(self)
def compute_prior(self): """ Assign 0-probability to hypotheses with repeat values. BUT we only discover repeat values by reducing. """ seen = set() for k,v in self.value.items(): try: reduced = str(lambda_reduce(v.value)) except EvaluationException: return -Infinity if reduced in seen: return -Infinity else: seen.add(reduced) return SimpleLexicon.compute_prior(self)
def compute_prior(self): return SimpleLexicon.compute_prior(self) - self.N * log(2.0)/self.prior_temperature # coin flip for each additional word
def compute_prior(self): return SimpleLexicon.compute_prior(self) - self.N * log( 2.0) / self.prior_temperature # coin flip for each additional word