code: def _decay(self):
          
          costs = []
          for var in tf.trainable_variables():
              if var.op.name.find(r"DW") > 0:
                  costs.append(tf.nn.l2_loss(var))
  
          return tf.multiply(self.hps.weight_decay_rate, tf.add_n(costs))
docs: L2 weight decay loss.