public class LSTMLayer extends DynamicCustomOp
LSTMLayerWeights
LSTMLayerConfig
Output arrays:
0: output h - rank 3 or 4, depends on DirectionMode and dataFormat
1: output at last step hL - rank 3 or 4, depends on DirectionMode and dataFormat<
2: cell state at last step cL - same shape as in hL
DynamicCustomOp.DynamicCustomOpsBuilder
axis, bArguments, dArguments, iArguments, inplaceCall, inputArguments, outputArguments, outputVariables, tArguments
dimensions, extraArgs, inPlace, sameDiff, scalarValue
Constructor and Description |
---|
LSTMLayer(INDArray x,
INDArray cLast,
INDArray yLast,
INDArray maxTSLength,
LSTMLayerWeights lstmWeights,
LSTMLayerConfig LSTMLayerConfig) |
LSTMLayer(@NonNull SameDiff sameDiff,
SDVariable x,
SDVariable cLast,
SDVariable yLast,
SDVariable maxTSLength,
LSTMLayerWeights weights,
LSTMLayerConfig configuration) |
Modifier and Type | Method and Description |
---|---|
protected <T> boolean[] |
bArgs(LSTMLayerWeights weights,
T maxTSLength,
T yLast,
T cLast) |
List<DataType> |
calculateOutputDataTypes(List<DataType> inputDataTypes)
Calculate the data types for the output arrays.
|
String |
configFieldName()
Returns the name of the field to be used for looking up field names.
|
List<SDVariable> |
doDiff(List<SDVariable> grads)
The actual implementation for automatic differentiation.
|
int |
getNumOutputs() |
long[] |
iArgs() |
boolean |
isConfigProperties()
Returns true if the fields for this class should be looked up from a configuration class.
|
String |
opName()
This method returns op opName as string
|
Map<String,Object> |
propertiesForFunction()
Returns the properties for a given function
|
double[] |
tArgs() |
addBArgument, addDArgument, addIArgument, addIArgument, addInputArgument, addOutputArgument, addTArgument, assertValidForExecution, bArgs, builder, calculateOutputShape, calculateOutputShape, clearArrays, dArgs, getBArgument, getDescriptor, getIArgument, getInputArgument, getOutputArgument, getTArgument, initFromOnnx, initFromTensorFlow, inputArguments, numBArguments, numDArguments, numIArguments, numInputArguments, numOutputArguments, numTArguments, onnxName, opHash, opNum, opType, outputArguments, outputVariables, outputVariables, removeIArgument, removeInputArgument, removeOutputArgument, removeTArgument, setInputArgument, setInputArguments, setOutputArgument, tensorflowName, toString, wrapFilterNull, wrapOrNull, wrapOrNull
arg, arg, argNames, args, attributeAdaptersForFunction, diff, dup, equals, getValue, hashCode, larg, mappingsForFunction, onnxNames, outputs, outputVariable, outputVariablesNames, rarg, replaceArg, setInstanceId, setPropertiesForFunction, setValueFor, tensorflowNames
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isInplaceCall
public LSTMLayer(@NonNull @NonNull SameDiff sameDiff, SDVariable x, SDVariable cLast, SDVariable yLast, SDVariable maxTSLength, LSTMLayerWeights weights, LSTMLayerConfig configuration)
public LSTMLayer(INDArray x, INDArray cLast, INDArray yLast, INDArray maxTSLength, LSTMLayerWeights lstmWeights, LSTMLayerConfig LSTMLayerConfig)
public List<DataType> calculateOutputDataTypes(List<DataType> inputDataTypes)
DifferentialFunction
DifferentialFunction.calculateOutputShape()
, this method differs in that it does not
require the input arrays to be populated.
This is important as it allows us to do greedy datatype inference for the entire net - even if arrays are not
available.calculateOutputDataTypes
in class DifferentialFunction
inputDataTypes
- The data types of the inputspublic List<SDVariable> doDiff(List<SDVariable> grads)
DifferentialFunction
doDiff
in class DynamicCustomOp
public String opName()
DynamicCustomOp
opName
in interface CustomOp
opName
in class DynamicCustomOp
public Map<String,Object> propertiesForFunction()
DifferentialFunction
propertiesForFunction
in class DifferentialFunction
public long[] iArgs()
iArgs
in interface CustomOp
iArgs
in class DynamicCustomOp
public double[] tArgs()
tArgs
in interface CustomOp
tArgs
in class DynamicCustomOp
protected <T> boolean[] bArgs(LSTMLayerWeights weights, T maxTSLength, T yLast, T cLast)
public boolean isConfigProperties()
DifferentialFunction
isConfigProperties
in class DifferentialFunction
public String configFieldName()
DifferentialFunction
DifferentialFunction.isConfigProperties()
to facilitate mapping fields for model import.configFieldName
in class DifferentialFunction
public int getNumOutputs()
getNumOutputs
in class DifferentialFunction
Copyright © 2020. All rights reserved.