class_docstr: Weight decay
class_docstr_tok: ["Weight","decay"]
code: def fprop(self, x, y, **kwargs):
      terms = [
          tf.nn.l2_loss(param)
          for param in self.model.get_params()
          if len(param.get_shape()) > 1
      ]
      out = tf.add_n(terms)
      assert len(out.get_shape()) == 0
      return out
  
imports: import copy
  import json
  import os
  import warnings
  import numpy
  import tensorflow
  from cleverhans.attacks import Attack
  from cleverhans.compat import softmax_cross_entropy_with_logits
  from cleverhans.model import Model
  from cleverhans.utils import safe_zip
label_desc: Use image node_id 1 for calling the WeightDecay obj's underlying member method code with example usage: obj.fprop(x, y) and returns: out