Code Monkey home page Code Monkey logo

lucmos / relreps Goto Github PK

View Code? Open in Web Editor NEW
45.0 3.0 6.0 10.42 MB

Relative representations can be leveraged to enable solving tasks regarding "latent communication": from zero-shot model stitching to latent space comparison between diverse settings.

Home Page: https://openreview.net/forum?id=SrC-nwieGJ

License: MIT License

Python 15.39% Shell 0.53% Jupyter Notebook 84.07%
invariance representation-learning stitching zero-shot latent-communication relative-representation

relreps's Introduction

Relative representations enable zero-shot latent space communication

Slides | OpenReview | arXiv | BibTeX

NN Template

Luca Moschella*, Valentino Maiorca*, Marco Fumero, Antonio Norelli, Francesco Locatello, Emanuele Rodolà

* equal contribution

Installation

NN Template Python Code style: black

pip install git+ssh://[email protected]/lucmos/relreps.git

Quickstart

Development installation

Setup the development environment:

git clone [email protected]:lucmos/relreps.git
cd relreps
conda env create -f env.yaml
conda activate relreps
pre-commit install
dvc pull

Refer to the template documentation for an high level overview of the code structure.

Update the dependencies

Re-install the project in edit mode:

pip install -e .[dev]

BibTeX

@inproceedings{
    moschella2023relative,
    title={Relative representations enable zero-shot latent space communication},
    author={Luca Moschella and Valentino Maiorca and Marco Fumero and Antonio Norelli and Francesco Locatello and Emanuele Rodol{\`a}},
    booktitle={The Eleventh International Conference on Learning Representations },
    year={2023},
    url={https://openreview.net/forum?id=SrC-nwieGJ}
}

relreps's People

Contributors

flegyas avatar lucmos avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

relreps's Issues

AE latent space training code

I am trying to reproduce figure 1 from the paper:

fig1

I've found the code in fig:latent-rotation/visualize.ipynb and am attempting to get it to work. IIUC - it appears to assume that pre-baked model checkpoints are downloaded with the down.sh helper script.

If I've got this right - could you provide a pointer to the AE training of these MNIST checkpoints themselves? My interest is in recreating your results including model training so that I can do follow up experiments which vary the upstream parameters on the latent spaces.

Error when running abs-rel performance comparison exp

Hi,
Great work! I am getting the error below when running your experiment. Can you help?
Best,
Sebastian

The command: bash experiments/tab:abs-rel-performance-comparison/classification/train.sh

Error executing job with overrides: ['core.tags=[classification,relative,tab1]', 'nn/data/datasets=vision/fmnist', 'nn/module=classifier', 'nn/module/model=vision/relresnet', 'nn.module.model.resnet_size=18', 'nn.module.model.input_size=224', 'nn.module.model.use_pretrained=True', 'nn.module.model.finetune=False', 'nn.module.model.hidden_features=512', 'nn.module.model.relative_attention.output_normalization_mode=layernorm', 'train.seed_index=0', 'train.trainer.max_epochs=10']
Traceback (most recent call last):
File "src/rae/run.py", line 123, in main
run(cfg)
File "src/rae/run.py", line 80, in run
datamodule: pl.LightningDataModule = hydra.utils.instantiate(cfg.nn.data, recursive=False)
File "/home/sebek/.conda/envs/relrep2/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 220, in instantiate
OmegaConf.resolve(config)
omegaconf.errors.InterpolationKeyError: Interpolation key 'nn.data.datasets.val_fixed_sample_idxs' not found

Request for code related to word embedding

Hi Luca,

I'm curious about your work about comparing communicating different word embeddings latent space, but I find it hard to figure out which part of your repo is about this.

Could you be so kind to point them out for me?

Thank you!
Xibin

Question about model stitching

Hi, thanks for providing such a wonderful work.

I have a question about the mechanism of stitching models with relative represenation.
When performing model stitching, if similarity vectors are created, are they normalized (with l2 norm) and communicated, or are they just connected?

Thanks

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.