abstract class AbstractCriterion[A <: Activity, B <: Activity, T] extends Serializable
AbstractCriterion is an abstract class the concrete criterion should extend.
Criterions are helpful to train a neural network. Given an input and a target,
they compute the gradient according to a loss function.
It provides some important method such as forward, backward, updateOutput,
updateGradInput frequently used as a criteria. Some of them need to be override
in a concrete criterion class.
- A
represents the input type of the criterion, which an be abstract type Activity, or concrete type Tensor or Table
- B
represents the output type of the criterion
- T
The numeric type in the criterion, usually which are Float or Double
- Alphabetic
- By Inheritance
- AbstractCriterion
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new AbstractCriterion()(implicit arg0: ClassTag[A], arg1: ClassTag[B], arg2: ClassTag[T], ev: TensorNumeric[T])
Abstract Value Members
-
abstract
def
updateGradInput(input: A, target: B): A
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
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
backward(input: A, target: B): A
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
- def canEqual(other: Any): Boolean
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
cloneCriterion(): AbstractCriterion[A, B, T]
Deep copy this criterion
Deep copy this criterion
- returns
a deep copied criterion
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
- Definition Classes
- AbstractCriterion → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
forward(input: A, target: B): 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
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- var gradInput: A
-
def
hashCode(): Int
- Definition Classes
- AbstractCriterion → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- var output: T
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
updateOutput(input: A, target: B): T
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
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )