Package ai.djl.nn.transformer
Class IdEmbedding.Builder
java.lang.Object
ai.djl.nn.transformer.IdEmbedding.Builder
- Enclosing class:
- IdEmbedding
The Builder to construct an
IdEmbedding type of Block.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theIdEmbedding.setDictionarySize(int dictionarySize) Sets the number of ids that should be embedded.setEmbeddingSize(int embeddingSize) Sets the size of the embeddings.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setDictionarySize
Sets the number of ids that should be embedded. Valid ids are 0 to dictionarySize - 1.- Parameters:
dictionarySize- the number of ids that should be embedded. Valid ids are 0 to dictionarySize - 1.- Returns:
- this builder
-
setEmbeddingSize
Sets the size of the embeddings.- Parameters:
embeddingSize- the size of the embeddings.- Returns:
- this builder
-
build
Builds theIdEmbedding.- Returns:
- the constructed
IdEmbedding - Throws:
IllegalArgumentException- if all required parameters (items, embeddingSize) have not been set
-