You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2020/07/15 12:39:15 UTC
[GitHub] [submarine] andrewhsiehth opened a new pull request #346: SUBMARINE-561. [SDK] Add PyTorch implementation of AFM model
andrewhsiehth opened a new pull request #346:
URL: https://github.com/apache/submarine/pull/346
### What is this PR for?
Add PyTorch implementation of Attentional Factorization Machine for CTR prediction. ([AFM](https://arxiv.org/pdf/1708.04617.pdf))
Make minor modifications to the PyTorch training flow.
Add testing for the AFM model.
### What type of PR is it?
[Improvement]
### Todos
* [ ] - Task
### What is the Jira issue?
https://issues.apache.org/jira/browse/SUBMARINE-561
### How should this be tested?
[python-sdk](https://github.com/andrewhsiehth/submarine/actions/runs/169985131)
[Submarine](https://github.com/andrewhsiehth/submarine/actions/runs/169985125)
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] pingsutw commented on pull request #346: SUBMARINE-561. [SDK] Add PyTorch implementation of AFM model
Posted by GitBox <gi...@apache.org>.
pingsutw commented on pull request #346:
URL: https://github.com/apache/submarine/pull/346#issuecomment-662307227
+1, Thanks @andrewhsiehth
Will commit if no more comment.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] pingsutw commented on a change in pull request #346: SUBMARINE-561. [SDK] Add PyTorch implementation of AFM model
Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #346:
URL: https://github.com/apache/submarine/pull/346#discussion_r456747255
##########
File path: submarine-sdk/pysubmarine/submarine/ml/pytorch/model/ctr/afm.py
##########
@@ -0,0 +1,94 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import torch
+from torch import nn
+
+from submarine.ml.pytorch.layers.core import (FeatureEmbedding, FeatureLinear)
+from submarine.ml.pytorch.model.base_pytorch_model import BasePyTorchModel
+
+
+class AttentionalFM(BasePyTorchModel):
Review comment:
```suggestion
class AFM(BasePyTorchModel):
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [submarine] andrewhsiehth commented on pull request #346: SUBMARINE-561. [SDK] Add PyTorch implementation of AFM model
Posted by GitBox <gi...@apache.org>.
andrewhsiehth commented on pull request #346:
URL: https://github.com/apache/submarine/pull/346#issuecomment-662506079
@pingsutw Thanks for your suggestions and review.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org