class_docstr: A loss often used in multi-class classification problems with SoftMax
  as the last layer of the neural network.
  
  By default, same as Keras, input(y_pred) is supposed to be probabilities of each class,
  and target(y_true) is supposed to be the class label starting from 0.
  
  # Arguments
  log_prob_as_input: Boolean. Whether to accept log-probabilities or probabilities
                     as input. Default is False and inputs should be probabilities.
  zero_based_label: Boolean. Whether target labels start from 0. Default is True.
                    If False, labels start from 1.
  weights: A Numpy array. Weights of each class if you have an unbalanced training set.
  size_average: Boolean. Whether losses are averaged over observations for each
                mini-batch. Default is True. If False, the losses are instead
                summed for each mini-batch.
  padding_value: Int. If the target is set to this value, the training process
                 will skip this sample. In other words, the forward process will
                 return zero output and the backward process will also return
                 zero grad_input. Default is -1.
  
  >>> loss = SparseCategoricalCrossEntropy()
  creating: createZooKerasSparseCategoricalCrossEntropy
  >>> import numpy as np
  >>> np.random.seed(1128)
  >>> weights = np.random.uniform(0, 1, (2,)).astype("float32")
  >>> loss = SparseCategoricalCrossEntropy(weights=weights)
  creating: createZooKerasSparseCategoricalCrossEntropy
class_docstr_tok: ["A","loss","often","used","in","multi-class","classification","problems","with","SoftMax","as","the","last","layer","of","the","neural","network",".","By","default",",","same","as","Keras",",","input","(","y_pred",")","is","supposed","to","be","probabilities","of","each","class",",","and","target","(","y_true",")","is","supposed","to","be","the","class","label","starting","from","0",".","#","Arguments","log_prob_as_input",":","Boolean",".","Whether","to","accept","log-probabilities","or","probabilities","as","input",".","Default","is","False","and","inputs","should","be","probabilities",".","zero_based_label",":","Boolean",".","Whether","target","labels","start","from","0",".","Default","is","True",".","If","False",",","labels","start","from","1.","weights",":","A","Numpy","array",".","Weights","of","each","class","if","you","have","an","unbalanced","training","set",".","size_average",":","Boolean",".","Whether","losses","are","averaged","over","observations","for","each","mini-batch",".","Default","is","True",".","If","False",",","the","losses","are","instead","summed","for","each","mini-batch",".","padding_value",":","Int",".","If","the","target","is","set","to","this","value",",","the","training","process","will","skip","this","sample",".","In","other","words",",","the","forward","process","will","return","zero","output","and","the","backward","process","will","also","return","zero","grad_input",".","Default","is","-1",".",">",">",">","loss","=","SparseCategoricalCrossEntropy","(",")","creating",":","createZooKerasSparseCategoricalCrossEntropy",">",">",">","import","numpy","as","np",">",">",">","np.random.seed","(","1128",")",">",">",">","weights","=","np.random.uniform","(","0",",","1",",","(","2",",",")",")",".astype","(","``","float32","''",")",">",">",">","loss","=","SparseCategoricalCrossEntropy","(","weights=weights",")","creating",":","createZooKerasSparseCategoricalCrossEntropy"]
code: def __init__(
      self,
      log_prob_as_input=False,
      zero_based_label=True,
      weights=None,
      size_average=True,
      padding_value=-1,
      bigdl_type="float",
  ):
      super(SparseCategoricalCrossEntropy, self).__init__(
          None,
          bigdl_type,
          log_prob_as_input,
          zero_based_label,
          JTensor.from_ndarray(weights),
          size_average,
          padding_value,
      )
  
imports: import sys
  from zoo.pipeline.api.keras.base import ZooKerasCreator
  from bigdl.nn.criterion import Criterion
  from bigdl.util.common import JTensor
label_desc: Use image node_id 1 to create a new SparseCategoricalCrossEntropy object from inherited base classes: LossFunction with example: obj = SparseCategoricalCrossEntropy(log_prob_as_input, zero_based_label, weights, size_average, padding_value, bigdl_type)