com.intel.analytics.bigdl.nn

KullbackLeiblerDivergenceCriterion

class KullbackLeiblerDivergenceCriterion[T] extends TensorCriterion[T]

This method is same as kullback_leibler_divergence loss in keras. Loss calculated as: y_true = K.clip(y_true, K.epsilon(), 1) y_pred = K.clip(y_pred, K.epsilon(), 1) and output K.sum(y_true * K.log(y_true / y_pred), axis=-1)

T

The numeric type in the criterion, usually which are Float or Double

Linear Supertypes
TensorCriterion[T], AbstractCriterion[Tensor[T], Tensor[T], T], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. KullbackLeiblerDivergenceCriterion
  2. TensorCriterion
  3. AbstractCriterion
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KullbackLeiblerDivergenceCriterion()(implicit arg0: ClassTag[T], ev: TensorNumeric[T])

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

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

    Performs a back-propagation step through the criterion, with respect to the given input.

    Performs a back-propagation step through the criterion, with respect to the given input.

    input

    input data

    target

    target

    returns

    gradient corresponding to input data

    Definition Classes
    AbstractCriterion
  8. var bufferInput: Tensor[T]

  9. var bufferTarget: Tensor[T]

  10. def canEqual(other: Any): Boolean

    Definition Classes
    AbstractCriterion
  11. def clone(): AnyRef

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

    Deep copy this criterion

    Deep copy this criterion

    returns

    a deep copied criterion

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

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

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

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

    Takes an input object, and computes the corresponding loss of the criterion, compared with target.

    Takes an input object, and computes the corresponding loss of the criterion, compared with target.

    input

    input data

    target

    target

    returns

    the loss of criterion

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

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

    Definition Classes
    AbstractCriterion
  19. def hashCode(): Int

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

    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. var output: T

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

    Definition Classes
    AnyRef
  26. def toString(): String

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

    back propagation with: - target / input

    back propagation with: - target / input

    input

    input data

    target

    target data / labels

    returns

    gradient of input

    Definition Classes
    KullbackLeiblerDivergenceCriterionAbstractCriterion
  28. def updateOutput(input: Tensor[T], target: Tensor[T]): T

    It calculates: y_true = K.

    It calculates: y_true = K.clip(y_true, K.epsilon(), 1) y_pred = K.clip(y_pred, K.epsilon(), 1) and output K.sum(y_true * K.log(y_true / y_pred), axis=-1)

    input

    input of the criterion

    target

    target or labels

    returns

    the loss of the criterion

    Definition Classes
    KullbackLeiblerDivergenceCriterionAbstractCriterion
  29. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from TensorCriterion[T]

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

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped