Class IdEmbedding.Builder

java.lang.Object
ai.djl.nn.transformer.IdEmbedding.Builder
Enclosing class:
IdEmbedding

public static final class IdEmbedding.Builder extends Object
The Builder to construct an IdEmbedding type of Block.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • 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 the IdEmbedding.
      Returns:
      the constructed IdEmbedding
      Throws:
      IllegalArgumentException - if all required parameters (items, embeddingSize) have not been set