提交 ccf54e5b 编写于 作者: D dongdaxiang

license added

上级 329750de
...@@ -19,8 +19,8 @@ python train.py ...@@ -19,8 +19,8 @@ python train.py
The command line options for inference can be listed by `python infer.py -h` The command line options for inference can be listed by `python infer.py -h`
## Future work ## Future work
# Multiple types of pairwise loss will be added in this project. For different views of features between a user and an item, multiple losses will be supported. The model will be verified in real world dataset. ### Multiple types of pairwise loss will be added in this project. For different views of features between a user and an item, multiple losses will be supported. The model will be verified in real world dataset.
# infer will be added ### infer will be added
# Parallel Executor will be added in this project ### Parallel Executor will be added in this project
# Distributed Training will be added ### Distributed Training will be added
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import paddle.fluid as fluid import paddle.fluid as fluid
Embedding=fluid.layers.embedding Embedding=fluid.layers.embedding
FC=fluid.layers.fc FC=fluid.layers.fc
...@@ -76,10 +77,13 @@ class GrnnEncoder(object): ...@@ -76,10 +77,13 @@ class GrnnEncoder(object):
return fluid.layers.sequence_pool(input=gru_h, return fluid.layers.sequence_pool(input=gru_h,
pool_type='max') pool_type='max')
'''this is a very simple Encoder factory
most default argument values are used'''
class SimpleEncoderFactory(object): class SimpleEncoderFactory(object):
def __init__(self): def __init__(self):
pass pass
''' create an encoder through create function '''
def create(self, enc_type, enc_hid_size): def create(self, enc_type, enc_hid_size):
if enc_type == "bow": if enc_type == "bow":
bow_encode = BowEncoder() bow_encode = BowEncoder()
......
#Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed 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 random import random
class Dataset: class Dataset:
......
#Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved
#
# Licensed 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 os import os
import sys import sys
import time import time
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册