pyabsa.tasks.AspectPolarityClassification.models.__lcf__.dlcf_dca_bert¶
Classes¶
A two-feed-forward-layer module |
|
Base class for all neural network modules. |
Functions¶
|
Module Contents¶
- pyabsa.tasks.AspectPolarityClassification.models.__lcf__.dlcf_dca_bert.weight_distrubute_local(bert_local_out, depend_weight, depended_weight, depend_vec, depended_vec, config)¶
- class pyabsa.tasks.AspectPolarityClassification.models.__lcf__.dlcf_dca_bert.PointwiseFeedForward(d_hid, d_inner_hid=None, d_out=None, dropout=0)¶
Bases:
torch.nn.ModuleA two-feed-forward-layer module
- w_1¶
- w_2¶
- dropout¶
- relu¶
- forward(x)¶
- class pyabsa.tasks.AspectPolarityClassification.models.__lcf__.dlcf_dca_bert.DLCF_DCA_BERT(bert, config)¶
Bases:
torch.nn.ModuleBase class for all neural network modules.
Your models should also subclass this class.
Modules can also contain other Modules, allowing them to be nested in a tree structure. You can assign the submodules as regular attributes:
import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self) -> None: super().__init__() self.conv1 = nn.Conv2d(1, 20, 5) self.conv2 = nn.Conv2d(20, 20, 5) def forward(self, x): x = F.relu(self.conv1(x)) return F.relu(self.conv2(x))
Submodules assigned in this way will be registered, and will also have their parameters converted when you call
to(), etc.Note
As per the example above, an
__init__()call to the parent class must be made before assignment on the child.- Variables:
training (bool) – Boolean represents whether this module is in training or evaluation mode.
- inputs = ['text_indices', 'text_raw_bert_indices', 'dlcf_vec', 'depend_vec', 'depended_vec']¶
- bert4global¶
- bert4local¶
- config¶
- dropout¶
- bert_SA_¶
- mean_pooling_double¶
- bert_pooler¶
- dense¶
- dca_sa¶
- dca_pool¶
- dca_lin¶
- weight_calculate(sa, pool, lin, d_w, ded_w, depend_out, depended_out)¶
- forward(inputs)¶