From ccf54e5bdc785860078f6da568b19502b0c1ca04 Mon Sep 17 00:00:00 2001 From: dongdaxiang Date: Sat, 27 Oct 2018 21:58:16 +0800 Subject: [PATCH] license added --- fluid/PaddleRec/multiview-simnet/README.md | 8 ++++---- fluid/PaddleRec/multiview-simnet/nets.py | 4 ++++ fluid/PaddleRec/multiview-simnet/reader.py | 14 ++++++++++++++ fluid/PaddleRec/multiview-simnet/train.py | 14 ++++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/fluid/PaddleRec/multiview-simnet/README.md b/fluid/PaddleRec/multiview-simnet/README.md index fc38a59c..7df116b8 100644 --- a/fluid/PaddleRec/multiview-simnet/README.md +++ b/fluid/PaddleRec/multiview-simnet/README.md @@ -19,8 +19,8 @@ python train.py The command line options for inference can be listed by `python infer.py -h` ## 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. -# infer will be added -# Parallel Executor will be added in this project -# Distributed Training will be added +### 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 +### Parallel Executor will be added in this project +### Distributed Training will be added diff --git a/fluid/PaddleRec/multiview-simnet/nets.py b/fluid/PaddleRec/multiview-simnet/nets.py index f5700e47..9cb2e791 100644 --- a/fluid/PaddleRec/multiview-simnet/nets.py +++ b/fluid/PaddleRec/multiview-simnet/nets.py @@ -11,6 +11,7 @@ # 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 paddle.fluid as fluid Embedding=fluid.layers.embedding FC=fluid.layers.fc @@ -76,10 +77,13 @@ class GrnnEncoder(object): return fluid.layers.sequence_pool(input=gru_h, pool_type='max') +'''this is a very simple Encoder factory +most default argument values are used''' class SimpleEncoderFactory(object): def __init__(self): pass + ''' create an encoder through create function ''' def create(self, enc_type, enc_hid_size): if enc_type == "bow": bow_encode = BowEncoder() diff --git a/fluid/PaddleRec/multiview-simnet/reader.py b/fluid/PaddleRec/multiview-simnet/reader.py index 9e4b7633..b80d0947 100644 --- a/fluid/PaddleRec/multiview-simnet/reader.py +++ b/fluid/PaddleRec/multiview-simnet/reader.py @@ -1,3 +1,17 @@ +#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 class Dataset: diff --git a/fluid/PaddleRec/multiview-simnet/train.py b/fluid/PaddleRec/multiview-simnet/train.py index cecf6425..fb2f291a 100644 --- a/fluid/PaddleRec/multiview-simnet/train.py +++ b/fluid/PaddleRec/multiview-simnet/train.py @@ -1,3 +1,17 @@ +#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 sys import time -- GitLab