From 0cab80c0c6063c1cb7beafd4ffa80283f620895f Mon Sep 17 00:00:00 2001 From: tangwei Date: Fri, 15 May 2020 16:32:02 +0800 Subject: [PATCH] add license and bug fix --- core/engine/cluster/cloud/cluster.sh | 2 +- core/engine/cluster/cluster.py | 4 ++-- core/engine/engine.py | 14 ++++++++++++++ core/engine/local_cluster.py | 2 +- core/engine/local_mpi.py | 2 +- core/layer.py | 8 +------- core/model.py | 14 ++++++++++++++ core/modules/modul/build.py | 14 ++++++++++++++ core/trainers/tdm_cluster_trainer.py | 4 +--- core/trainers/tdm_single_trainer.py | 4 +--- models/match/multiview-simnet/evaluate_reader.py | 2 +- .../multiview-simnet/generate_synthetic_data.py | 2 +- models/match/multiview-simnet/reader.py | 2 +- models/rank/dcn/model.py | 14 ++++++++++++++ models/rank/deepfm/model.py | 14 ++++++++++++++ models/rank/din/model.py | 14 ++++++++++++++ models/rank/wide_deep/model.py | 14 ++++++++++++++ models/rank/xdeepfm/model.py | 14 ++++++++++++++ models/recall/gnn/evaluate_reader.py | 2 +- models/recall/gnn/reader.py | 2 +- models/recall/word2vec/preprocess.py | 14 ++++++++++++++ models/recall/word2vec/w2v_evaluate_reader.py | 2 +- models/recall/word2vec/w2v_reader.py | 2 +- run.py | 14 ++++++++++++++ tools/tools.py | 14 ++++++++++++++ 25 files changed, 169 insertions(+), 25 deletions(-) diff --git a/core/engine/cluster/cloud/cluster.sh b/core/engine/cluster/cloud/cluster.sh index c2e984b8..1140d791 100644 --- a/core/engine/cluster/cloud/cluster.sh +++ b/core/engine/cluster/cloud/cluster.sh @@ -2,7 +2,7 @@ ################################################### # Usage: submit.sh -# Description: run mpi submit clinet implement +# Description: run mpi submit client implement ################################################### # ---------------------------------------------------------------------------- # diff --git a/core/engine/cluster/cluster.py b/core/engine/cluster/cluster.py index ae5703f1..0f45b1b0 100644 --- a/core/engine/cluster/cluster.py +++ b/core/engine/cluster/cluster.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. @@ -32,7 +32,7 @@ class ClusterEngine(Engine): if backend == "PaddleCloud": self.submit_script = os.path.join(abs_dir, "cloud/cluster.sh") else: - raise ValueError("{} can not supported now".format(backend)) + raise ValueError("{} can not be supported now".format(backend)) def start_worker_procs(self): trainer = TrainerFactory.create(self.trainer) diff --git a/core/engine/engine.py b/core/engine/engine.py index afe00dd9..583c3f18 100755 --- a/core/engine/engine.py +++ b/core/engine/engine.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 abc diff --git a/core/engine/local_cluster.py b/core/engine/local_cluster.py index 1b850bd0..72d440a8 100755 --- a/core/engine/local_cluster.py +++ b/core/engine/local_cluster.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/core/engine/local_mpi.py b/core/engine/local_mpi.py index 29e34907..1f7a27a8 100755 --- a/core/engine/local_mpi.py +++ b/core/engine/local_mpi.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/core/layer.py b/core/layer.py index ab068417..3b4a9ca3 100755 --- a/core/layer.py +++ b/core/layer.py @@ -30,8 +30,7 @@ class Layer(object): """ if mode == 'fluid': return self.generate_fluid(param) - elif mode == 'tensorflow': - return self.generate_tensorflow(param) + print('unsupport this mode: ' + mode) return None, None @@ -40,8 +39,3 @@ class Layer(object): """R """ pass - - def generate_tensorflow(self, param): - """ Not implement currently - """ - pass diff --git a/core/model.py b/core/model.py index cb937b7b..c6e9f8d0 100755 --- a/core/model.py +++ b/core/model.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 abc import paddle.fluid as fluid diff --git a/core/modules/modul/build.py b/core/modules/modul/build.py index 20e7702e..fe065678 100755 --- a/core/modules/modul/build.py +++ b/core/modules/modul/build.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 yaml import copy import paddle.fluid as fluid diff --git a/core/trainers/tdm_cluster_trainer.py b/core/trainers/tdm_cluster_trainer.py index 11fa2334..95d75971 100755 --- a/core/trainers/tdm_cluster_trainer.py +++ b/core/trainers/tdm_cluster_trainer.py @@ -1,4 +1,3 @@ -# -*- coding=utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -65,8 +64,7 @@ class TDMClusterTrainer(ClusterTrainer): "cluster.init_model_path", "", namespace) if load_tree: - # 将明文树结构及数据,set到组网中的Variale中 - # 不使用NumpyInitialize方法是考虑到树结构相关数据size过大,有性能风险 + # covert tree to tensor, set it into Fluid's variable. for param_name in special_param: param_t = fluid.global_scope().find_var(param_name).get_tensor() param_array = self.tdm_prepare(param_name) diff --git a/core/trainers/tdm_single_trainer.py b/core/trainers/tdm_single_trainer.py index 118548ab..82819393 100755 --- a/core/trainers/tdm_single_trainer.py +++ b/core/trainers/tdm_single_trainer.py @@ -1,4 +1,3 @@ -# -*- coding=utf-8 -*- # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -68,8 +67,7 @@ class TDMSingleTrainer(SingleTrainer): persistables_model_path)) if load_tree: - # 将明文树结构及数据,set到组网中的Variale中 - # 不使用NumpyInitialize方法是考虑到树结构相关数据size过大,有性能风险 + # covert tree to tensor, set it into Fluid's variable. for param_name in special_param: param_t = fluid.global_scope().find_var(param_name).get_tensor() param_array = self.tdm_prepare(param_name) diff --git a/models/match/multiview-simnet/evaluate_reader.py b/models/match/multiview-simnet/evaluate_reader.py index f7752e47..b6aa5799 100755 --- a/models/match/multiview-simnet/evaluate_reader.py +++ b/models/match/multiview-simnet/evaluate_reader.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/models/match/multiview-simnet/generate_synthetic_data.py b/models/match/multiview-simnet/generate_synthetic_data.py index 5ebb3a35..98c93c5d 100755 --- a/models/match/multiview-simnet/generate_synthetic_data.py +++ b/models/match/multiview-simnet/generate_synthetic_data.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved +# Copyright (c) 2020 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. diff --git a/models/match/multiview-simnet/reader.py b/models/match/multiview-simnet/reader.py index 5616547e..ea41fa88 100755 --- a/models/match/multiview-simnet/reader.py +++ b/models/match/multiview-simnet/reader.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/models/rank/dcn/model.py b/models/rank/dcn/model.py index 5009f3ea..7fbb3c6a 100755 --- a/models/rank/dcn/model.py +++ b/models/rank/dcn/model.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 paddle.fluid as fluid import math diff --git a/models/rank/deepfm/model.py b/models/rank/deepfm/model.py index d91eef24..8636078d 100755 --- a/models/rank/deepfm/model.py +++ b/models/rank/deepfm/model.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 paddle.fluid as fluid import math diff --git a/models/rank/din/model.py b/models/rank/din/model.py index 68585c8e..e218bb7f 100755 --- a/models/rank/din/model.py +++ b/models/rank/din/model.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 paddle.fluid as fluid import math diff --git a/models/rank/wide_deep/model.py b/models/rank/wide_deep/model.py index 7efaccf0..8e39cafc 100755 --- a/models/rank/wide_deep/model.py +++ b/models/rank/wide_deep/model.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 paddle.fluid as fluid import math diff --git a/models/rank/xdeepfm/model.py b/models/rank/xdeepfm/model.py index 3a68f843..d92ce81e 100755 --- a/models/rank/xdeepfm/model.py +++ b/models/rank/xdeepfm/model.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 paddle.fluid as fluid import math diff --git a/models/recall/gnn/evaluate_reader.py b/models/recall/gnn/evaluate_reader.py index 10d2f8e9..3f628776 100755 --- a/models/recall/gnn/evaluate_reader.py +++ b/models/recall/gnn/evaluate_reader.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/models/recall/gnn/reader.py b/models/recall/gnn/reader.py index 7e943379..a2b5eac1 100755 --- a/models/recall/gnn/reader.py +++ b/models/recall/gnn/reader.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/models/recall/word2vec/preprocess.py b/models/recall/word2vec/preprocess.py index 31088efb..592f9755 100755 --- a/models/recall/word2vec/preprocess.py +++ b/models/recall/word2vec/preprocess.py @@ -1,4 +1,18 @@ # -*- coding: utf-8 -* +# Copyright (c) 2020 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 random import re diff --git a/models/recall/word2vec/w2v_evaluate_reader.py b/models/recall/word2vec/w2v_evaluate_reader.py index 6a5c1e83..7ab49886 100755 --- a/models/recall/word2vec/w2v_evaluate_reader.py +++ b/models/recall/word2vec/w2v_evaluate_reader.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/models/recall/word2vec/w2v_reader.py b/models/recall/word2vec/w2v_reader.py index 24cf2e30..609a516a 100755 --- a/models/recall/word2vec/w2v_reader.py +++ b/models/recall/word2vec/w2v_reader.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2020 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. diff --git a/run.py b/run.py index 0a755cc2..acc50f2f 100755 --- a/run.py +++ b/run.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 argparse import os import subprocess diff --git a/tools/tools.py b/tools/tools.py index da34a027..ec85326c 100644 --- a/tools/tools.py +++ b/tools/tools.py @@ -1,3 +1,17 @@ +# Copyright (c) 2020 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 time import shutil -- GitLab