class_docstr: Adapts T2TModel for sequential_scheduled_sampling().
class_docstr_tok: ["Adapts","T2TModel","for","sequential_scheduled_sampling","(",")","."]
docstr: Mixes gold and sampled tokens randomly.
docstr_tok: ["Mixes","gold","and","sampled","tokens","randomly","."]
code: def mix_fn(self, gold_tokens, sampled_tokens):
      """Mixes gold and sampled tokens randomly."""
      hparams = self._t2tmodel.hparams
      p_sample = inverse_decay_mix_prob(
          hparams.scheduled_sampling_warmup_schedule,
          hparams.scheduled_sampling_gold_mixin_prob,
          hparams.scheduled_sampling_warmup_steps,
      )
      return _mix_tokens(
          p_sample=p_sample,
          gold_targets=gold_tokens,
          sampled_targets=sampled_tokens,
      )
  
file_path: tensor2tensor/tensor2tensor/utils/scheduled_sampling.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import copy
  from tensor2tensor.layers import common_layers
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.python.ops import inplace_ops
label_desc: Use image node_id 3 for calling the ScheduledSamplingAdapter obj's underlying member method code with example usage: obj.mix_fn(gold_tokens, sampled_tokens) and returns: _mix_tokens