LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
deeplima::EmbdDict< K, M, I > Class Template Reference

#include <deeplima/eigen_wrp/embd_dict.h>

Inheritance diagram for deeplima::EmbdDict< K, M, I >:
deeplima::FeatureVectorizerToMatrix< Matrix, Type, Idx > deeplima::FeatureVectorizerBase< Idx >

Public Types

typedef K value_t
 
typedef M tensor_t
 
typedef I index_t
 

Public Member Functions

 EmbdDict ()=default
 
virtual ~EmbdDict ()
 
template<class T >
void init (std::shared_ptr< Dict< T > > dict, const M &tensor, bool transpose=true)
 
virtual I dim () const override
 
virtual void get (const K key, M &target, I timepoint, I pos) const override
 
void get_direct (const I idx, M &target, I timepoint, I pos) const
 
Eigen::Ref< const M > get_ref_by_idx (const I idx) const
 
Eigen::Ref< const M > get_ref_by_key (const K key) const
 
void get_static (const K key, M &target, I timepoint, I pos) const
 
const M & get_tensor () const
 
void set_tensor (const M &new_embd)
 
K decode (const I idx) const
 
I lookup (const K key) const
 
- Public Member Functions inherited from deeplima::FeatureVectorizerToMatrix< Matrix, Type, Idx >
virtual ~FeatureVectorizerToMatrix ()=default
 
virtual void get (const Type value, Matrix &target, Idx time, Idx pos) const =0
 
- Public Member Functions inherited from deeplima::FeatureVectorizerBase< Idx >
virtual ~FeatureVectorizerBase ()=default
 

Protected Attributes

I m_dim
 
M m_embd
 
std::unordered_map< K, I > m_index
 
std::unordered_map< I, K > m_reverse_index
 

Detailed Description

template<class K, class M, class I = Eigen::Index>
class deeplima::EmbdDict< K, M, I >

Definition at line 23 of file embd_dict.h.

Member Typedef Documentation

◆ index_t

template<class K , class M , class I = Eigen::Index>
typedef I deeplima::EmbdDict< K, M, I >::index_t

Definition at line 28 of file embd_dict.h.

◆ tensor_t

template<class K , class M , class I = Eigen::Index>
typedef M deeplima::EmbdDict< K, M, I >::tensor_t

Definition at line 27 of file embd_dict.h.

◆ value_t

template<class K , class M , class I = Eigen::Index>
typedef K deeplima::EmbdDict< K, M, I >::value_t

Definition at line 26 of file embd_dict.h.

Constructor & Destructor Documentation

◆ EmbdDict()

template<class K , class M , class I = Eigen::Index>
deeplima::EmbdDict< K, M, I >::EmbdDict ( )
default

◆ ~EmbdDict()

template<class K , class M , class I = Eigen::Index>
virtual deeplima::EmbdDict< K, M, I >::~EmbdDict ( )
inlinevirtual

Definition at line 31 of file embd_dict.h.

Member Function Documentation

◆ decode()

template<class K , class M , class I = Eigen::Index>
K deeplima::EmbdDict< K, M, I >::decode ( const I  idx) const
inline

Definition at line 102 of file embd_dict.h.

◆ dim()

template<class K , class M , class I = Eigen::Index>
virtual I deeplima::EmbdDict< K, M, I >::dim ( ) const
inlineoverridevirtual

Implements deeplima::FeatureVectorizerBase< Idx >.

Definition at line 55 of file embd_dict.h.

◆ get()

template<class K , class M , class I = Eigen::Index>
virtual void deeplima::EmbdDict< K, M, I >::get ( const K  key,
M &  target,
I  timepoint,
I  pos 
) const
inlineoverridevirtual

Definition at line 64 of file embd_dict.h.

◆ get_direct()

template<class K , class M , class I = Eigen::Index>
void deeplima::EmbdDict< K, M, I >::get_direct ( const I  idx,
M &  target,
I  timepoint,
I  pos 
) const
inline

Definition at line 69 of file embd_dict.h.

◆ get_ref_by_idx()

template<class K , class M , class I = Eigen::Index>
Eigen::Ref< const M > deeplima::EmbdDict< K, M, I >::get_ref_by_idx ( const I  idx) const
inline

Definition at line 74 of file embd_dict.h.

◆ get_ref_by_key()

template<class K , class M , class I = Eigen::Index>
Eigen::Ref< const M > deeplima::EmbdDict< K, M, I >::get_ref_by_key ( const K  key) const
inline

Definition at line 79 of file embd_dict.h.

◆ get_static()

template<class K , class M , class I = Eigen::Index>
void deeplima::EmbdDict< K, M, I >::get_static ( const K  key,
M &  target,
I  timepoint,
I  pos 
) const
inline

Definition at line 85 of file embd_dict.h.

◆ get_tensor()

template<class K , class M , class I = Eigen::Index>
const M & deeplima::EmbdDict< K, M, I >::get_tensor ( ) const
inline

Definition at line 91 of file embd_dict.h.

◆ init()

template<class K , class M , class I = Eigen::Index>
template<class T >
void deeplima::EmbdDict< K, M, I >::init ( std::shared_ptr< Dict< T > >  dict,
const M &  tensor,
bool  transpose = true 
)
inline

Definition at line 34 of file embd_dict.h.

◆ lookup()

template<class K , class M , class I = Eigen::Index>
I deeplima::EmbdDict< K, M, I >::lookup ( const K  key) const
inline

Definition at line 108 of file embd_dict.h.

◆ set_tensor()

template<class K , class M , class I = Eigen::Index>
void deeplima::EmbdDict< K, M, I >::set_tensor ( const M &  new_embd)
inline

Definition at line 96 of file embd_dict.h.

Member Data Documentation

◆ m_dim

template<class K , class M , class I = Eigen::Index>
I deeplima::EmbdDict< K, M, I >::m_dim
protected

Definition at line 115 of file embd_dict.h.

◆ m_embd

template<class K , class M , class I = Eigen::Index>
M deeplima::EmbdDict< K, M, I >::m_embd
protected

Definition at line 116 of file embd_dict.h.

◆ m_index

template<class K , class M , class I = Eigen::Index>
std::unordered_map<K, I> deeplima::EmbdDict< K, M, I >::m_index
protected

Definition at line 117 of file embd_dict.h.

◆ m_reverse_index

template<class K , class M , class I = Eigen::Index>
std::unordered_map<I, K> deeplima::EmbdDict< K, M, I >::m_reverse_index
protected

Definition at line 118 of file embd_dict.h.


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