def log_f((code, motif)):
     eps = map(lambda x: -log(x), pw_prob_sites(motif, code))
     return sum(nu * log(1 / (1 + exp(ep - mu))) for ep in eps)
 def pw_log_fitness(motif):
     eps = map(lambda x: -log(x), pw_prob_sites(motif, code))
     return sum(log(1 / (1 + exp(ep - mu))**nu) for ep in eps)