diff --git a/fluid/PaddleRec/multiview-simnet/README.md b/fluid/PaddleRec/multiview-simnet/README.md index fc38a59cd9f9ba562143bb6687431e9b6fb53915..7df116b83626c48ea83db9a9ea318160c095791c 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 f5700e4719046657028439e826fddaa61ce9fb74..9cb2e791c90198547b136ecc1382352a5cd16686 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 9e4b76336973295c022e14ec79a64becf726f3d6..b80d0947ebeb2f5e4e8130963bb75b8568af1bab 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 cecf642587f1b703a21dd50b34b21edb9218190b..fb2f291a1e5aef70e6b826cabdcf412a249df163 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