diff --git a/examples/hello-world/python_jobs/pt/client_api_pt_job_dp_filter.py b/examples/hello-world/python_jobs/pt/client_api_pt_job_dp_filter.py index 4e646208f5..9d66c658c5 100644 --- a/examples/hello-world/python_jobs/pt/client_api_pt_job_dp_filter.py +++ b/examples/hello-world/python_jobs/pt/client_api_pt_job_dp_filter.py @@ -26,7 +26,7 @@ num_rounds = 2 train_script = "code/cifar10_fl.py" - job = FedJob(name="cifar10_fedavg") + job = FedJob(name="cifar10_fedavg_privacy") controller = FedAvg( min_clients=n_clients, @@ -40,7 +40,7 @@ task_script_path=train_script, task_script_args="" ) - client_app = ExecutorApp(executors=[executor], external_scripts=[train_script]) + client_app = ExecutorApp(executors=[executor], external_scripts=[train_script]) # TODO: add_executor? # add privacy filter. # TODO: is there a better way to handle task names? client_app.add_task_result_filter(["train"], PercentilePrivacy(percentile=10, gamma=0.01)) diff --git a/nvflare/fed_job.py b/nvflare/fed_job.py index 693723f5ce..abd94fd9d8 100644 --- a/nvflare/fed_job.py +++ b/nvflare/fed_job.py @@ -36,15 +36,15 @@ def __init__(self): def get_app_config(self): return self.app - def add_task_result_filter(self, tasks: List[str], filter: Filter): - self.app.add_task_result_filter(tasks, filter) + def add_task_result_filter(self, tasks: List[str], task_filter: Filter): + self.app.add_task_result_filter(tasks, task_filter) - def add_task_data_filter(self, tasks: List[str], filter: Filter): - self.app.add_task_data_filter(tasks, filter) + def add_task_data_filter(self, tasks: List[str], task_filter: Filter): + self.app.add_task_data_filter(tasks, task_filter) class FedJob: - def __init__(self, name="client-api-pt", min_clients=1, mandatory_clients=None) -> None: + def __init__(self, name="fed_job", min_clients=1, mandatory_clients=None) -> None: self.job_name = name self.gpus = [] self.clients = []