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
NDArrays.AnAbstractEmbeddingwhere each embedded item can be assigned an integer index.AnAbstractIndexedEmbeddingthat always returns a constant value.Embedding<T>An Embedding block map a collection of items to 1-Dimensional representativeNDArrays.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 aLinearCollectiontype ofBlock.A Multiplication block performs an element-wise multiplication of inputs and weights as opposed to aLinearblock which additionally sums up each element-wise multiplication.The Builder to construct aMultiplicationtype ofBlock.Applies Leaky Parametric ReLU activation element-wise to the input.SparseMaxcontains a generic implementation of sparsemax function the definition of SparseMax can be referred to https://arxiv.org/pdf/1602.02068.pdf.