Definition at line 18 of file bert.hpp.
◆ BERTEmbeddings()
Definition at line 26 of file bert.hpp.
27 : wordEmbeddings(bertConf.vocabSize, config.dimensions.
model),
28 positionalEmbeddings(bertConf.maxPositionEmbeddings, config.dimensions.
model),
29 tokenTypeEmbeddings(bertConf.typeVocabSize, config.dimensions.
model),
30 layerNorm({config.dimensions.
model}) {
31 registerSubmodel("word_embeddings", wordEmbeddings);
32 registerSubmodel("position_embeddings", positionalEmbeddings);
33 registerSubmodel("token_type_embeddings", tokenTypeEmbeddings);
34 registerSubmodel("LayerNorm", layerNorm);
35 }
◆ forward()
Note that the embeddings returned are references to tensors instead of tensors since they return the references to the learned embeddings.
- Todo:
- implement
Definition at line 37 of file bert.hpp.
The documentation for this class was generated from the following file: