Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Update main.py #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Federated Learning with Matched Averaging
This is the code accompanying the ICLR 2020 paper "Federated Learning with Matched Averaging " Paper link: [https://openreview.net/forum?id=BkluqlSFDS]

![Alt](https://repobeats.axiom.co/api/embed/705163eb0ad960618a2f6fedbb1947992ba5a212.svg "Repobeats analytics image")

### Overview
---
FedMA algorithm is designed for federated learning of modern neural network architectures e.g. convolutional neural networks (CNNs) and LSTMs. FedMA constructs the shared global model in a layer-wise manner by matching and averaging hidden elements (i.e. channels for convolution layers; hidden states for LSTM; neurons for fully connected layers) with similar feature extraction signatures.
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ def BBP_MAP(nets_list, model_meta_data, layer_type, net_dataidx_map,

type_of_this_layer = layer_type[2 * layer_index - 2]
type_of_prev_layer = layer_type[2 * layer_index - 2 - 2]
first_fc_identifier = (('fc' in type_of_this_layer or 'classifier' in type_of_this_layer) and ('conv' in type_of_prev_layer or 'features' in type_of_this_layer))
first_fc_identifier = (('fc' in type_of_this_layer or 'classifier' in type_of_this_layer) and ('conv' in type_of_prev_layer or 'features' in type_of_prev_layer))

if first_fc_identifier:
first_fc_index = layer_index
Expand Down Expand Up @@ -1658,4 +1658,4 @@ def fedma_comm(batch_weights, model_meta_data, layer_type, net_dataidx_map,
test_dl_global,
assignments_list,
comm_round=args.comm_round,
device=device)
device=device)