Class/Object

com.intel.analytics.bigdl.nn

BCECriterion

Related Docs: object BCECriterion | package nn

Permalink

class BCECriterion[T] extends TensorCriterion[T]

This loss function measures the Binary Cross Entropy between the target and the output loss(o, t) = - 1/n sum_i (t[i] * log(o[i]) + (1 - t[i]) * log(1 - o[i])) or in the case of the weights argument being specified: loss(o, t) = - 1/n sum_i weights[i] * (t[i] * log(o[i]) + (1 - t[i]) * log(1 - o[i]))

By default, the losses are averaged for each mini-batch over observations as well as over dimensions. However, if the field sizeAverage is set to false, the losses are instead summed.

T

numeric type

Annotations
@SerialVersionUID()
Linear Supertypes
TensorCriterion[T], AbstractCriterion[Tensor[T], Tensor[T], T], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BCECriterion
  2. TensorCriterion
  3. AbstractCriterion
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BCECriterion(weights: Tensor[T] = null, sizeAverage: Boolean = true)(implicit arg0: ClassTag[T], ev: TensorNumeric[T])

    Permalink

    weights

    weights over the input dimension

    sizeAverage

    avgerage or not in each mini-batch

    ev

    numeric operator

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

    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
  6. val buffer: Tensor[T]

    Permalink
  7. def canEqual(other: Any): Boolean

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

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

    Permalink

    Deep copy this criterion

    Deep copy this criterion

    returns

    a deep copied criterion

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

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

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

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

    Permalink

    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
  14. final def getClass(): Class[_]

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  21. val onesBuffer: Tensor[T]

    Permalink
  22. var output: T

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

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

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

    Permalink

    Computing the gradient of the criterion with respect to its own input.

    Computing the gradient of the criterion with respect to its own input. This is returned in gradInput. Also, the gradInput state variable is updated accordingly.

    input

    input data

    target

    target data / labels

    returns

    gradient of input

    Definition Classes
    BCECriterionAbstractCriterion
  26. def updateOutput(input: Tensor[T], target: Tensor[T]): T

    Permalink

    Computes the loss using input and objective function.

    Computes the loss using input and objective function. This function returns the result which is stored in the output field.

    input

    input of the criterion

    target

    target or labels

    returns

    the loss of the criterion

    Definition Classes
    BCECriterionAbstractCriterion
  27. final def wait(): Unit

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

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

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

    Permalink

    weights over the input dimension

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