mltk.core.TfliteUnidirectionalLstmLayer¶
- class TfliteUnidirectionalLstmLayer[source]¶
UNIDIRECTIONAL_SEQUENCE_LSTM operation TfliteLayer
Properties
Fused activation
Input tensor data
Cell gate bias tensor of size {n_cell}
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
The cell state tensor is defined as variable tensor, and will be modified at runtime
(Optional) Peephole weights tensor of size {n_cell}, representing a diagonal matrix
(Optional) Peephole weights tensor of size {n_cell}, representing a diagonal matrix
(Optional) Peephole weights tensor of size {n_cell}, representing a diagonal matrix
Forget gate bias tensor of size {n_cell}
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
Index of this layer in the model
Input tensor data
(Optional) Input gate bias tensor of size {n_cell}
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
Input tensor of size {n_batch, n_input}
{n_cell, n_input}
{n_cell, n_input}
{n_cell, n_input}
{n_cell, n_input}
List of layer input tensor(s)
Return if this kernel uses time major or batch major
Additional key/value data to associated with layer
Reference to associated TfliteModel
Number of LSTM cells
Return the number of inputs
Return the number of outputs
op<index>-<OpCodeStr>
OpCode numeric value
OpCode as a string
Layer-specific options/config
Output tensor data
Output gate bias tensor of size {n_cell}
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
The output state tensor is defined as variable tensor, and will be modified at runtime
Output tensor data
List of layer output tensor(s)
Input tensor data
(Optional) Projection bias tensor of size {n_output}
(Optional) Projection weight tensor of size {n_output, n_cell}
Recurrent weight tensor of size {n_cell, n_output}
Recurrent weight tensor of size {n_cell, n_output}
(Optional) Recurrent weight tensor of size {n_cell, n_output}
Recurrent weight tensor of size {n_cell, n_output}
Methods
Instantiate a TfliteLayer from then given TfliteModel flatbuffer operation
Get layer input tensor as np.ndarray
Get layer input tensor as TfliteTensor
Layer output tensor as np.ndarray
Layer output tensor as TfliteTensor
get_tensor_name_value_tuples
- property options: TfliteUnidirectionalLstmLayerOptions¶
Layer-specific options/config
- Return type:
- property activation: str¶
Fused activation
- Return type:
str
- property is_time_major: bool¶
Return if this kernel uses time major or batch major
- Return type:
bool
- property cell_clip: float¶
Input tensor data
- Return type:
float
- property proj_clip: float¶
Input tensor data
- Return type:
float
- property n_cells: int¶
Number of LSTM cells
- Return type:
int
- property input_tensor: TfliteTensor¶
Input tensor of size {n_batch, n_input}
- Return type:
- property input_data: ndarray¶
Input tensor data
- Return type:
ndarray
- property output_tensor: TfliteTensor¶
Output tensor data
- Return type:
- property output_data: ndarray¶
Output tensor data
- Return type:
ndarray
- property input_to_input_weights_tensor: TfliteTensor¶
{n_cell, n_input}
- Type:
(Optional) Input weight tensor of size
- Return type:
- static from_flatbuffer(index, model, fb_operation)¶
Instantiate a TfliteLayer from then given TfliteModel flatbuffer operation
- Return type:
- Parameters:
index (int) –
model (TfliteModel) –
fb_operation (OperatorT) –
- get_input_data(index=0)¶
Get layer input tensor as np.ndarray
- Return type:
ndarray
- get_input_tensor(index=0)¶
Get layer input tensor as TfliteTensor
- Return type:
- get_output_data(index=0)¶
Layer output tensor as np.ndarray
- Return type:
ndarray
- get_output_tensor(index=0)¶
Layer output tensor as TfliteTensor
- Return type:
- property index: int¶
Index of this layer in the model
- Return type:
int
- property input_to_forget_weights_tensor: TfliteTensor¶
{n_cell, n_input}
- Type:
Input weight tensor of size
- Return type:
- property inputs: List[TfliteTensor]¶
List of layer input tensor(s)
- Return type:
List
[TfliteTensor
]
- property metadata: Dict[str, object]¶
Additional key/value data to associated with layer
- NOTE: This information is generated by the framework/Python scripts
(i.e. The information does NOT come from the .tflite model)
- Return type:
Dict
[str
,object
]
- property model: TfliteModel¶
Reference to associated TfliteModel
- Return type:
TypeVar
(TfliteModel
)
- property n_inputs: int¶
Return the number of inputs
- Return type:
int
- property n_outputs: int¶
Return the number of outputs
- Return type:
int
- property name: str¶
op<index>-<OpCodeStr>
- Type:
Name of current layer as
- Return type:
str
- property opcode: BuiltinOperator¶
OpCode numeric value
- Return type:
BuiltinOperator
- property opcode_str: str¶
OpCode as a string
- Return type:
str
- property outputs: List[TfliteTensor]¶
List of layer output tensor(s)
- Return type:
List
[TfliteTensor
]
- property input_to_cell_weights_tensor: TfliteTensor¶
{n_cell, n_input}
- Type:
Input weight tensor of size
- Return type:
- property input_to_output_weights_tensor: TfliteTensor¶
{n_cell, n_input}
- Type:
Input weight tensor of size
- Return type:
- property recurrent_to_input_weights_tensor: TfliteTensor¶
(Optional) Recurrent weight tensor of size {n_cell, n_output}
- Return type:
- property recurrent_to_forget_weights_tensor: TfliteTensor¶
Recurrent weight tensor of size {n_cell, n_output}
- Return type:
- property recurrent_to_cell_weights_tensor: TfliteTensor¶
Recurrent weight tensor of size {n_cell, n_output}
- Return type:
- property recurrent_to_output_weights_tensor: TfliteTensor¶
Recurrent weight tensor of size {n_cell, n_output}
- Return type:
- property cell_to_input_weights_tensor: TfliteTensor¶
(Optional) Peephole weights tensor of size {n_cell}, representing a diagonal matrix
- Return type:
- property cell_to_forget_weights_tensor: TfliteTensor¶
(Optional) Peephole weights tensor of size {n_cell}, representing a diagonal matrix
- Return type:
- property cell_to_output_weights_tensor: TfliteTensor¶
(Optional) Peephole weights tensor of size {n_cell}, representing a diagonal matrix
- Return type:
- property input_gate_bias_tensor: TfliteTensor¶
(Optional) Input gate bias tensor of size {n_cell}
- Return type:
- property forget_gate_bias_tensor: TfliteTensor¶
Forget gate bias tensor of size {n_cell}
- Return type:
- property cell_gate_bias_tensor: TfliteTensor¶
Cell gate bias tensor of size {n_cell}
- Return type:
- property output_gate_bias_tensor: TfliteTensor¶
Output gate bias tensor of size {n_cell}
- Return type:
- property projection_weights_tensor: TfliteTensor¶
(Optional) Projection weight tensor of size {n_output, n_cell}
- Return type:
- property projection_bias_tensor: TfliteTensor¶
(Optional) Projection bias tensor of size {n_output}
- Return type:
- property output_state_tensor: TfliteTensor¶
The output state tensor is defined as variable tensor, and will be modified at runtime
- Return type:
- property cell_state_tensor: TfliteTensor¶
The cell state tensor is defined as variable tensor, and will be modified at runtime
- Return type:
- property input_layer_norm_coeff_tensor: TfliteTensor¶
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
- Return type:
- property forget_layer_norm_coeff_tensor: TfliteTensor¶
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
- Return type:
- property cell_layer_norm_coeff_tensor: TfliteTensor¶
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
- Return type:
- property output_layer_norm_coeff_tensor: TfliteTensor¶
(Optional) Layer norm coefficient tensor of size {n_cell}, representing a diagonal matrix
- Return type: