Package ai.djl.nn.core
Contains classes that define simple neural network operations.
-
Interface Summary Interface Description AbstractEmbedding<T> An Embedding maps elements of type T to a 1-Dimensional representativeNDArray
s.AbstractIndexedEmbedding<T> AnAbstractEmbedding
where each embedded item can be assigned an integer index. -
Class Summary Class Description ConstantEmbedding AnAbstractIndexedEmbedding
that always returns a constant value.Embedding<T> An Embedding block map a collection of items to 1-Dimensional representativeNDArray
s.Embedding.BaseBuilder<T,B extends Embedding.BaseBuilder<T,B>> Linear A Linear block applies a linear transformation \(Y = XW^T + b\).Linear.Builder LinearCollection A LinearCollection block applies \(m\) linear transformations \(Y_i = X_i W_i + b_i\) for each \(i \in [1, \ldots, m]\) and \(m = \prod_{j=1}^t s_j\).LinearCollection.Builder The Builder to construct aLinearCollection
type ofBlock
.Multiplication A Multiplication block performs an element-wise multiplication of inputs and weights as opposed to aLinear
block which additionally sums up each element-wise multiplication.Multiplication.Builder The Builder to construct aMultiplication
type ofBlock
.Prelu Applies Leaky Parametric ReLU activation element-wise to the input.SparseMax SparseMax
contains a generic implementation of sparsemax function the definition of SparseMax can be referred to https://arxiv.org/pdf/1602.02068.pdf.