Package ai.djl.nn.transformer
Class PointwiseFeedForwardBlock
- java.lang.Object
-
- ai.djl.nn.AbstractBaseBlock
-
- 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, parameters
-
Fields inherited from class ai.djl.nn.AbstractBaseBlock
inputNames, inputShapes, 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, add, addAll, addAll, addSingleton, addSingleton, forwardInternal, forwardInternal, getOutputShapes, initializeChildBlocks, isReturnIntermediate, loadMetadata, removeLastBlock, replaceLastBlock, saveMetadata, setReturnIntermediate
-
Methods inherited from class ai.djl.nn.AbstractBlock
addChildBlock, addChildBlock, addChildBlockSingleton, addParameter, getChildren, getDirectParameters
-
Methods inherited from class ai.djl.nn.AbstractBaseBlock
beforeInitialize, cast, clear, describeInput, forward, forward, getInputShapes, getParameters, initialize, isInitialized, loadParameters, prepare, readInputShapes, saveInputShapes, saveParameters, setInitializer, setInitializer, setInitializer, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ai.djl.nn.Block
forward, freezeParameters
-
-
-
-
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)
-
-