Package ai.djl.nn.transformer
Class IdEmbedding.Builder
- java.lang.Object
-
- ai.djl.nn.transformer.IdEmbedding.Builder
-
- Enclosing class:
- IdEmbedding
public static final class IdEmbedding.Builder extends java.lang.Object
The Builder to construct anIdEmbedding
type ofBlock
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdEmbedding
build()
Builds theIdEmbedding
.IdEmbedding.Builder
setDictionarySize(int dictionarySize)
Sets the number of ids that should be embedded.IdEmbedding.Builder
setEmbeddingSize(int embeddingSize)
Sets the size of the embeddings.
-
-
-
Method Detail
-
setDictionarySize
public IdEmbedding.Builder setDictionarySize(int dictionarySize)
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
public IdEmbedding.Builder setEmbeddingSize(int embeddingSize)
Sets the size of the embeddings.- Parameters:
embeddingSize
- the size of the embeddings.- Returns:
- this builder
-
build
public IdEmbedding build()
Builds theIdEmbedding
.- Returns:
- the constructed
IdEmbedding
- Throws:
java.lang.IllegalArgumentException
- if all required parameters (items, embeddingSize) have not been set
-
-