Skip to content

Commit

Permalink
Probability fix
Browse files Browse the repository at this point in the history
Code printed log-probabilities before, but now prints correct ones.
  • Loading branch information
danpol authored Aug 17, 2016
1 parent 5e3f2a1 commit 9c6ab55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eval.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function printProbabilityTable(wordIds, probabilities, num)
local line = "| "
for i = 1, num do
local word = dataset.id2word[wordId[i]]
line = line .. string.format("%-10s(%4d%%)", word, probabilities[p][i] * 100) .. " | "
line = line .. string.format("%-10s(%4d%%)", word, torch.exp(probabilities[p][i]) * 100) .. " | "
end
print(line)
end
Expand Down Expand Up @@ -67,4 +67,4 @@ while true do
io.write("you> ")
io.flush()
io.write(say(io.read()))
end
end

0 comments on commit 9c6ab55

Please sign in to comment.