Package ai.djl.nn.core
package ai.djl.nn.core
Contains classes that define simple neural network operations.
-
ClassDescriptionAn Embedding maps elements of type T to a 1-Dimensional representative
NDArray
s.AnAbstractEmbedding
where each embedded item can be assigned an integer index.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>> A Linear block applies a linear transformation \(Y = XW^T + b\).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\).The Builder to construct aLinearCollection
type ofBlock
.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.The Builder to construct aMultiplication
type ofBlock
.Applies Leaky Parametric ReLU activation element-wise to the input.SparseMax
contains a generic implementation of sparsemax function the definition of SparseMax can be referred to https://arxiv.org/pdf/1602.02068.pdf.