Modifier and Type | Method and Description |
---|---|
Embedding<T> |
build()
Builds the
Embedding . |
java.lang.Class<T> |
getEmbeddingType()
Returns the embedded type.
|
Embedding.Builder<T> |
optDataType(DataType dataType)
Sets the data type of the embedding arrays (default is Float32).
|
Embedding.Builder<T> |
optUseDefault(boolean useDefault)
Sets whether to use a default embedding for undefined items (default true).
|
Embedding.Builder<T> |
setEmbeddingSize(int embeddingSize)
Sets the size of the embeddings.
|
Embedding.Builder<T> |
setItems(java.util.Collection<T> items)
Sets the collection of items that should feature embeddings.
|
<T> Embedding.Builder<T> |
setType(java.lang.Class<T> embeddingType)
Creates a new
Conv2D.Builder with the specified embedding type. |
public java.lang.Class<T> getEmbeddingType()
public <T> Embedding.Builder<T> setType(java.lang.Class<T> embeddingType)
Conv2D.Builder
with the specified embedding type.T
- the embedding typeembeddingType
- the embedding classConv2D.Builder
class with the specified embedding typepublic Embedding.Builder<T> setItems(java.util.Collection<T> items)
items
- a collection containing all the items that embeddings should be created forpublic Embedding.Builder<T> setEmbeddingSize(int embeddingSize)
embeddingSize
- the size of the 1D embedding arraypublic Embedding.Builder<T> optUseDefault(boolean useDefault)
useDefault
- true to provide a default embedding and false to throw an IllegalArgumentException
when the item can not be foundpublic Embedding.Builder<T> optDataType(DataType dataType)
dataType
- the dataType to use for the embedding