sidak / otfusion

Model Fusion via Optimal Transport, NeurIPS 2020
130 stars 26 forks source link

'import train as cifar_train' in utils.py #1

Closed leondada closed 4 years ago

leondada commented 4 years ago

When trying to reproduce the experiment "MNIST + MLPNet",I encountered this problem: No module named 'train'. Which file does this "train" mean?

modelfusion commented 4 years ago

Hi! Did you unzip the cifar.zip and place it in the root directory?

Ref: See lines 13-15 in main.py below

PATH_TO_CIFAR = "./cifar/"
sys.path.append(PATH_TO_CIFAR)
import train as cifar_train
leondada commented 4 years ago

Thanks for your reply. In fact, I am very interested in this research. After reading your paper, I have some questions about 'Table1'. Is the test accuracy established in all categories? In addition, I found that Model0 and Model1 shared the same trainset in the code (=.=,maybe I haven't fully understood the code ),so, can I think this reduces the difficulty of model fusion? The last question, I did an experiment with the model fusion method of your code (Weight-based), but the effect is not as good as I imagined. Am I ignoring anything?

\\ test ac in 0~4 test ac in 5~9 test ac in 0~9
model0 98.52 0 49.26
model2 0 97.86 48.93
OTfusion 15.85 47.35 31.17
fedavg 22.00 46.59 33.96

PS:model0 and model1 have different initialization parameters.

modelfusion commented 4 years ago

Hi, thanks for your interest.

In Table1, the test accuracy is across all categories. It is the global test accuracy which is mentioned in all the tables.

First, you have to realize there are two main settings under which the model fusion code is organized.

(1) Models that differ only in their initialization -> main.py (2) Models that differ in their trainset -> split_main.py

So, I think you are probably looking at the wrong file (see lines 119-150 in split_main)!

Next, can you first try the CIFAR10 + VGG11 command mentioned in the Readme? I believe you might have accidentally missed passing an important argument (also please share with which arguments you ran).

(Btw, please expect delays due to submission deadlines)

modelfusion commented 4 years ago

Also, a general comment. Averaging models with different initialization, in general, is pretty hard. Vanilla averaging/FedAvg should perform even worse. (For example, try passing--diff-init in split_main.py)

modelfusion commented 4 years ago

Hey!

I assume the issue was resolved, so I am closing the issue. Feel free to reopen if you still have questions.

Thanks.