class LinearLayer extends AnyRef
Implements one linear layer
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- LinearLayer
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new LinearLayer(name: String, dual: Boolean, weights: MathMatrix, biasesOpt: Option[MathColVector], labelsOpt: Option[Array[String]])
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
- val biasesOpt: Option[MathColVector]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def concatenateModifierAndHead(sentenceHiddenStates: MathMatrix, modifierAbsolutePosition: Int, headRelativePosition: Int): MathMatrix
Generates a 1-row matrix containing a concatenation of the modifier and head embeddings
- def concatenateModifiersAndHeads(sentenceHiddenStates: MathMatrix, headRelativePositions: Array[Int]): MathMatrix
- val dual: Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def forward(inputBatch: Array[MathMatrix]): Array[MathMatrix]
Forward pass for a batch of sentences
Forward pass for a batch of sentences
- inputBatch
Each matrix in the batch has dimensions (sentence size x hidden state size)
- returns
Each output matrix has dimensions (sentence size x labels size)
- def forward(inputSentence: MathMatrix): MathMatrix
Forward pass for a single sentence
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val labelsOpt: Option[Array[String]]
- val name: String
- 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()
- def predict(inputBatch: Array[MathMatrix], batchHeads: Option[Array[Array[Int]]], batchMasks: Option[Array[Array[Boolean]]]): Array[Array[String]]
Predict the top label for each token in each sentence in the batch
- def predict(inputSentence: MathMatrix, heads: Option[Array[Int]], masks: Option[Array[Boolean]]): Array[String]
Predict the top label per token
- def predictDual(inputBatch: Array[MathMatrix], batchHeads: Option[Array[Array[Int]]] = None, batchMasks: Option[Array[Array[Boolean]]] = None): Array[Array[String]]
Predict the top label for each combination of modifier token and corresponding head token
- def predictDualWithScores(inputBatch: Array[MathMatrix], batchHeads: Option[Array[Array[Array[Int]]]] = None, batchMasks: Option[Array[Array[Boolean]]] = None): Array[Array[Array[(String, Float)]]]
- def predictPrimal(inputBatch: Array[MathMatrix]): Array[Array[String]]
- def predictPrimalWithScores(inputBatch: Array[MathMatrix]): Array[Array[Array[(String, Float)]]]
- def predictWithScores(inputBatch: Array[MathMatrix], batchHeads: Option[Array[Array[Array[Int]]]], batchMasks: Option[Array[Array[Boolean]]]): Array[Array[Array[(String, Float)]]]
Predict all labels and their scores per token in each sentence in the batch
- def predictWithScores(inputSentence: MathMatrix, heads: Option[Array[Array[Int]]], masks: Option[Array[Boolean]]): Array[Array[(String, Float)]]
Predict all labels and their scores per token
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- val weights: MathMatrix