public class PointwiseFeedForwardBlock extends AbstractBlock
children, inputNames, inputShapes, parameters, parameterShapeCallbacks, version| Constructor and Description |
|---|
PointwiseFeedForwardBlock(java.util.List<java.lang.Integer> hiddenSizes,
int outputSize,
java.util.function.Function<NDList,NDList> activationFunction)
Creates a pointwise feed-forward block.
|
| Modifier and Type | Method and Description |
|---|---|
protected NDList |
forwardInternal(ParameterStore ps,
NDList inputs,
boolean training,
ai.djl.util.PairList<java.lang.String,java.lang.Object> params) |
Shape[] |
getOutputShapes(NDManager manager,
Shape[] inputShapes)
Returns the expected output shapes of the block for the specified input shapes.
|
void |
initializeChildBlocks(NDManager manager,
DataType dataType,
Shape... inputShapes)
Initializes the Child blocks of this block.
|
addChildBlock, addParameter, addParameter, addParameter, beforeInitialize, cast, clear, describeInput, forward, getChildren, getDirectParameters, getParameters, getParameterShape, initialize, isInitialized, loadMetadata, loadParameters, readInputShapes, saveInputShapes, saveMetadata, saveParameters, setInitializer, setInitializer, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforward, forward, validateLayoutpublic PointwiseFeedForwardBlock(java.util.List<java.lang.Integer> hiddenSizes,
int outputSize,
java.util.function.Function<NDList,NDList> activationFunction)
hiddenSizes - the sizes of the hidden layersoutputSize - the output sizeactivationFunction - the activation function to use for the hidden layers (not applied
to output)public Shape[] getOutputShapes(NDManager manager, Shape[] inputShapes)
manager - an NDManagerinputShapes - the shapes of the inputspublic void initializeChildBlocks(NDManager manager, DataType dataType, Shape... inputShapes)
initializeChildBlocks in class AbstractBlockmanager - the manager to use for initializationdataType - the requested data typeinputShapes - the expected input shapes for this blockprotected NDList forwardInternal(ParameterStore ps, NDList inputs, boolean training, ai.djl.util.PairList<java.lang.String,java.lang.Object> params)
forwardInternal in class AbstractBlock