mltk.core.TfliteFullyConnectedLayer¶
- class TfliteFullyConnectedLayer[source]¶
FULLY_CONNECT operation TfliteLayer
Properties
Number of weights to accumulate
Fused activation
Bias tensor data (None if no bias used)
Bias tensor data (None if no bias used)
Index of this layer in the model
Input tensor data
Input tensor data
List of layer input tensor(s)
Additional key/value data to associated with layer
Reference to associated TfliteModel
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 tensor data
List of layer output tensor(s)
Calculated layer parameters
Number of neurons
Return if the layer uses a bias
Weights tensor data
Weights tensor data
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
- property options: TfliteFullyConnectedLayerOptions¶
Layer-specific options/config
- Return type:
- property accumulator_depth: int¶
Number of weights to accumulate
- Return type:
int
- property units: int¶
Number of neurons
- Return type:
int
- property activation: str¶
Fused activation
- Return type:
str
- property use_bias: bool¶
Return if the layer uses a bias
- Return type:
bool
- property input_tensor: TfliteTensor¶
Input tensor data
- Return type:
- property input_data: ndarray¶
Input tensor data
- Return type:
ndarray
- property weights_tensor: TfliteTensor¶
Weights tensor data
- Return type:
- property weights_data: ndarray¶
Weights tensor data
- Return type:
ndarray
- property bias_tensor: TfliteTensor¶
Bias tensor data (None if no bias used)
- Return type:
- property bias_data: ndarray¶
Bias tensor data (None if no bias used)
- Return type:
ndarray
- property output_tensor: TfliteTensor¶
Output tensor data
- Return type:
- property output_data: ndarray¶
Output tensor data
- Return type:
ndarray
- property params: TfliteFullyConnectedParams¶
Calculated layer parameters
- 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 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
]