Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
fix core, afm coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
ifndef012 committed Jul 18, 2020
1 parent adae613 commit 9ff2f8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions submarine-sdk/pysubmarine/submarine/ml/pytorch/layers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, num_features, out_features):
def forward(self, feature_idx, feature_value):
"""
:param feature_idx: torch.LongTensor (batch_size, num_fields)
:param feature_value: torch.LongTensor (batch_size, num_fields)
:param feature_value: torch.LongTensor (batch_size, num_fields)
"""
return torch.sum(
self.weight(feature_idx) * feature_value.unsqueeze(dim=-1),
Expand All @@ -51,7 +51,7 @@ def __init__(self, num_features, embedding_dim):
def forward(self, feature_idx, feature_value):
"""
:param feature_idx: torch.LongTensor (batch_size, num_fields)
:param feature_value: torch.LongTensor (batch_size, num_fields)
:param feature_value: torch.LongTensor (batch_size, num_fields)
"""
return self.weight(feature_idx) * feature_value.unsqueeze(dim=-1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, embedding_dim: int, attention_dim: int,

def forward(self, x: torch.FloatTensor):
"""
:param x: torch.FloatTensor (batch_size, num_fields, embedding_dim)
:param x: torch.FloatTensor (batch_size, num_fields, embedding_dim)
"""
x = self.pairwise_product(x)
score = self.attention_score(x)
Expand All @@ -85,7 +85,7 @@ def __init__(self):

def forward(self, x: torch.FloatTensor):
"""
:param x: torch.FloatTensor (batch_sie, num_fields, embedding_dim)
:param x: torch.FloatTensor (batch_sie, num_fields, embedding_dim)
"""
batch_size, num_fields, embedding_dim = x.size()

Expand Down

0 comments on commit 9ff2f8d

Please sign in to comment.