Skip to content

Commit

Permalink
- federated evaluation with defautls baked in aggregator, tasks and a…
Browse files Browse the repository at this point in the history
…ssigner

- updated torch_cnn_mnist_fed_eval sample workspace to use new defaults
Signed-off-by: Shailesh Pant <[email protected]>
  • Loading branch information
ishaileshpant committed Dec 3, 2024
1 parent b25b2ef commit 5470a55
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
24 changes: 3 additions & 21 deletions openfl-workspace/torch_cnn_mnist_fed_eval/plan/plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
# Licensed subject to the terms of the separately executed evaluation license agreement between Intel Corporation and you.

aggregator :
defaults : plan/defaults/aggregator.yaml
defaults : plan/defaults/federated-evaluation/aggregator.yaml
template : openfl.component.Aggregator
settings :
init_state_path : save/torch_cnn_mnist_init.pbuf
best_state_path : save/torch_cnn_mnist_best.pbuf
last_state_path : save/torch_cnn_mnist_last.pbuf
######### SET ROUNDS TO 1 #############
rounds_to_train : 1
#######################################
log_metric_callback :
template : src.mnist_utils.write_metric

Expand All @@ -37,25 +34,10 @@ network :
defaults : plan/defaults/network.yaml

assigner :
######### SET ASSIGNER TO ONLY INCLUDE AGGREGATED MODEL VALIDATION #############
template : openfl.component.RandomGroupedAssigner
settings :
task_groups :
- name : validate
percentage : 1.0
tasks :
- aggregated_model_validation
################################################################################
defaults : plan/defaults/federated-evaluation/assigner.yaml

tasks :
######### SET AGGREGATED MODEL VALIDATION AS ONLY TASK #############
aggregated_model_validation:
function : validate
kwargs :
apply : global
metrics :
- acc
####################################################################
defaults : plan/defaults/federated-evaluation/tasks_torch.yaml

compression_pipeline :
defaults : plan/defaults/compression_pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
template : openfl.component.Aggregator
settings :
db_store_rounds : 2
write_logs : true
######### Default rounds to 1 for evaluation #############
rounds_to_train : 1
##########################################################
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
template : openfl.component.RandomGroupedAssigner
settings :
task_groups :
- name : validate
percentage : 1.0
tasks :
- aggregated_model_validation
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
aggregated_model_validation:
function : validate_task
kwargs :
apply : global
metrics :
- acc

0 comments on commit 5470a55

Please sign in to comment.