class_docstr: Deprecated version of `CrossEntropy` that returns per-example loss rather
  than mean loss.
class_docstr_tok: ["Deprecated","version","of","`","CrossEntropy","`","that","returns","per-example","loss","rather","than","mean","loss","."]
docstr: Constructor.
  :param model: Model instance, the model on which to apply the loss.
  :param smoothing: float, amount of label smoothing for cross-entropy.
  :param attack: function, given an input x, return an attacked x'.
docstr_tok: ["Constructor",".",":","param","model",":","Model","instance",",","the","model","on","which","to","apply","the","loss",".",":","param","smoothing",":","float",",","amount","of","label","smoothing","for","cross-entropy",".",":","param","attack",":","function",",","given","an","input","x",",","return","an","attacked","x","'","."]
code: def __init__(self, model, smoothing=0.0, attack=None, **kwargs):
      """Constructor.
      :param model: Model instance, the model on which to apply the loss.
      :param smoothing: float, amount of label smoothing for cross-entropy.
      :param attack: function, given an input x, return an attacked x'.
      """
      if smoothing < 0 or smoothing > 1:
          raise ValueError("Smoothing must be in [0, 1]", smoothing)
      del kwargs
      Loss.__init__(self, model, locals(), attack)
      self.smoothing = smoothing
  
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 to create a new LossCrossEntropy object from inherited base classes: Loss with example: obj = LossCrossEntropy(model, smoothing, attack)