LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
deeplima::eigen_impl::Op_BiLSTM< M, V, T > Class Template Reference

#include <deeplima/eigen_wrp/bilstm.h>

Inheritance diagram for deeplima::eigen_impl::Op_BiLSTM< M, V, T >:
deeplima::eigen_impl::Op_Base

Classes

struct  workbench_t

Public Types

typedef params_multilayer_bilstm_t< M, V > params_t
typedef V Vector

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 > params, size_t input_begin, size_t input_end, Vector &fw_h, Vector &fw_c, Vector &bw_h, Vector &bw_c)
virtual size_t execute (std::shared_ptr< Op_Base::workbench_t > pwb, const M &input_matrix, const std::shared_ptr< param_base_t > params, const size_t input_begin, const size_t input_end)
Public Member Functions inherited from deeplima::eigen_impl::Op_Base
virtual ~Op_Base ()

Protected Member Functions

void forward_pass (size_t hidden_size, const params_lstm_t< M, V > &fw, M &input, V &s, V &g_u, V &g_o, V &g_if, V &c, M &output, const V &initial_h, int begin, int end)
void backward_pass (size_t hidden_size, const params_lstm_t< M, V > &bw, M &input, V &s, V &g_u, V &g_o, V &g_if, V &c, M &output, const V &initial_h, int begin, int end)
void step_fw (size_t hidden_size, size_t t, const V &s, V &g_u, V &g_o, V &g_if, V &c, M &output)
void step_bw (size_t hidden_size, size_t t, const V &s, V &g_u, V &g_o, V &g_if, V &c, M &output)

Static Protected Member Functions

static float my_tanh (float x)

Detailed Description

template<class M, class V, class T>
class deeplima::eigen_impl::Op_BiLSTM< M, V, T >

Definition at line 100 of file bilstm.h.

Member Typedef Documentation

◆ params_t

template<class M, class V, class T>
typedef params_multilayer_bilstm_t<M, V> deeplima::eigen_impl::Op_BiLSTM< M, V, T >::params_t

Definition at line 103 of file bilstm.h.

◆ Vector

template<class M, class V, class T>
typedef V deeplima::eigen_impl::Op_BiLSTM< M, V, T >::Vector

Definition at line 145 of file bilstm.h.

Member Function Documentation

◆ backward_pass()

template<class M, class V, class T>
void deeplima::eigen_impl::Op_BiLSTM< M, V, T >::backward_pass ( size_t hidden_size,
const params_lstm_t< M, V > & bw,
M & input,
V & s,
V & g_u,
V & g_o,
V & g_if,
V & c,
M & output,
const V & initial_h,
int begin,
int end )
inlineprotected

Definition at line 373 of file bilstm.h.

◆ create_workbench()

template<class M, class V, class T>
virtual std::shared_ptr< Op_Base::workbench_t > deeplima::eigen_impl::Op_BiLSTM< M, V, T >::create_workbench ( uint32_t input_size,
const std::shared_ptr< param_base_t > params,
bool precomputed_input = false ) const
inlineoverridevirtual

Implements deeplima::eigen_impl::Op_Base.

Definition at line 147 of file bilstm.h.

◆ execute() [1/2]

template<class M, class V, class T>
virtual size_t deeplima::eigen_impl::Op_BiLSTM< M, V, T >::execute ( std::shared_ptr< Op_Base::workbench_t > pwb,
const M & input_matrix,
const std::shared_ptr< param_base_t > params,
const size_t input_begin,
const size_t input_end )
inlinevirtual

Definition at line 259 of file bilstm.h.

◆ execute() [2/2]

template<class M, class V, class T>
virtual size_t deeplima::eigen_impl::Op_BiLSTM< M, V, T >::execute ( std::shared_ptr< Op_Base::workbench_t > pwb,
const M & input_matrix,
const std::shared_ptr< param_base_t > params,
size_t input_begin,
size_t input_end,
Vector & fw_h,
Vector & fw_c,
Vector & bw_h,
Vector & bw_c )
inlinevirtual

Definition at line 176 of file bilstm.h.

◆ forward_pass()

template<class M, class V, class T>
void deeplima::eigen_impl::Op_BiLSTM< M, V, T >::forward_pass ( size_t hidden_size,
const params_lstm_t< M, V > & fw,
M & input,
V & s,
V & g_u,
V & g_o,
V & g_if,
V & c,
M & output,
const V & initial_h,
int begin,
int end )
inlineprotected

Definition at line 348 of file bilstm.h.

◆ my_tanh()

template<class M, class V, class T>
float deeplima::eigen_impl::Op_BiLSTM< M, V, T >::my_tanh ( float x)
inlinestaticprotected

Definition at line 439 of file bilstm.h.

◆ precompute_inputs()

template<class M, class V, class T>
virtual void deeplima::eigen_impl::Op_BiLSTM< M, V, T >::precompute_inputs ( const std::shared_ptr< param_base_t > params,
const M & inputs,
M & outputs,
int64_t first_column )
inlinevirtual

Definition at line 161 of file bilstm.h.

◆ step_bw()

template<class M, class V, class T>
void deeplima::eigen_impl::Op_BiLSTM< M, V, T >::step_bw ( size_t hidden_size,
size_t t,
const V & s,
V & g_u,
V & g_o,
V & g_if,
V & c,
M & output )
inlineprotected

Definition at line 419 of file bilstm.h.

◆ step_fw()

template<class M, class V, class T>
void deeplima::eigen_impl::Op_BiLSTM< M, V, T >::step_fw ( size_t hidden_size,
size_t t,
const V & s,
V & g_u,
V & g_o,
V & g_if,
V & c,
M & output )
inlineprotected

Definition at line 399 of file bilstm.h.

◆ supports_precomputing()

template<class M, class V, class T>
virtual bool deeplima::eigen_impl::Op_BiLSTM< M, V, T >::supports_precomputing ( ) const
inlinevirtual

Definition at line 156 of file bilstm.h.


The documentation for this class was generated from the following file:
  • deeplima/include/deeplima/eigen_wrp/bilstm.h