Class/Object

com.intel.analytics.zoo.pipeline.api.keras.objectives

SparseCategoricalCrossEntropy

Related Docs: object SparseCategoricalCrossEntropy | package objectives

Permalink

class SparseCategoricalCrossEntropy[T] extends TensorLossFunction[T]

A loss often used in multi-class classification problems with SoftMax as the last layer of the neural network.

By default, 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.

Linear Supertypes
TensorLossFunction[T], LossFunction[Tensor[T], Tensor[T], T], AbstractCriterion[Tensor[T], Tensor[T], T], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SparseCategoricalCrossEntropy
  2. TensorLossFunction
  3. LossFunction
  4. AbstractCriterion
  5. Serializable
  6. Serializable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SparseCategoricalCrossEntropy(logProbAsInput: Boolean = false, zeroBasedLabel: Boolean = true, weights: Tensor[T] = null, sizeAverage: Boolean = true, paddingValue: Int = 1)(implicit arg0: ClassTag[T], ev: TensorNumeric[T])

    Permalink

    logProbAsInput

    Boolean. Whether to accept log-probabilities or probabilities as input. Default is false and inputs should be probabilities.

    zeroBasedLabel

    Boolean. Whether target labels start from 0. Default is true. If false, labels start from 1.

    weights

    Tensor. Weights of each class if you have an unbalanced training set. Default is null.

    sizeAverage

    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.

    paddingValue

    Integer. 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 gradInput. Default is -1.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def backward(input: Tensor[T], target: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    AbstractCriterion
  6. def canEqual(other: Any): Boolean

    Permalink
    Definition Classes
    AbstractCriterion
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def cloneCriterion(): AbstractCriterion[Tensor[T], Tensor[T], T]

    Permalink
    Definition Classes
    AbstractCriterion
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(other: Any): Boolean

    Permalink
    Definition Classes
    AbstractCriterion → AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def forward(input: Tensor[T], target: Tensor[T]): T

    Permalink
    Definition Classes
    AbstractCriterion
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. var gradInput: Tensor[T]

    Permalink
    Definition Classes
    AbstractCriterion
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AbstractCriterion → AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. val logProbAsInput: Boolean

    Permalink

    Boolean.

    Boolean. Whether to accept log-probabilities or probabilities as input. Default is false and inputs should be probabilities.

  18. val loss: TensorCriterion[T]

    Permalink
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. var output: T

    Permalink
    Definition Classes
    AbstractCriterion
  23. val paddingValue: Int

    Permalink

    Integer.

    Integer. 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 gradInput. Default is -1.

  24. val sizeAverage: Boolean

    Permalink

    Boolean.

    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.

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. def updateGradInput(input: Tensor[T], target: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    SparseCategoricalCrossEntropyLossFunction → AbstractCriterion
  28. def updateOutput(input: Tensor[T], target: Tensor[T]): T

    Permalink
    Definition Classes
    SparseCategoricalCrossEntropyLossFunction → AbstractCriterion
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. val weights: Tensor[T]

    Permalink

    Tensor.

    Tensor. Weights of each class if you have an unbalanced training set. Default is null.

  33. val zeroBasedLabel: Boolean

    Permalink

    Boolean.

    Boolean. Whether target labels start from 0. Default is true. If false, labels start from 1.

Inherited from TensorLossFunction[T]

Inherited from LossFunction[Tensor[T], Tensor[T], T]

Inherited from AbstractCriterion[Tensor[T], Tensor[T], T]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped