tmeasures


Nametmeasures JSON
Version 1.2.11 PyPI version JSON
download
home_pagehttps://github.com/facundoq/tmeasures
SummaryInvariance, Same-Equivariance and other measures for Neural Networks. Support for PyTorch (now) and TensorFlow (coming).
upload_time2023-12-27 15:05:37
maintainer
docs_urlNone
authorFacundo Manuel Quiroga
requires_python>=3.6
license
keywords transformational measures equivariance same-equivariance invariance variance neural networks python pytorch numpy tensorflow
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ✴ Transformational Measures 📏

The Transformational Measures (`tmeasures`) library allows neural network designers to evaluate the invariance, equivariance and other properties of their models with respect to a set of transformations. Support for Pytorch (current) and Tensorflow/Keras (coming). 

## 🔎 Visualizations

`tmeasures` allows computing invariance, same-equivariance and other transformational measures, and contains helpful functions to visualize these. The following are some examples of the results you can obtain with the library:

### 🔥 Invariance heatmap

Each column shows the invariance to rotation of a layer of a Neural Network. Each row/block inside each column indicates the invariance of a feature map or single neuron, depending on the layer. 

![](docs/res/heatmap.png)

### 📉 Average Invariance vs layer, same model

Plot the transformational and sample invariance to rotations of a simple neural network trained on MNIST, with and without data augmentation. The X axis indicates the layer, while the Y axis shows the average invariance of the layer.

![](docs/res/invariance.jpg)

### 📈 Average invariance by layer, different models: 

Plot of the invariance to rotations of several well-known models trained on CIFAR10. The number of layers of each model is streched on a percentage scale, so that different models can be compared.

![](docs/res/invariance_models_cifar10.jpg)

## 💻 PyTorch API


These notebooks contain step-by-step code and explanations to measure invariance in both custom and pretrained model, both using predefined and custom transformations. They can be executed in google colab directly. Alternatively, you can download them for local execution, but be aware you will have to provide your own virtualenv with `torch` and `torchvision`  [installed](https://pytorch.org/get-started/locally/).


* [Measuring invariance to brightness changes on a pretrained ResNet18 on TinyImageNet](https://colab.research.google.com/github/facundoq/transformational_measures/blob/master/docs/examples/ResNet%20Invariance%20with%20TinyImageNet.ipynb)
* [Measuring invariance to rotations on a custom CNN on MNIST](https://colab.research.google.com/github/facundoq/transformational_measures/blob/master/docs/examples/Variance%20to%20rotations%20of%20a%20CNN%20trained%20on%20MNIST%20with%20PyTorch.ipynb)

Other examples with multiple measures and pretrained models can be found in the [doc](/doc) folder of this repository.


## 💻 TensorFlow API

We are still developing the Tensorflow API. 

## 📋 Examples

You can find many uses of this library in the [repository with the code](https://github.com/facundoq/transformational_measures_experiments) for the article [Measuring (in)variances in Convolutional Networks](https://link.springer.com/chapter/10.1007/978-3-030-27713-0_9), where this library was first presented. Also, in the code for the experiments of the PhD Thesis ["Invariance and Same-Equivariance Measures for Convolutional Neural Networks" (spanish)](https://doi.org/10.24215/16666038.20.e06).

## 🤙🏽 Citing

If you use this library in your research, we kindly ask you to cite [ Invariance and Same-Equivariance Measures for Convolutional Neural Networks.](https://doi.org/10.24215/16666038.20.e06)

````
@article{quiroga20,
  author    = {Facundo Quiroga and
               Laura Lanzarini},
  title     = {Invariance and Same-Equivariance Measures for Convolutional Neural Networks},
  journal   = {J. Comput. Sci. Technol.},
  volume    = {20},
  number    = {1},
  pages     = {06},
  year      = {2020},
  url       = {https://doi.org/10.24215/16666038.20.e06},
  doi       = {10.24215/16666038.20.e06},
}
````

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/facundoq/tmeasures",
    "name": "tmeasures",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "transformational measures equivariance same-equivariance invariance variance neural networks python pytorch numpy tensorflow",
    "author": "Facundo Manuel Quiroga",
    "author_email": "facundoq@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/14/01/76908598154a808f2d42d0befbdcdc3eb9645df048fdc0036fddfd3c1ade/tmeasures-1.2.11.tar.gz",
    "platform": null,
    "description": "# \u2734 Transformational Measures \ud83d\udccf\n\nThe Transformational Measures (`tmeasures`) library allows neural network designers to evaluate the invariance, equivariance and other properties of their models with respect to a set of transformations. Support for Pytorch (current) and Tensorflow/Keras (coming). \n\n## \ud83d\udd0e Visualizations\n\n`tmeasures` allows computing invariance, same-equivariance and other transformational measures, and contains helpful functions to visualize these. The following are some examples of the results you can obtain with the library:\n\n### \ud83d\udd25 Invariance heatmap\n\nEach column shows the invariance to rotation of a layer of a Neural Network. Each row/block inside each column indicates the invariance of a feature map or single neuron, depending on the layer. \n\n![](docs/res/heatmap.png)\n\n### \ud83d\udcc9 Average Invariance vs layer, same model\n\nPlot the transformational and sample invariance to rotations of a simple neural network trained on MNIST, with and without data augmentation. The X axis indicates the layer, while the Y axis shows the average invariance of the layer.\n\n![](docs/res/invariance.jpg)\n\n### \ud83d\udcc8 Average invariance by layer, different models: \n\nPlot of the invariance to rotations of several well-known models trained on CIFAR10. The number of layers of each model is streched on a percentage scale, so that different models can be compared.\n\n![](docs/res/invariance_models_cifar10.jpg)\n\n## \ud83d\udcbb PyTorch API\n\n\nThese notebooks contain step-by-step code and explanations to measure invariance in both custom and pretrained model, both using predefined and custom transformations. They can be executed in google colab directly. Alternatively, you can download them for local execution, but be aware you will have to provide your own virtualenv with `torch` and `torchvision`  [installed](https://pytorch.org/get-started/locally/).\n\n\n* [Measuring invariance to brightness changes on a pretrained ResNet18 on TinyImageNet](https://colab.research.google.com/github/facundoq/transformational_measures/blob/master/docs/examples/ResNet%20Invariance%20with%20TinyImageNet.ipynb)\n* [Measuring invariance to rotations on a custom CNN on MNIST](https://colab.research.google.com/github/facundoq/transformational_measures/blob/master/docs/examples/Variance%20to%20rotations%20of%20a%20CNN%20trained%20on%20MNIST%20with%20PyTorch.ipynb)\n\nOther examples with multiple measures and pretrained models can be found in the [doc](/doc) folder of this repository.\n\n\n## \ud83d\udcbb TensorFlow API\n\nWe are still developing the Tensorflow API. \n\n## \ud83d\udccb Examples\n\nYou can find many uses of this library in the [repository with the code](https://github.com/facundoq/transformational_measures_experiments) for the article [Measuring (in)variances in Convolutional Networks](https://link.springer.com/chapter/10.1007/978-3-030-27713-0_9), where this library was first presented. Also, in the code for the experiments of the PhD Thesis [\"Invariance and Same-Equivariance Measures for Convolutional Neural Networks\" (spanish)](https://doi.org/10.24215/16666038.20.e06).\n\n## \ud83e\udd19\ud83c\udffd Citing\n\nIf you use this library in your research, we kindly ask you to cite [ Invariance and Same-Equivariance Measures for Convolutional Neural Networks.](https://doi.org/10.24215/16666038.20.e06)\n\n````\n@article{quiroga20,\n  author    = {Facundo Quiroga and\n               Laura Lanzarini},\n  title     = {Invariance and Same-Equivariance Measures for Convolutional Neural Networks},\n  journal   = {J. Comput. Sci. Technol.},\n  volume    = {20},\n  number    = {1},\n  pages     = {06},\n  year      = {2020},\n  url       = {https://doi.org/10.24215/16666038.20.e06},\n  doi       = {10.24215/16666038.20.e06},\n}\n````\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Invariance, Same-Equivariance and other measures for Neural Networks. Support for PyTorch (now) and TensorFlow (coming).",
    "version": "1.2.11",
    "project_urls": {
        "Bug Tracker": "https://github.com/facundoq/tmeasures/issues",
        "Documentation": "https://github.com/facundoq/tmeasures",
        "Homepage": "https://github.com/facundoq/tmeasures",
        "Source Code": "https://github.com/facundoq/tmeasures"
    },
    "split_keywords": [
        "transformational",
        "measures",
        "equivariance",
        "same-equivariance",
        "invariance",
        "variance",
        "neural",
        "networks",
        "python",
        "pytorch",
        "numpy",
        "tensorflow"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2aac5effc54d621beb00ee65a7f9a3a8065133ec7d9864a9bfbaf9acaf47582a",
                "md5": "f6cfceff6773545025b2eb3a3085001c",
                "sha256": "85a814a50c2ddbafd5835b7bdc16c1fe6ecc77b12084a903b702ffc7272dc73a"
            },
            "downloads": -1,
            "filename": "tmeasures-1.2.11-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f6cfceff6773545025b2eb3a3085001c",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 76486,
            "upload_time": "2023-12-27T15:05:36",
            "upload_time_iso_8601": "2023-12-27T15:05:36.113119Z",
            "url": "https://files.pythonhosted.org/packages/2a/ac/5effc54d621beb00ee65a7f9a3a8065133ec7d9864a9bfbaf9acaf47582a/tmeasures-1.2.11-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "140176908598154a808f2d42d0befbdcdc3eb9645df048fdc0036fddfd3c1ade",
                "md5": "c63c7af23d94f9bb96be2fc985703003",
                "sha256": "8fe024f6703270b138b33f70dfefa125df44dac89355c8434fb1b0723402319a"
            },
            "downloads": -1,
            "filename": "tmeasures-1.2.11.tar.gz",
            "has_sig": false,
            "md5_digest": "c63c7af23d94f9bb96be2fc985703003",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 58229,
            "upload_time": "2023-12-27T15:05:37",
            "upload_time_iso_8601": "2023-12-27T15:05:37.822286Z",
            "url": "https://files.pythonhosted.org/packages/14/01/76908598154a808f2d42d0befbdcdc3eb9645df048fdc0036fddfd3c1ade/tmeasures-1.2.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-27 15:05:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "facundoq",
    "github_project": "tmeasures",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tmeasures"
}
        
Elapsed time: 0.20762s