sidak / otfusion Goto Github PK
View Code? Open in Web Editor NEWModel Fusion via Optimal Transport, NeurIPS 2020
Model Fusion via Optimal Transport, NeurIPS 2020
Hi,
Does the code include fusing multiple (>2) models? Thanks!
Referring to section S5 of the paper: where can I find the parameters for replicating skill transfer experiments?
Dear Sidak,
Thanks again for your code. I was going to run your an example using your resnet checkpoints.
To do this, cifar.zip and resnet_models.zip are extracted and the following command is run (it seems the provided checkpoint are with no BN):
python main.py --gpu-id 0 --model-name resnet18_nobias_nobn --n-epochs 300 --save-result-file sample.csv --sweep-name exp_sample --exact --correction --ground-metric euclidean --weight-stats --activation-histograms --activation-mode raw --geom-ensemble-type acts --sweep-id 21 --act-num-samples 200 --ground-metric-normalize none --activation-seed 21 --prelu-acts --recheck-acc --load-models ./resnet_models/ --ckpt-type best --past-correction --not-squared --dataset Cifar10
However, the code exited with the following error (seems the shortcut is making the trouble):
--------------- At layer index 7 -------------
Previous layer shape is torch.Size([128, 128, 3, 3])
let's see the difference in layer names layer2.0.shortcut.0 layer2.0.shortcut.0
torch.Size([200, 1, 128, 16, 16]) shape of activations generally
reorder_dim is [1, 2, 3, 0]
In layer layer2.0.shortcut.0.weight: getting activation distance statistics
Statistics of the distance from neurons of layer 1 (averaged across nodes of layer 0):
Statistics of the distance from neurons of layer 1 (averaged across nodes of layer 0):
Max : 8.675606727600098, Mean : 3.544717311859131, Min : 1.0014023780822754, Std: 1.3794620037078857
shape of layer: model 0 torch.Size([128, 64, 1])
shape of layer: model 1 torch.Size([128, 64, 1])
shape of activations: model 0 torch.Size([128, 16, 16, 200])
shape of activations: model 1 torch.Size([128, 16, 16, 200])
shape of previous transport map torch.Size([128, 128])
Traceback (most recent call last):
File "main.py", line 159, in <module>
geometric_acc, geometric_model = wasserstein_ensemble.geometric_ensembling_modularized(args, models, train_loader, test_loader, activations)
File "/home/rahim/NIPS2021/otfusion/wasserstein_ensemble.py", line 893, in geometric_ensembling_modularized
avg_aligned_layers = get_acts_wassersteinized_layers_modularized(args, networks, activations, train_loader=train_loader, test_loader=test_loader)
File "/home/rahim/NIPS2021/otfusion/wasserstein_ensemble.py", line 688, in get_acts_wassersteinized_layers_modularized
aligned_wt = torch.bmm(fc_layer0_weight_data.permute(2, 0, 1), T_var_conv).permute(1, 2, 0)
RuntimeError: batch1 dim 2 must match batch2 dim 1
Secondly, the code is not working with BatchNorm, is that right?
In utils.py line 11, import train as cifar_train. Where is the module 'train'? Thank you!
Hi Sidak,
Thanks for such great work and your code. I tried to run one of the samples codes in the readme, but it seems that a ''train' folder is missing. The error prints as "No module named 'train'".
Hi, Sidak. My name is Terai, and I am an undergraduate student studying informatics engineering.
I have read your paper (titled as Model Fusion via Optimal Transport) published on NIPS'20. After reading through the paper, I have tried to reproduce the simulation results using the codes publicly available on GitHub, but I have two simple questions: How were the two models (used in Figure 2 of the paper) being created? How can I leverage your codes to retrain the models by myself?
I know you are busy, but I would greatly appreciate it if you could help me. Thanks.
Hi expert,
Nice work and novel view to use OT method.
As you mentioned on your paper "The bias of a neuron is set to zero in all of the experiments. It is possible to handle
it as a regular weight by keeping the corresponding input as 1" .
Do you have any new version to handle fusion of bias over this years?
Or How to do a regular weight by keeping the corresponding input as 1?
When trying to reproduce the experiment "MNIST + MLPNet",I encountered this problem:
No module named 'train'.
Which file does this "train" mean?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.