diff --git a/examples/config/server_fedasync.yaml b/examples/config/server_fedasync.yaml index dd11fe4..907caf8 100644 --- a/examples/config/server_fedasync.yaml +++ b/examples/config/server_fedasync.yaml @@ -48,7 +48,8 @@ server_configs: same_init_model: True aggregator: "FedAsyncAggregator" aggregator_kwargs: - weights: "equal" + client_weights_mode: "equal" + num_clients: 2 staleness_fn: "polynomial" staleness_fn_kwargs: a: 0.5 @@ -62,13 +63,4 @@ server_configs: comm_configs: server_uri: localhost:50051 max_message_size: 1048576 - - use_ssl: False - # # SSL configurations - # use_ssl: True - # use_authenticator: True - # server_certificate_key: ../src/appfl/comm/grpc/credentials/localhost.key - # server_certificate: ../src/appfl/comm/grpc/credentials/localhost.crt - # authenticator: NaiveAuthenticator - # authenticator_args: - # auth_token: a-secret-token \ No newline at end of file + use_ssl: False \ No newline at end of file diff --git a/examples/config/server_fedavg.yaml b/examples/config/server_fedavg.yaml index 8644ed1..f8c093e 100644 --- a/examples/config/server_fedavg.yaml +++ b/examples/config/server_fedavg.yaml @@ -46,7 +46,7 @@ server_configs: same_init_model: True aggregator: "FedAvgAggregator" aggregator_kwargs: - weights: "equal" + client_weights_mode: "equal" device: "cpu" num_epochs: 2 server_validation: False @@ -55,13 +55,4 @@ server_configs: comm_configs: server_uri: localhost:50051 max_message_size: 1048576 - - use_ssl: False - # # SSL configurations - # use_ssl: True - # use_authenticator: True - # server_certificate_key: ../src/appfl/comm/grpc/credentials/localhost.key - # server_certificate: ../src/appfl/comm/grpc/credentials/localhost.crt - # authenticator: NaiveAuthenticator - # authenticator_args: - # auth_token: a-secret-token \ No newline at end of file + use_ssl: False \ No newline at end of file diff --git a/examples/config/server_fedcompass.yaml b/examples/config/server_fedcompass.yaml index 982cdb4..6195db9 100644 --- a/examples/config/server_fedcompass.yaml +++ b/examples/config/server_fedcompass.yaml @@ -58,6 +58,7 @@ server_configs: a: 0.5 alpha: 0.9 gradient_based: True + client_weights_mode: "equal" device: "cpu" num_epochs: 2 server_validation: False @@ -66,13 +67,4 @@ server_configs: comm_configs: server_uri: localhost:50051 max_message_size: 1048576 - - use_ssl: False - # # SSL configurations - # use_ssl: True - # use_authenticator: True - # server_certificate_key: ../src/appfl/comm/grpc/credentials/localhost.key - # server_certificate: ../src/appfl/comm/grpc/credentials/localhost.crt - # authenticator: NaiveAuthenticator - # authenticator_args: - # auth_token: a-secret-token \ No newline at end of file + use_ssl: False \ No newline at end of file diff --git a/examples/run_client_1.py b/examples/run_client_1.py index ece092b..bf24619 100644 --- a/examples/run_client_1.py +++ b/examples/run_client_1.py @@ -18,6 +18,11 @@ init_global_model = client_comm.get_global_model(init_model=True) client_agent.load_parameters(init_global_model) +# Send the number of load data to the server +sample_size = client_agent.get_sample_size() +print(f"Sample size: {sample_size}") +client_comm.invoke_custom_action(action='set_sample_size', sample_size=sample_size) + for i in range(10): client_agent.train() local_model = client_agent.get_parameters() diff --git a/examples/run_client_2.py b/examples/run_client_2.py index 931a4d3..95fc44b 100644 --- a/examples/run_client_2.py +++ b/examples/run_client_2.py @@ -18,6 +18,11 @@ init_global_model = client_comm.get_global_model(init_model=True) client_agent.load_parameters(init_global_model) +# Send the number of load data to the server +sample_size = client_agent.get_sample_size() +print(f"Sample size: {sample_size}") +client_comm.invoke_custom_action(action='set_sample_size', sample_size=sample_size) + for i in range(10): client_agent.train() local_model = client_agent.get_parameters()