tkitAttNLocal package

Submodules

tkitAttNLocal.attnlocal module

class tkitAttNLocal.attnlocal.AttNLocal(maxlen=128, limit=20)[源代码]

基类:torch.nn.modules.module.Module

自动限制矩阵

实现斜对角线保留

autoBulidlMaskLimit()[源代码]

构建一个矩阵 自动限制 预测长度

forward(x)[源代码]

Defines the computation performed at every call.

Should be overridden by all subclasses.

注解

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool

tkitAttNLocal.attnlocalNew module

class tkitAttNLocal.attnlocalNew.AttNLocalNew(maxlen=128, limit=20)[源代码]

基类:torch.nn.modules.module.Module

自动限制矩阵

实现斜对角线保留权重,其他的设为-inf

forward(x)[源代码]

Defines the computation performed at every call.

Should be overridden by all subclasses.

注解

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool

Module contents