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

#include <deeplima/eigen_wrp/lstm_beam_decoder.h>

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

Classes

struct  decoding_timepoint_t
 
struct  workbench_t
 

Public Types

typedef params_lstm_beam_decoder_t< M, V > params_t
 

Public Member Functions

virtual std::shared_ptr< Op_Base::workbench_t > create_workbench (uint32_t, 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 EmbdUInt64Float &embd, const V &initial_state_h, const V &initial_state_c, const std::shared_ptr< param_base_t > params, const uint32_t start_code, const uint32_t stop_code, const size_t beam_size, std::vector< uint32_t > &output_seq, const size_t max_output_len)
 
- Public Member Functions inherited from deeplima::eigen_impl::Op_Base
virtual ~Op_Base ()
 

Protected Member Functions

void step_with_decoding (const params_lstm_t< M, V > &layer, const params_linear_t< M, V > &linear, Eigen::Ref< const M > &input, M &output, V &s, V &temp, const size_t hidden_size, const size_t beam_size, const size_t start_pos, std::vector< uint32_t > &top_classes, std::vector< uint32_t > indices, std::vector< float > &logprob, V &c, V &h)
 
void step_with_decoding (const params_lstm_t< M, V > &layer, const params_linear_t< M, V > &linear, Eigen::Ref< const M > &input, M &output, V &s, V &temp, const size_t hidden_size, const size_t beam_size, const size_t start_pos, std::vector< uint32_t > &top_classes, std::vector< uint32_t > indices, std::vector< float > &logprob, M &states_c, M &states_h, const size_t beam_idx)
 
void linear_and_decoding (const params_linear_t< M, V > &linear, const M &output, V &temp, const size_t beam_size, const size_t start_pos, std::vector< uint32_t > &top_classes, std::vector< uint32_t > indices, std::vector< float > &logprob)
 
void update_c (const size_t hidden_size, const V &s, V &c)
 
void update_c (const size_t hidden_size, const V &s, M &c, const size_t beam_idx)
 
void step_fw (const size_t hidden_size, const size_t t, const V &s, V &c, M &output)
 
void step_fw (const size_t hidden_size, const size_t t, const V &s, M &c, const size_t beam_idx, M &output)
 

Detailed Description

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

Definition at line 35 of file lstm_beam_decoder.h.

Member Typedef Documentation

◆ params_t

template<class M , class V , class T >
typedef params_lstm_beam_decoder_t<M, V> deeplima::eigen_impl::Op_LSTM_Beam_Decoder< M, V, T >::params_t

Definition at line 79 of file lstm_beam_decoder.h.

Member Function Documentation

◆ create_workbench()

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

Implements deeplima::eigen_impl::Op_Base.

Definition at line 81 of file lstm_beam_decoder.h.

◆ execute()

template<class M , class V , class T >
virtual size_t deeplima::eigen_impl::Op_LSTM_Beam_Decoder< M, V, T >::execute ( std::shared_ptr< Op_Base::workbench_t >  pwb,
const EmbdUInt64Float &  embd,
const V &  initial_state_h,
const V &  initial_state_c,
const std::shared_ptr< param_base_t >  params,
const uint32_t  start_code,
const uint32_t  stop_code,
const size_t  beam_size,
std::vector< uint32_t > &  output_seq,
const size_t  max_output_len 
)
inlinevirtual

Definition at line 107 of file lstm_beam_decoder.h.

◆ linear_and_decoding()

template<class M , class V , class T >
void deeplima::eigen_impl::Op_LSTM_Beam_Decoder< M, V, T >::linear_and_decoding ( const params_linear_t< M, V > &  linear,
const M &  output,
V &  temp,
const size_t  beam_size,
const size_t  start_pos,
std::vector< uint32_t > &  top_classes,
std::vector< uint32_t >  indices,
std::vector< float > &  logprob 
)
inlineprotected

Definition at line 374 of file lstm_beam_decoder.h.

◆ precompute_inputs()

template<class M , class V , class T >
virtual void deeplima::eigen_impl::Op_LSTM_Beam_Decoder< 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 98 of file lstm_beam_decoder.h.

◆ step_fw() [1/2]

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

Definition at line 454 of file lstm_beam_decoder.h.

◆ step_fw() [2/2]

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

Definition at line 440 of file lstm_beam_decoder.h.

◆ step_with_decoding() [1/2]

template<class M , class V , class T >
void deeplima::eigen_impl::Op_LSTM_Beam_Decoder< M, V, T >::step_with_decoding ( const params_lstm_t< M, V > &  layer,
const params_linear_t< M, V > &  linear,
Eigen::Ref< const M > &  input,
M &  output,
V &  s,
V &  temp,
const size_t  hidden_size,
const size_t  beam_size,
const size_t  start_pos,
std::vector< uint32_t > &  top_classes,
std::vector< uint32_t >  indices,
std::vector< float > &  logprob,
M &  states_c,
M &  states_h,
const size_t  beam_idx 
)
inlineprotected

Definition at line 346 of file lstm_beam_decoder.h.

◆ step_with_decoding() [2/2]

template<class M , class V , class T >
void deeplima::eigen_impl::Op_LSTM_Beam_Decoder< M, V, T >::step_with_decoding ( const params_lstm_t< M, V > &  layer,
const params_linear_t< M, V > &  linear,
Eigen::Ref< const M > &  input,
M &  output,
V &  s,
V &  temp,
const size_t  hidden_size,
const size_t  beam_size,
const size_t  start_pos,
std::vector< uint32_t > &  top_classes,
std::vector< uint32_t >  indices,
std::vector< float > &  logprob,
V &  c,
V &  h 
)
inlineprotected

Definition at line 319 of file lstm_beam_decoder.h.

◆ supports_precomputing()

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

Definition at line 93 of file lstm_beam_decoder.h.

◆ update_c() [1/2]

template<class M , class V , class T >
void deeplima::eigen_impl::Op_LSTM_Beam_Decoder< M, V, T >::update_c ( const size_t  hidden_size,
const V &  s,
M &  c,
const size_t  beam_idx 
)
inlineprotected

Definition at line 426 of file lstm_beam_decoder.h.

◆ update_c() [2/2]

template<class M , class V , class T >
void deeplima::eigen_impl::Op_LSTM_Beam_Decoder< M, V, T >::update_c ( const size_t  hidden_size,
const V &  s,
V &  c 
)
inlineprotected

Definition at line 413 of file lstm_beam_decoder.h.


The documentation for this class was generated from the following file: