24 #ifndef ARM_COMPUTE_LSTMPARAMS_H 25 #define ARM_COMPUTE_LSTMPARAMS_H 43 : _input_to_input_weights(nullptr),
44 _recurrent_to_input_weights(nullptr),
45 _cell_to_input_weights(nullptr),
46 _input_gate_bias(nullptr),
47 _cell_to_forget_weights(nullptr),
48 _cell_to_output_weights(nullptr),
49 _projection_weights(nullptr),
50 _projection_bias(nullptr),
51 _input_layer_norm_weights(nullptr),
52 _forget_layer_norm_weights(nullptr),
53 _cell_layer_norm_weights(nullptr),
54 _output_layer_norm_weights(nullptr),
56 _projection_clip(0.0f),
57 _input_intermediate_scale(0.0f),
58 _forget_intermediate_scale(0.0f),
59 _cell_intermediate_scale(0.0f),
60 _output_intermediate_scale(0.0f),
61 _hidden_state_zero(0),
62 _hidden_state_scale(0.0f),
63 _has_peephole_opt(false),
64 _has_projection(false),
66 _use_layer_norm(false)
90 _has_cifg_opt =
false;
104 _has_projection =
true;
118 _has_peephole_opt =
true;
137 _use_layer_norm =
true;
199 return _input_to_input_weights;
204 return _recurrent_to_input_weights;
209 return _cell_to_input_weights;
214 return _input_gate_bias;
219 return _cell_to_forget_weights;
224 return _cell_to_output_weights;
229 return _projection_weights;
234 return _projection_bias;
239 return _input_layer_norm_weights;
244 return _forget_layer_norm_weights;
249 return _cell_layer_norm_weights;
254 return _output_layer_norm_weights;
264 return _projection_clip;
269 return _input_intermediate_scale;
274 return _forget_intermediate_scale;
279 return _cell_intermediate_scale;
284 return _output_intermediate_scale;
289 return _hidden_state_zero;
294 return _hidden_state_scale;
299 return _has_peephole_opt;
304 return _has_projection;
309 return _has_cifg_opt;
314 return _use_layer_norm;
318 const T *_input_to_input_weights;
319 const T *_recurrent_to_input_weights;
320 T *_cell_to_input_weights;
321 const T *_input_gate_bias;
322 T *_cell_to_forget_weights;
323 T *_cell_to_output_weights;
324 const T *_projection_weights;
325 const T *_projection_bias;
326 T *_input_layer_norm_weights;
327 T *_forget_layer_norm_weights;
328 T *_cell_layer_norm_weights;
329 T *_output_layer_norm_weights;
331 float _projection_clip;
332 float _input_intermediate_scale;
333 float _forget_intermediate_scale;
334 float _cell_intermediate_scale;
335 float _output_intermediate_scale;
336 int32_t _hidden_state_zero;
337 float _hidden_state_scale;
338 bool _has_peephole_opt;
339 bool _has_projection;
341 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-2021 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) ...