code: def raml_loss(batch, output, training_rewards):
      mle_loss = tx.losses.sequence_sparse_softmax_cross_entropy(
          labels=batch["target_text_ids"][:, 1:],
          logits=output.logits,
          sequence_length=batch["target_length"] - 1,
          average_across_batch=False,
      )
      return tf.reduce_sum(mle_loss * training_rewards) / tf.reduce_sum(
          training_rewards
      )
  
file_path: texar/examples/seq2seq_exposure_bias/raml_main.py
imports: from io import open
  import importlib
  import tensorflow
  import texar.tf
  import numpy
  import random
  from rouge import Rouge
label_desc: Use image node_id 2 for calling a global function with example usage: raml_loss(batch, output, training_rewards) and returns: unknown