Similarity of Neural Networks with Gradients

Shuai Tang, Wesley J. Maddox, Charlie Dickens, Tom Diethe, Andreas Damianou
3/25/2020
cs.LGstat.ML

Official code: amzn/xfer (257 stars, Apache-2.0, last commit 2025-11-06).

Abstract

A suitable similarity index for comparing learnt neural networks plays an important role in understanding the behaviour of the highly-nonlinear functions, and can provide insights on further theoretical analysis and empirical studies. We define two key steps when comparing models: firstly, the representation abstracted from the learnt model, where we propose to leverage both feature vectors and gradient ones (which are largely ignored in prior work) into designing the representation of a neural network. Secondly, we define the employed similarity index which gives desired invariance properties, and we facilitate the chosen ones with sketching techniques for comparing various datasets efficiently. Empirically, we show that the proposed approach provides a state-of-the-art method for computing similarity of neural networks that are trained independently on different datasets and the tasks defined by the datasets.

View on arXivView PDF

Code Implementations(1)

amzn/xferOfficial100%
Apache-2.0

Transfer Learning library for Deep Neural Networks.

25761Shell, PythonJun 29, 201811 months agoApache-2.0
machine-learningmxnetneural-networkpythontransfer-learning

Similar Papers

Cite this paper

@article{tang2020similarity,
  title  = {Similarity of Neural Networks with Gradients},
  author = {Shuai Tang and Wesley J. Maddox and Charlie Dickens and Tom Diethe and Andreas Damianou},
  year   = {2020},
  eprint = {2003.11498},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2003.11498}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2003.11498.svg)](https://codeofpaper.com/paper/2003.11498)

Discussion