From 3784cce8438df93a1be0af1194947b13bcd67811 Mon Sep 17 00:00:00 2001 From: working <57171759+NLGithubWP@users.noreply.github.com> Date: Sat, 9 Mar 2024 19:02:28 +0800 Subject: [PATCH] Add headers for hfl --- examples/hfl/README.md | 20 ++++++++++++++++++++ examples/hfl/src/bank.py | 19 +++++++++++++++++++ examples/hfl/src/client.py | 18 ++++++++++++++++++ examples/hfl/src/proto/utils.py | 19 +++++++++++++++++++ examples/hfl/src/server.py | 19 +++++++++++++++++++ 5 files changed, 95 insertions(+) diff --git a/examples/hfl/README.md b/examples/hfl/README.md index df27512a6..cf20e64cd 100644 --- a/examples/hfl/README.md +++ b/examples/hfl/README.md @@ -1,3 +1,23 @@ + + + # Horizontal Federated Learning Example This is an example of federated learning (FL) using the Singa framework. In FL, there is a server and a set of clients. Each client has a local dataset. diff --git a/examples/hfl/src/bank.py b/examples/hfl/src/bank.py index b7131723f..8cfa3d68c 100644 --- a/examples/hfl/src/bank.py +++ b/examples/hfl/src/bank.py @@ -1,3 +1,22 @@ +# +# 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. +# + # https://github.com/zhengzangw/Fed-SINGA/blob/main/src/client/data/bank.py import pandas as pd diff --git a/examples/hfl/src/client.py b/examples/hfl/src/client.py index d3fa0aa27..80ab11f3a 100644 --- a/examples/hfl/src/client.py +++ b/examples/hfl/src/client.py @@ -1,4 +1,22 @@ #!/usr/bin/env python3 +# +# 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. +# # modified from https://github.com/apache/singa/blob/master/examples/cnn/train_cnn.py # modified from https://github.com/zhengzangw/Fed-SINGA/blob/main/src/client/app.py diff --git a/examples/hfl/src/proto/utils.py b/examples/hfl/src/proto/utils.py index c1d0211e5..12f044ab5 100644 --- a/examples/hfl/src/proto/utils.py +++ b/examples/hfl/src/proto/utils.py @@ -1,3 +1,22 @@ +# +# 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 argparse import pickle import socket diff --git a/examples/hfl/src/server.py b/examples/hfl/src/server.py index 062fe745d..7450cc1cf 100644 --- a/examples/hfl/src/server.py +++ b/examples/hfl/src/server.py @@ -1,5 +1,24 @@ #!/usr/bin/env python3 +# +# 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. +# + # modified from https://github.com/zhengzangw/Fed-SINGA/blob/main/src/server/app.py import socket