Package ai.djl.nn.core
Interface AbstractEmbedding<T>
- Type Parameters:
T- the type of item that should be embedded
- All Known Subinterfaces:
AbstractIndexedEmbedding<T>
- All Known Implementing Classes:
ConstantEmbedding,Embedding,Embedding.DefaultEmbedding,Embedding.DefaultItem,TrainableWordEmbedding
public interface AbstractEmbedding<T>
An Embedding maps elements of type T to a 1-Dimensional representative
NDArrays.-
Method Summary
-
Method Details
-
hasItem
Returns whether an item is in the embedding.- Parameters:
item- the item to test- Returns:
- true if the item is in the embedding
-
embed
Embeds an array of items.- Parameters:
manager- the manager for the new embeddingsitems- the items to embed- Returns:
- the embedding
NDArrayof Shape(items.length, embeddingSize)
-