用法:
class torchrec.modules.activation.SwishLayerNorm(input_dims:Union[int, List[int], torch.Size], device:Optional[torch.device] = None)
input_dims(Union[int, List[int], torch.Size]) - 要标准化的维度。如果输入张量的形状为 [batch_size, d1, d2, d3],则设置 input_dim=[d2, d3] 将对最后两个维度进行层归一化。
device(可选的[torch.device]) -默认计算设备。
基础:
torch.nn.modules.module.Module
应用带有层标准化的 Swish 函数:
Y = X * Sigmoid(LayerNorm(X))
。例子:
sln = SwishLayerNorm(100)
参数:
相关用法
- Python torchrec.modules.embedding_modules.EmbeddingBagCollection用法及代码示例
- Python torchrec.modules.deepfm.FactorizationMachine用法及代码示例
- Python torchrec.modules.deepfm.DeepFM.forward用法及代码示例
- Python torchrec.modules.lazy_extension.lazy_apply用法及代码示例
- Python torchrec.modules.mlp.Perceptron用法及代码示例
- Python torchrec.modules.crossnet.LowRankCrossNet用法及代码示例
- Python torchrec.modules.crossnet.VectorCrossNet用法及代码示例
- Python torchrec.modules.deepfm.FactorizationMachine.forward用法及代码示例
- Python torchrec.modules.lazy_extension.LazyModuleExtensionMixin.apply用法及代码示例
- Python torchrec.modules.deepfm.DeepFM用法及代码示例
- Python torchrec.modules.crossnet.CrossNet用法及代码示例
- Python torchrec.modules.mlp.MLP用法及代码示例
- Python torchrec.modules.embedding_modules.EmbeddingCollection用法及代码示例
- Python torchrec.modules.crossnet.LowRankMixtureCrossNet用法及代码示例
- Python torchrec.models.deepfm.DenseArch用法及代码示例
- Python torchrec.models.deepfm.SimpleDeepFMNN用法及代码示例
- Python torchrec.models.deepfm.FMInteractionArch用法及代码示例
- Python torchrec.models.dlrm.DLRM用法及代码示例
- Python torchrec.models.dlrm.OverArch用法及代码示例
- Python torchrec.models.dlrm.DenseArch用法及代码示例
注:本文由纯净天空筛选整理自pytorch.org大神的英文原创作品 torchrec.modules.activation.SwishLayerNorm。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。