<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def padded_neg_log_perplexity(predictions, labels, weights_fn=common_layers.weights_nonzero):
 """Average log-perplexity exluding padding 0s. No smoothing."""

  num, den = common_layers.padded_cross_entropy(
      predictions, labels, 0.0, weights_fn=weights_fn, reduce_sum=False)
  return (-num, den)