|
virtual ITensor * | addInput (const char *name, DataType type, Dims dimensions)=0 |
| add an input tensor to the network More...
|
|
virtual void | markOutput (ITensor &tensor)=0 |
| mark a tensor as a network output More...
|
|
virtual IConvolutionLayer * | addConvolution (ITensor &input, int nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0 |
| add a convolution layer to the network More...
|
|
virtual IFullyConnectedLayer * | addFullyConnected (ITensor &input, int nbOutputs, Weights kernelWeights, Weights biasWeights)=0 |
| add a fully connected layer to the network More...
|
|
virtual IActivationLayer * | addActivation (ITensor &input, ActivationType type)=0 |
| add an activation layer to the network More...
|
|
virtual IPoolingLayer * | addPooling (ITensor &input, PoolingType type, DimsHW windowSize)=0 |
| add a pooling layer to the network More...
|
|
virtual ILRNLayer * | addLRN (ITensor &input, int window, float alpha, float beta, float k)=0 |
| add a LRN layer to the network More...
|
|
virtual IScaleLayer * | addScale (ITensor &input, ScaleMode mode, Weights shift, Weights scale, Weights power)=0 |
| add a Scale layer to the network More...
|
|
virtual ISoftMaxLayer * | addSoftMax (ITensor &input)=0 |
| add a Scale layer to the network More...
|
|
virtual IConcatenationLayer * | addConcatenation (ITensor *const *inputs, int nbInputs)=0 |
| add a concatenation layer to the network More...
|
|
virtual IDeconvolutionLayer * | addDeconvolution (ITensor &input, int nbOutputMaps, DimsHW kernelSize, Weights kernelWeights, Weights biasWeights)=0 |
| add a deconvolution layer to the network More...
|
|
virtual IElementWiseLayer * | addElementWise (ITensor &input1, ITensor &input2, ElementWiseOperation op)=0 |
| add an elementwise layer to the network More...
|
|
virtual IRNNLayer * | addRNN (ITensor &inputs, int layerCount, std::size_t hiddenSize, int maxSeqLen, RNNOperation op, RNNInputMode mode, RNNDirection dir, Weights weights, Weights bias)=0 |
| add an layerCount deep RNN layer to the network with a sequence length of maxSeqLen and hiddenSize internal state per layer. More...
|
|
virtual IPluginLayer * | addPlugin (ITensor *const *inputs, int nbInputs, IPlugin &plugin)=0 |
| add a plugin layer to the network More...
|
|
virtual IUnaryLayer * | addUnary (ITensor &input, UnaryOperation operation)=0 |
| Add a unary layer to the network. More...
|
|
virtual IPaddingLayer * | addPadding (ITensor &input, DimsHW prePadding, DimsHW postPadding)=0 |
| Add a padding layer to the network. More...
|
|
virtual IShuffleLayer * | addShuffle (ITensor &input)=0 |
| add a shuffle layer to the network More...
|
|
virtual void | setPoolingOutputDimensionsFormula (IOutputDimensionsFormula *formula)=0 |
| set the pooling output dimensions formula More...
|
|
virtual IOutputDimensionsFormula & | getPoolingOutputDimensionsFormula () const =0 |
| get the pooling output dimensions formula More...
|
|
virtual void | setConvolutionOutputDimensionsFormula (IOutputDimensionsFormula *formula)=0 |
| set the convolution output dimensions formula More...
|
|
virtual IOutputDimensionsFormula & | getConvolutionOutputDimensionsFormula () const =0 |
| get the convolution output dimensions formula More...
|
|
virtual void | setDeconvolutionOutputDimensionsFormula (IOutputDimensionsFormula *formula)=0 |
| set the deconvolution output dimensions formula More...
|
|
virtual IOutputDimensionsFormula & | getDeconvolutionOutputDimensionsFormula () const =0 |
| get the deconvolution output dimensions formula More...
|
|
virtual int | getNbLayers () const =0 |
| get the number of layers in the network More...
|
|
virtual ILayer * | getLayer (int index) const =0 |
| get the layer specified by the given index More...
|
|
virtual int | getNbInputs () const =0 |
| get the number of inputs in the network More...
|
|
virtual ITensor * | getInput (int index) const =0 |
| get the input tensor specified by the given index More...
|
|
virtual int | getNbOutputs () const =0 |
| get the number of outputs in the network More...
|
|
virtual ITensor * | getOutput (int index) const =0 |
| get the output tensor specified by the given index More...
|
|
virtual void | destroy ()=0 |
| destroy this INetworkDefinition object
|
|
a network definition for input to the builder
add an layerCount
deep RNN layer to the network with a sequence length of maxSeqLen
and hiddenSize
internal state per layer.
- Parameters
-
inputs | the input tensor to the layer. |
layerCount | the number of layers in the RNN. |
hiddenSize | the size of the internal hidden state for each layer. |
maxSeqLen | the maximum length of the time sequence. |
op | the type of RNN to execute. |
mode | the input mode for the RNN. |
dir | the direction to run the RNN. |
weights | the weights for the weight matrix parameters of the RNN. |
bias | the weights for the bias vectors parameters of the RNN. |
The layout for the input
tensor is {1, T, N, C} and defined as follows:
- T - The number of time sequences to be executed.
- N - The number of mini-batches for each time sequence.
- C - The size of data to be submitted to the RNN.
The input tensors must be of the type DataType::kFLOAT or DataType::kHALF. The layout of the weights is row major and must be the same datatype as the input tensor. weights
contain 8 matrices and bias
contains 8 vectors.
The RNN layer outputs up to three tensors. The first tensor has dim {1, T, N, C}, is the output of the RNN for each timestep, and defined as follows:
- T - The number of sequences to be executed.
- N - The number of mini-batches for each time sequence.
- C - The hidden state for each layer. Equal to getHiddenSize() if getDirection is RNNDirection::kUNIDIRECTION, and 2x getHiddenSize() otherwise.
The second tensor has dimension {1, L, N, H}, is the final hidden state of the RNN, and defined as follows.
- L - The number of layers in the RNN, equal to getLayerCount()
- N - The number of mini-batches for each time sequence.
- H - The hidden state for each layer. Equal to getHiddenSize() if getDirection is RNNDirection::kUNIDIRECTION, and 2x getHiddenSize() otherwise.
The third tensor has dimension {1, L, N, H}, is the final cell state of the RNN, and defined as follows.
- L - The number of layers in the RNN, equal to getLayerCount()
- N - The number of mini-batches for each time sequence.
- H - The hidden state for each layer. Equal to getHiddenSize() if getDirection is RNNDirection::kUNIDIRECTION, and 2x getHiddenSize() otherwise.
The third tensor is only available if getOperation() is RNNDirection::kLSTM.
- Returns
- the new RNN layer, or null if it could not be created.
- See Also
- IRNNLayer::setW(), IRNNLayer::setU(), IRNNLayer::setB()
-
IRNNLayer