24 #ifndef ARM_COMPUTE_LSTMPARAMS_H 25 #define ARM_COMPUTE_LSTMPARAMS_H 41 : _input_to_input_weights(nullptr),
42 _recurrent_to_input_weights(nullptr),
43 _cell_to_input_weights(nullptr),
44 _input_gate_bias(nullptr),
45 _cell_to_forget_weights(nullptr),
46 _cell_to_output_weights(nullptr),
47 _projection_weights(nullptr),
48 _projection_bias(nullptr),
49 _input_layer_norm_weights(nullptr),
50 _forget_layer_norm_weights(nullptr),
51 _cell_layer_norm_weights(nullptr),
52 _output_layer_norm_weights(nullptr),
54 _projection_clip(0.0f),
55 _input_intermediate_scale(0.0f),
56 _forget_intermediate_scale(0.0f),
57 _cell_intermediate_scale(0.0f),
58 _output_intermediate_scale(0.0f),
59 _hidden_state_zero(0),
60 _hidden_state_scale(0.0f),
61 _has_peephole_opt(false),
62 _has_projection(false),
64 _use_layer_norm(false)
88 _has_cifg_opt =
false;
102 _has_projection =
true;
116 _has_peephole_opt =
true;
135 _use_layer_norm =
true;
197 return _input_to_input_weights;
202 return _recurrent_to_input_weights;
207 return _cell_to_input_weights;
212 return _input_gate_bias;
217 return _cell_to_forget_weights;
222 return _cell_to_output_weights;
227 return _projection_weights;
232 return _projection_bias;
237 return _input_layer_norm_weights;
242 return _forget_layer_norm_weights;
247 return _cell_layer_norm_weights;
252 return _output_layer_norm_weights;
262 return _projection_clip;
267 return _input_intermediate_scale;
272 return _forget_intermediate_scale;
277 return _cell_intermediate_scale;
282 return _output_intermediate_scale;
287 return _hidden_state_zero;
292 return _hidden_state_scale;
297 return _has_peephole_opt;
302 return _has_projection;
307 return _has_cifg_opt;
312 return _use_layer_norm;
316 const T *_input_to_input_weights;
317 const T *_recurrent_to_input_weights;
318 T *_cell_to_input_weights;
319 const T *_input_gate_bias;
320 T *_cell_to_forget_weights;
321 T *_cell_to_output_weights;
322 const T *_projection_weights;
323 const T *_projection_bias;
324 T *_input_layer_norm_weights;
325 T *_forget_layer_norm_weights;
326 T *_cell_layer_norm_weights;
327 T *_output_layer_norm_weights;
329 float _projection_clip;
330 float _input_intermediate_scale;
331 float _forget_intermediate_scale;
332 float _cell_intermediate_scale;
333 float _output_intermediate_scale;
334 int32_t _hidden_state_zero;
335 float _hidden_state_scale;
336 bool _has_peephole_opt;
337 bool _has_projection;
339 bool _use_layer_norm;
~LSTMParams()=default
Default destructor.
const T * projection_weights() const
const T * input_to_input_weights() const
bool use_layer_norm() const
bool has_peephole_opt() const
LSTMParams & set_cifg_params(const T *input_to_input_weights, const T *recurrent_to_input_weights, T *cell_to_input_weights, const T *input_gate_bias)
Set CIFG tensor parameters.
LSTMParams & set_cell_clip_params(float cell_clip)
Set cell clip value.
T * forget_layer_norm_weights() const
float output_intermediate_scale() const
bool has_cifg_opt() const
float cell_intermediate_scale() const
float forget_intermediate_scale() const
LSTMParams & set_hidden_state_params(int32_t hidden_state_zero, float hidden_state_scale)
Set hidden state zero and scale parameters.
T * cell_to_input_weights() const
Copyright (c) 2017-2023 Arm Limited.
const T * recurrent_to_input_weights() const
int32_t hidden_state_zero() const
const T * projection_bias() const
T * output_layer_norm_weights() const
float input_intermediate_scale() const
float hidden_state_scale() const
LSTMParams & set_matmul_scale_params(float input_intermediate_scale, float forget_intermediate_scale, float cell_intermediate_scale, float output_intermediate_scale)
Set scale of the intermediate results of matmul of each layer parameters.
LSTMParams & set_projection_params(const T *projection_weights, const T *projection_bias)
Set projection tensor parameters.
LSTMParams & set_layer_normalization_params(T *input_layer_norm_weights, T *forget_layer_norm_weights, T *cell_layer_norm_weights, T *output_layer_norm_weights)
Set layer normalization tensor parameters.
T * cell_to_forget_weights() const
LSTMParams & set_projection_clip_params(float projection_clip)
Set projection clip value.
LSTMParams & set_peephole_params(T *cell_to_forget_weights, T *cell_to_output_weights)
Set peephole tensor parameters.
bool has_projection() const
float projection_clip() const
T * cell_to_output_weights() const
T * input_layer_norm_weights() const
const T * input_gate_bias() const
T * cell_layer_norm_weights() const
LSTMParams & operator=(const LSTMParams &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...