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

A word dropout layer that's designed for embedded inputs (e.g., any inputs to an LSTM layer). More...

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

Inheritance diagram for deeplima::nets::torch_modules::WordDropoutImpl:

Public Member Functions

 WordDropoutImpl ()=default
 WordDropoutImpl (int64_t dropprob)
torch::Tensor forward (torch::Tensor x, torch::Tensor replacement=torch::Tensor())
std::string extra_repr ()

Public Attributes

int64_t dropprob

Detailed Description

A word dropout layer that's designed for embedded inputs (e.g., any inputs to an LSTM layer).

Given a batch of embedded inputs, this layer randomly set some of them to be a replacement state. Note that this layer assumes the last dimension of the input to be the hidden dimension of a unit.

Definition at line 30 of file stanza_models_depparse_model.h.

Constructor & Destructor Documentation

◆ WordDropoutImpl() [1/2]

deeplima::nets::torch_modules::WordDropoutImpl::WordDropoutImpl ( )
default

◆ WordDropoutImpl() [2/2]

deeplima::nets::torch_modules::WordDropoutImpl::WordDropoutImpl ( int64_t dropprob)
inline

Definition at line 34 of file stanza_models_depparse_model.h.

Member Function Documentation

◆ extra_repr()

std::string deeplima::nets::torch_modules::WordDropoutImpl::extra_repr ( )
inline

Definition at line 58 of file stanza_models_depparse_model.h.

◆ forward()

torch::Tensor deeplima::nets::torch_modules::WordDropoutImpl::forward ( torch::Tensor x,
torch::Tensor replacement = torch::Tensor() )
inline

Definition at line 40 of file stanza_models_depparse_model.h.

Member Data Documentation

◆ dropprob

int64_t deeplima::nets::torch_modules::WordDropoutImpl::dropprob

Definition at line 63 of file stanza_models_depparse_model.h.


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