Package ai.djl.nn.transformer
Class PointwiseFeedForwardBlock
- java.lang.Object
-
- ai.djl.nn.AbstractBlock
-
- ai.djl.nn.SequentialBlock
-
- ai.djl.nn.transformer.PointwiseFeedForwardBlock
-
- All Implemented Interfaces:
Block
public class PointwiseFeedForwardBlock extends SequentialBlock
Fully connected Feed-Forward network, only applied to the last dimension of the input.
-
-
Field Summary
-
Fields inherited from class ai.djl.nn.AbstractBlock
children, inputNames, inputShapes, parameters, version
-
-
Constructor Summary
Constructors Constructor Description PointwiseFeedForwardBlock(java.util.List<java.lang.Integer> hiddenSizes, int outputSize, java.util.function.Function<NDList,NDList> activationFunction)Creates a pointwise feed-forward block.
-
Method Summary
-
Methods inherited from class ai.djl.nn.SequentialBlock
add, add, addAll, addAll, addSingleton, forwardInternal, forwardInternal, getOutputShapes, initializeChildBlocks, loadMetadata, removeLastBlock, replaceLastBlock, toString
-
Methods inherited from class ai.djl.nn.AbstractBlock
addChildBlock, addParameter, beforeInitialize, cast, clear, describeInput, forward, forward, getChildren, getDirectParameters, getParameters, initialize, isInitialized, loadParameters, prepare, readInputShapes, saveInputShapes, saveMetadata, saveParameters, setInitializer, setInitializer, setInitializer
-
-
-
-
Constructor Detail
-
PointwiseFeedForwardBlock
public PointwiseFeedForwardBlock(java.util.List<java.lang.Integer> hiddenSizes, int outputSize, java.util.function.Function<NDList,NDList> activationFunction)Creates a pointwise feed-forward block.- Parameters:
hiddenSizes- the sizes of the hidden layersoutputSize- the output sizeactivationFunction- the activation function to use for the hidden layers (not applied to output)
-
-