本文简要介绍python语言中 torchrec.models.dlrm.InteractionArch 的用法。
- 用法:- class torchrec.models.dlrm.InteractionArch(sparse_feature_names: List[str])
- sparse_feature_names(List[str]) -尺寸 F 
- 基础: - torch.nn.modules.module.Module- 处理 - SparseArch(sparse_features) 和- DenseArch(dense_features) 的输出。返回每个稀疏特征对的成对点积,每个稀疏特征与密集层输出的点积,以及密集层本身(全部连接)。- 注意 - dense_features(D) 的维度预计与- sparse_features的维度匹配,以便可以计算它们之间的点积。- 例子: - D = 3 B = 10 keys = ["f1", "f2"] F = len(keys) inter_arch = InteractionArch(sparse_feature_names=keys) dense_features = torch.rand((B, D)) sparse_features = KeyedTensor( keys=keys, length_per_key=[D, D], values=torch.rand((B, D * F)), ) # B X (D + F + F choose 2) concat_dense = inter_arch(dense_features, sparse_features)
参数:
相关用法
- Python PyTorch Interpreter用法及代码示例
- Python PyTorch InMemoryCacheHolder用法及代码示例
- Python PyTorch IndexAdder用法及代码示例
- Python PyTorch InMemoryBinaryCriteoIterDataPipe用法及代码示例
- Python PyTorch Independent用法及代码示例
- Python PyTorch InstanceNorm2d用法及代码示例
- Python PyTorch InstanceNorm3d用法及代码示例
- Python PyTorch InstanceNorm1d用法及代码示例
- Python PyTorch InProjContainer.forward用法及代码示例
- Python PyTorch InverseSpectrogram用法及代码示例
- Python PyTorch IterDataPipe用法及代码示例
- Python PyTorch IterableDataset用法及代码示例
- Python PyTorch IoPathSaver用法及代码示例
- Python PyTorch Identity用法及代码示例
- Python PyTorch IoPathFileOpener用法及代码示例
- Python PyTorch IoPathFileLister用法及代码示例
- Python PyTorch ImageFolder用法及代码示例
- Python PyTorch IWSLT2016用法及代码示例
- Python PyTorch IterKeyZipper用法及代码示例
- Python PyTorch IterableWrapper用法及代码示例
- Python PyTorch IWSLT2017用法及代码示例
- Python PyTorch frexp用法及代码示例
- Python PyTorch jvp用法及代码示例
- Python PyTorch cholesky用法及代码示例
- Python PyTorch vdot用法及代码示例
注:本文由纯净天空筛选整理自pytorch.org大神的英文原创作品 torchrec.models.dlrm.InteractionArch。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
