T
- data type for weights()
output@Operator(group="nn") public final class CudnnRnnParamsToCanonical<T extends Number> extends PrimitiveOp
Retrieves a set of weights from the opaque params buffer that can be saved and restored in a way compatible with future runs.
Note that the params buffer may not be compatible across different GPUs. So any save and restoration should be converted to and from the canonical weights and biases.
num_layers: Specifies the number of layers in the RNN model. num_units: Specifies the size of the hidden state. input_size: Specifies the size of the input state. num_params: number of parameter sets for all layers. Each layer may contain multiple parameter sets, with each set consisting of a weight matrix and a bias vector. weights: the canonical form of weights that can be used for saving and restoration. They are more likely to be compatible across different generations. biases: the canonical form of biases that can be used for saving and restoration. They are more likely to be compatible across different generations. rnn_mode: Indicates the type of the RNN model. input_mode: Indicate whether there is a linear projection between the input and The actual computation before the first layer. 'skip_input' is only allowed when input_size == num_units; 'auto_select' implies 'skip_input' when input_size == num_units; otherwise, it implies 'linear_input'. direction: Indicates whether a bidirectional model will be used. dir = (direction == bidirectional) ? 2 : 1 dropout: dropout probability. When set to 0., dropout is disabled. seed: the 1st part of a seed to initialize dropout. seed2: the 2nd part of a seed to initialize dropout.
Modifier and Type | Class and Description |
---|---|
static class |
CudnnRnnParamsToCanonical.Options
Optional attributes for
CudnnRnnParamsToCanonical |
operation
Modifier and Type | Method and Description |
---|---|
List<Output<T>> |
biases() |
static <T extends Number> |
create(Scope scope,
Operand<Integer> numLayers,
Operand<Integer> numUnits,
Operand<Integer> inputSize,
Operand<T> params,
Long numParams,
CudnnRnnParamsToCanonical.Options... options)
Factory method to create a class wrapping a new CudnnRnnParamsToCanonical operation.
|
static CudnnRnnParamsToCanonical.Options |
direction(String direction) |
static CudnnRnnParamsToCanonical.Options |
dropout(Float dropout) |
static CudnnRnnParamsToCanonical.Options |
inputMode(String inputMode) |
static CudnnRnnParamsToCanonical.Options |
rnnMode(String rnnMode) |
static CudnnRnnParamsToCanonical.Options |
seed(Long seed) |
static CudnnRnnParamsToCanonical.Options |
seed2(Long seed2) |
List<Output<T>> |
weights() |
equals, hashCode, op, toString
public static <T extends Number> CudnnRnnParamsToCanonical<T> create(Scope scope, Operand<Integer> numLayers, Operand<Integer> numUnits, Operand<Integer> inputSize, Operand<T> params, Long numParams, CudnnRnnParamsToCanonical.Options... options)
scope
- current scopenumLayers
- numUnits
- inputSize
- params
- numParams
- options
- carries optional attributes valuespublic static CudnnRnnParamsToCanonical.Options rnnMode(String rnnMode)
rnnMode
- public static CudnnRnnParamsToCanonical.Options inputMode(String inputMode)
inputMode
- public static CudnnRnnParamsToCanonical.Options direction(String direction)
direction
- public static CudnnRnnParamsToCanonical.Options dropout(Float dropout)
dropout
- public static CudnnRnnParamsToCanonical.Options seed(Long seed)
seed
- public static CudnnRnnParamsToCanonical.Options seed2(Long seed2)
seed2
- Copyright © 2022. All rights reserved.