class_docstr: A basic Adam optimizer that includes "correct" L2 weight decay.
  Copied from the google BERT repo.
  Except that in `apply_gradient` function, we add the support to increment
  the passed global step parameter, to make it more compatible to
  tf.train.Optimizer implementation.
class_docstr_tok: ["A","basic","Adam","optimizer","that","includes","``","correct","''","L2","weight","decay",".","Copied","from","the","google","BERT","repo",".","Except","that","in","`","apply_gradient","`","function",",","we","add","the","support","to","increment","the","passed","global","step","parameter",",","to","make","it","more","compatible","to","tf.train.Optimizer","implementation","."]
docstr: Whether to use L2 weight decay for `param_name`.
docstr_tok: ["Whether","to","use","L2","weight","decay","for","`","param_name","`","."]
code: def _do_use_weight_decay(self, param_name):
      """Whether to use L2 weight decay for `param_name`."""
      if not self.weight_decay_rate:
          return False
      if self.exclude_from_weight_decay:
          for r in self.exclude_from_weight_decay:
              if re.search(r, param_name) is not None:
                  return False
      return True
  
file_path: texar/texar/tf/core/optimization.py
imports: import re
  import tensorflow
  from texar.tf.hyperparams import HParams
  from texar.tf.utils import utils
label_desc: Use image node_id 3 for calling the AdamWeightDecayOptimizer obj's underlying member method code with example usage: obj._do_use_weight_decay(param_name) and returns: True, False, False