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:
StreamingBlock,Block
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, parametersFields inherited from class ai.djl.nn.AbstractBaseBlock
inputNames, inputShapes, outputDataTypes, version -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class ai.djl.nn.SequentialBlock
add, add, add, addAll, addAll, addSingleton, addSingleton, forwardInternal, forwardInternal, forwardStreamIter, getOutputShapes, initializeChildBlocks, isReturnIntermediate, loadMetadata, removeLastBlock, replaceLastBlock, saveMetadata, setReturnIntermediateMethods inherited from class ai.djl.nn.AbstractBlock
addChildBlock, addChildBlock, addChildBlockSingleton, addParameter, getChildren, getDirectParametersMethods inherited from class ai.djl.nn.AbstractBaseBlock
beforeInitialize, cast, clear, describeInput, forward, forward, getInputShapes, getOutputDataTypes, getParameters, initialize, isInitialized, loadParameters, prepare, readInputShapes, saveInputShapes, saveParameters, setInitializer, setInitializer, setInitializer, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.djl.nn.Block
cast, clear, describeInput, forward, forward, forward, freezeParameters, freezeParameters, getChildren, getDirectParameters, getInputShapes, getOutputDataTypes, getOutputShapes, getParameters, initialize, isInitialized, loadParameters, saveParameters, setInitializer, setInitializer, setInitializerMethods inherited from interface ai.djl.inference.streaming.StreamingBlock
forwardStream, forwardStream
-
Constructor Details
-
PointwiseFeedForwardBlock
public PointwiseFeedForwardBlock(List<Integer> hiddenSizes, int outputSize, 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)
-