BertEncoder

Companion:
class
trait Product
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def apply[S : Sc](maxLength: Int, vocabularySize: Int, segmentVocabularySize: Int, numBlocks: Int, embeddingDim: Int, attentionHiddenPerHeadDim: Int, attentionNumHeads: Int, mlpHiddenDim: Int, dropout: Double, padToken: Long, tOpt: STenOptions, linearized: Boolean): BertEncoder

Factory for the encoder module of Bert

Factory for the encoder module of Bert

Input is (tokens, segments) where tokens and segments are both (batch,num tokens) long tensor.

Value parameters:
attentionHiddenPerHeadDim

size of hidden attention dimension of each attention head

attentionNumHeads

number of attention heads

dropout

dropout rate

embeddingDim

input embedding dimension

maxLength

maximum num token length

mlpHiddenDim

size of hidden dimension of the two layer perceptron

numBlocks

number of transformer blocks to create

out

output dimension

padToken

pad token, (batch, seq) positions where tokens == padToken are ignored, padding is not the same as masking

tOpt

tensor options

vocabularySize

vocabulary size

Returns:

a module

Implicits

Implicits

implicit val load: Load[BertEncoder]