Add 'ppl' to tensorboard
Summary:
Originally, the 'ppl' is calculated but returned as a string, which will not be printed to the tensorboard.
Pull Request resolved:
@@ -306,7 +306,7 @@ def log_softmax(x, dim, onnx_trace=False):
def get_perplexity(loss):
try:
- return '{:.2f}'.format(math.pow(2, loss))
+ return float('{:.2f}'.format(math.pow(2, loss)))
except OverflowError:
return float('inf')
