Fixed errors in perplexity calculation due to forgetting
logarithm. Unfortunately, results don't look like I'd expect still. It
could be that the model is not very good. Or (more likely) there is a
bug. I need to write the test code calculating the perplexity with a
known model.