LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
deeplima::nets::torch_modules::LSTMwRecDropoutImpl Class Reference

An LSTM implementation that supports recurrent dropout. More...

#include </home/runner/work/lima/lima/deeplima/libs/nn/torch_modules/stanza_models_depparse_model.h>

Inheritance diagram for deeplima::nets::torch_modules::LSTMwRecDropoutImpl:

Public Member Functions

 LSTMwRecDropoutImpl ()=default
 
 LSTMwRecDropoutImpl (int64_t input_size, int64_t hidden_size, int64_t num_layers, bool bias=true, bool batch_first=false, float dropout=0, bool bidirectional=false, bool pad=false, float rec_dropout=0)
 
std::pair< torch::Tensor, std::pair< torch::Tensor, torch::Tensor > > rnn_loop (torch::Tensor x, torch::Tensor batch_sizes, torch::nn::LSTMCellImpl *cell, std::vector< torch::Tensor > inits, bool reverse=false)
 RNN loop for one layer in one direction with recurrent dropout Assumes input is PackedSequence, returns PackedSequence as well.
 
std::tuple< torch::nn::utils::rnn::PackedSequence, std::tuple< torch::Tensor, torch::Tensor > > forward (torch::nn::utils::rnn::PackedSequence input, torch::optional< std::tuple< torch::Tensor, torch::Tensor > > hx={})
 

Public Attributes

bool batch_first
 
bool pad
 
int64_t num_layers
 
int64_t hidden_size
 
float dropout
 
torch::nn::Dropout drop
 
torch::nn::Dropout rec_drop
 
int64_t num_directions
 
torch::nn::ModuleList cells
 

Detailed Description

An LSTM implementation that supports recurrent dropout.

Definition at line 68 of file stanza_models_depparse_model.h.

Constructor & Destructor Documentation

◆ LSTMwRecDropoutImpl() [1/2]

deeplima::nets::torch_modules::LSTMwRecDropoutImpl::LSTMwRecDropoutImpl ( )
default

◆ LSTMwRecDropoutImpl() [2/2]

deeplima::nets::torch_modules::LSTMwRecDropoutImpl::LSTMwRecDropoutImpl ( int64_t  input_size,
int64_t  hidden_size,
int64_t  num_layers,
bool  bias = true,
bool  batch_first = false,
float  dropout = 0,
bool  bidirectional = false,
bool  pad = false,
float  rec_dropout = 0 
)
inline

Definition at line 72 of file stanza_models_depparse_model.h.

Member Function Documentation

◆ forward()

std::tuple< torch::nn::utils::rnn::PackedSequence, std::tuple< torch::Tensor, torch::Tensor > > deeplima::nets::torch_modules::LSTMwRecDropoutImpl::forward ( torch::nn::utils::rnn::PackedSequence  input,
torch::optional< std::tuple< torch::Tensor, torch::Tensor > >  hx = {} 
)
inline

Definition at line 172 of file stanza_models_depparse_model.h.

◆ rnn_loop()

std::pair< torch::Tensor, std::pair< torch::Tensor, torch::Tensor > > deeplima::nets::torch_modules::LSTMwRecDropoutImpl::rnn_loop ( torch::Tensor  x,
torch::Tensor  batch_sizes,
torch::nn::LSTMCellImpl *  cell,
std::vector< torch::Tensor >  inits,
bool  reverse = false 
)
inline

RNN loop for one layer in one direction with recurrent dropout Assumes input is PackedSequence, returns PackedSequence as well.

Definition at line 96 of file stanza_models_depparse_model.h.

Member Data Documentation

◆ batch_first

bool deeplima::nets::torch_modules::LSTMwRecDropoutImpl::batch_first

Definition at line 218 of file stanza_models_depparse_model.h.

◆ cells

torch::nn::ModuleList deeplima::nets::torch_modules::LSTMwRecDropoutImpl::cells

Definition at line 229 of file stanza_models_depparse_model.h.

◆ drop

torch::nn::Dropout deeplima::nets::torch_modules::LSTMwRecDropoutImpl::drop

Definition at line 224 of file stanza_models_depparse_model.h.

◆ dropout

float deeplima::nets::torch_modules::LSTMwRecDropoutImpl::dropout

Definition at line 223 of file stanza_models_depparse_model.h.

◆ hidden_size

int64_t deeplima::nets::torch_modules::LSTMwRecDropoutImpl::hidden_size

Definition at line 221 of file stanza_models_depparse_model.h.

◆ num_directions

int64_t deeplima::nets::torch_modules::LSTMwRecDropoutImpl::num_directions

Definition at line 227 of file stanza_models_depparse_model.h.

◆ num_layers

int64_t deeplima::nets::torch_modules::LSTMwRecDropoutImpl::num_layers

Definition at line 220 of file stanza_models_depparse_model.h.

◆ pad

bool deeplima::nets::torch_modules::LSTMwRecDropoutImpl::pad

Definition at line 219 of file stanza_models_depparse_model.h.

◆ rec_drop

torch::nn::Dropout deeplima::nets::torch_modules::LSTMwRecDropoutImpl::rec_drop

Definition at line 225 of file stanza_models_depparse_model.h.


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