class MarginRankingCriterion[T] extends AbstractCriterion[Table, Table, T]
Creates a criterion that measures the loss given an input x = {x1, x2}, a table of two Tensors of size 1 (they contain only scalars), and a label y (1 or -1). In batch mode, x is a table of two Tensors of size batchsize, and y is a Tensor of size batchsize containing 1 or -1 for each corresponding pair of elements in the input Tensor. If y == 1 then it assumed the first input should be ranked higher (have a larger value) than the second input, and vice-versa for y == -1.
- Annotations
- @SerialVersionUID()
- Alphabetic
- By Inheritance
- MarginRankingCriterion
- AbstractCriterion
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new MarginRankingCriterion(margin: Double = 1.0, sizeAverage: Boolean = true)(implicit arg0: ClassTag[T], ev: TensorNumeric[T])
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: Table, target: Table): Table
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
-
def
canEqual(other: Any): Boolean
- Definition Classes
- MarginRankingCriterion → AbstractCriterion
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
cloneCriterion(): AbstractCriterion[Table, Table, T]
Deep copy this criterion
- var dist: Tensor[T]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(other: Any): Boolean
- Definition Classes
- MarginRankingCriterion → AbstractCriterion → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
forward(input: Table, target: Table): 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
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
var
gradInput: Table
- Definition Classes
- AbstractCriterion
-
def
hashCode(): Int
- Definition Classes
- MarginRankingCriterion → AbstractCriterion → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val margin: Double
- var mask: Tensor[T]
-
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
- Definition Classes
- AbstractCriterion
- val sizeAverage: Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- MarginRankingCriterion → AnyRef → Any
-
def
updateGradInput(input: Table, y: Table): Table
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
- returns
gradient of input
- Definition Classes
- MarginRankingCriterion → AbstractCriterion
-
def
updateOutput(input: Table, y: Table): 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
- returns
the loss of the criterion
- Definition Classes
- MarginRankingCriterion → AbstractCriterion
-
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( ... )