GithubHelp home page GithubHelp logo

zju-vipa / training_free_model_merging Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 3.0 24.94 MB

This repository is the implementation of the paper Training Free Pretrained Model Merging (CVPR2024).

Jupyter Notebook 44.34% Python 55.66%

training_free_model_merging's Introduction

Training Free Pretrained Model Merging

This repository is the implementation of the paper Training Free Pretrained Model Merging (CVPR2024).

Overview

  1. We highlight the inconsistency of unit similarity in weight space and activation space. A novel model merging framework MuDSC (Merging under Dual-Space Constraints) is proposed that encourages both the activation spaces and weight spaces between two models be of high similarity.

    mudsc

  2. The group matching is designed to make the matching algorithms applicable to models with group structure e.g. ViT and Group Normalization.

    group_matching

  3. A vigorous experimental study was presented and show that MuDSC can significantly boost the merged performance in manifold multi-task scenarios for various architectures. Further loss landscape visualization verifies that our solution locates in the overlapping part with unified lower loss of each task.

    loss_landscape

Dependencies

Our code is implemented and tested on PyTorch. Following packages are used:

tqdm
matplotlib
pandas
pyyaml
scikit-learn
fvcore
einops
easydict
networkx
scikit-image
opencv-python==4.6.0.66
timm==0.9.2
seaborn
# pygraphviz
clip @ git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1

You can install pytorch with following command:

pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116

Then, install the rest of dependencies:

pip install -r requirements.txt

Experiment

Citation

@inproceedings{
    xu2024trainingfree,
    title={Training-free Pretrained Model Merging},
    author={Xu, Zhengqi and Yuan, Ke and Wang, Huiqiong and Wang, Yong and Song, Mingli and Song, Jie},
    booktitle={Conference on Computer Vision and Pattern Recognition 2024},
    year={2024}
}

Contact

If you have any question, please feel free to contact

Zhengqi Xu, [email protected].

training_free_model_merging's People

Contributors

hongyaohongyao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pprp shism2 yhy-10

training_free_model_merging's Issues

Is there a plan to release the pre-trained weights as open source?

Hello, your work is truly commendable, and I greatly admire it. I am currently engaged in similar research and was wondering if you have any plans to open-source the model weights trained on datasets like ImageNet and CIFAR-100? I believe this would be incredibly beneficial for researchers who are building upon this work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.