![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
Fusion of several torch modules implemented for inference in Eigen. More...
#include <deeplima/eigen_wrp/bilstm_and_dense.h>
Classes | |
| struct | workbench_t |
| struct | params_bilstm_dense_argmax_t |
Public Types | |
| typedef params_bilstm_dense_argmax_t | params_t |
Public Member Functions | |
| virtual std::shared_ptr< Op_Base::workbench_t > | create_workbench (uint32_t input_size, const std::shared_ptr< param_base_t > params, bool precomputed_input=false) const override |
| virtual bool | supports_precomputing () const |
| virtual void | precompute_inputs (const std::shared_ptr< param_base_t > params, const M &inputs, M &outputs, int64_t first_column) |
| virtual size_t | execute (std::shared_ptr< Op_Base::workbench_t > pwb, const M &input_matrix, const std::shared_ptr< param_base_t > pparams, std::vector< std::vector< uint8_t > > &final_output, size_t input_begin, size_t input_end, size_t output_begin, size_t output_end) |
| Public Member Functions inherited from deeplima::eigen_impl::Op_Base | |
| virtual | ~Op_Base () |
Protected Types | |
| typedef AuxScalar | fixed_point_t |
| using | MatrixWeight |
| using | MatrixInput |
Protected Member Functions | |
| void | forward_pass (const size_t hidden_size, Eigen::Ref< const M > input, const MatrixWeight &weight_hh, V &s, V &c, M &output) |
| void | backward_pass (const size_t hidden_size, Eigen::Ref< const M > input, const MatrixWeight &weight_hh, V &s, V &c, M &output) |
| void | update_c (const size_t hidden_size, const V &s, V &c) |
| void | step_fw (const size_t hidden_size, const size_t t, const V &s, V &c, M &output) |
| void | step_bw (const size_t hidden_size, const size_t t, const V &s, V &c, M &output) |
Static Protected Member Functions | |
| static constexpr fixed_point_t | pow2 (int bits) |
Static Protected Attributes | |
| static constexpr fixed_point_t | WEIGHT_FRACTION_MULT = pow2(WFracBits) |
| static constexpr fixed_point_t | DATA_FRACTION_MULT = pow2(IFracBits) |
| static constexpr fixed_point_t | WEIGHT_DATA_FRACTION_MULT = pow2(WFracBits + IFracBits) |
Fusion of several torch modules implemented for inference in Eigen.
Precomputed inputs. The x of each gate is fasttext embeddings. They can be computed during model loading. This is done in precompute_inputs. This takes a very long time. This can be done in the first layer only
forward_pass is different for fixed point and non-fixed point
The implementation with factorization is less efficient while it should be more.
In linear layer on top of RNN outputs.
In fixed, only last step is in fixed because some necessary functions (tanh…) are not implemented in fixed but quicker nevertheless
Definition at line 55 of file bilstm_and_dense.h.
|
protected |
Definition at line 61 of file bilstm_and_dense.h.
|
protected |
Definition at line 65 of file bilstm_and_dense.h.
|
protected |
Definition at line 62 of file bilstm_and_dense.h.
| typedef params_bilstm_dense_argmax_t deeplima::eigen_impl::Op_BiLSTM_Dense_ArgMax< M, V, T, AuxScalar, IFracBits, WFracBits >::params_t |
Definition at line 195 of file bilstm_and_dense.h.
|
inlineprotected |
Definition at line 554 of file bilstm_and_dense.h.
|
inlineoverridevirtual |
Implements deeplima::eigen_impl::Op_Base.
Definition at line 197 of file bilstm_and_dense.h.
|
inlinevirtual |
Definition at line 249 of file bilstm_and_dense.h.
|
inlineprotected |
Definition at line 457 of file bilstm_and_dense.h.
|
inlinestaticconstexprprotected |
Definition at line 72 of file bilstm_and_dense.h.
|
inlinevirtual |
Definition at line 223 of file bilstm_and_dense.h.
|
inlineprotected |
Definition at line 621 of file bilstm_and_dense.h.
|
inlineprotected |
Definition at line 607 of file bilstm_and_dense.h.
|
inlinevirtual |
Definition at line 218 of file bilstm_and_dense.h.
|
inlineprotected |
Definition at line 594 of file bilstm_and_dense.h.
|
staticconstexprprotected |
Definition at line 80 of file bilstm_and_dense.h.
|
staticconstexprprotected |
Definition at line 81 of file bilstm_and_dense.h.
|
staticconstexprprotected |
Definition at line 79 of file bilstm_and_dense.h.