{ "info": { "author": "The saliency authors", "author_email": "tf-saliency-dev@google.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "# Saliency Methods\n\n## Introduction\n\nThis repository contains code for the following saliency techniques:\n\n* XRAI* ([paper](https://arxiv.org/abs/1906.02825))\n* SmoothGrad* ([paper](https://arxiv.org/abs/1706.03825))\n* Vanilla Gradients\n ([paper](https://scholar.google.com/scholar?q=Visualizing+higher-layer+features+of+a+deep+network&btnG=&hl=en&as_sdt=0%2C22),\n [paper](https://arxiv.org/abs/1312.6034))\n* Guided Backpropogation ([paper](https://arxiv.org/abs/1412.6806))\n* Integrated Gradients ([paper](https://arxiv.org/abs/1703.01365))\n* Occlusion\n* Grad-CAM ([paper](https://arxiv.org/abs/1610.02391))\n\n\\*Developed by PAIR.\n\nThis list is by no means comprehensive. We are accepting pull requests to add\nnew methods!\n\n## Download\n\n```\npip install saliency\n```\n\nor for the development version:\n```\ngit clone https://github.com/pair-code/saliency\ncd saliency\n```\n\n\n## Usage\n\nEach saliency mask class extends from the `SaliencyMask` base class. This class\ncontains the following methods:\n\n* `__init__(graph, session, y, x)`: Constructor of the SaliencyMask. This can\n modify the graph, or sometimes create a new graph. Often this will add nodes\n to the graph, so this shouldn't be called continuously. `y` is the output\n tensor to compute saliency masks with respect to, `x` is the input tensor\n with the outer most dimension being batch size.\n* `GetMask(x_value, feed_dict)`: Returns a mask of the shape of non-batched\n `x_value` given by the saliency technique.\n* `GetSmoothedMask(x_value, feed_dict)`: Returns a mask smoothed of the shape\n of non-batched `x_value` with the SmoothGrad technique.\n\nThe visualization module contains two visualization methods:\n\n* ```VisualizeImageGrayscale(image_3d, percentile)```: Marginalizes across the\n absolute value of each channel to create a 2D single channel image, and clips\n the image at the given percentile of the distribution. This method returns a\n 2D tensor normalized between 0 to 1.\n* ```VisualizeImageDiverging(image_3d, percentile)```: Marginalizes across the\n value of each channel to create a 2D single channel image, and clips the\n image at the given percentile of the distribution. This method returns a\n 2D tensor normalized between -1 to 1 where zero remains unchanged.\n\nIf the sign of the value given by the saliency mask is not important, then use\n```VisualizeImageGrayscale```, otherwise use ```VisualizeImageDiverging```. See\nthe SmoothGrad paper for more details on which visualization method to use.\n\n## Examples\n\n[This example iPython notebook](http://github.com/pair-code/saliency/blob/master/Examples.ipynb) shows\nthese techniques is a good starting place.\n\nAnother example of using GuidedBackprop with SmoothGrad from TensorFlow:\n\n```\nfrom guided_backprop import GuidedBackprop\nimport visualization\n\n...\n# Tensorflow graph construction here.\ny = logits[5]\nx = tf.placeholder(...)\n...\n\n# Compute guided backprop.\n# NOTE: This creates another graph that gets cached, try to avoid creating many\n# of these.\nguided_backprop_saliency = GuidedBackprop(graph, session, y, x)\n\n...\n# Load data.\nimage = GetImagePNG(...)\n...\n\nsmoothgrad_guided_backprop =\n guided_backprop_saliency.GetMask(image, feed_dict={...})\n\n# Compute a 2D tensor for visualization.\ngrayscale_visualization = visualization.VisualizeImageGrayscale(\n smoothgrad_guided_backprop)\n```\n\nThis is not an official Google product.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pair-code/saliency", "keywords": "saliency mask neural network deep learning", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "saliency", "package_url": "https://pypi.org/project/saliency/", "platform": "", "project_url": "https://pypi.org/project/saliency/", "project_urls": { "Homepage": "https://github.com/pair-code/saliency" }, "release_url": "https://pypi.org/project/saliency/0.0.5/", "requires_dist": [ "numpy", "tensorflow" ], "requires_python": "", "summary": "Saliency methods for TensorFlow", "version": "0.0.5" }, "last_serial": 5891913, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8c516c4dab9d0aba9a59b531e410ef96", "sha256": "ce29955757706a02a012626287ef368ea04548112147603e91670973cdf5c8aa" }, "downloads": -1, "filename": "saliency-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8c516c4dab9d0aba9a59b531e410ef96", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10941, "upload_time": "2017-07-11T21:59:17", "url": "https://files.pythonhosted.org/packages/91/5f/fc56eec0a3c6f3e2f45cd5b835c5c1ff45b01dcdd0670ce174b90564d14d/saliency-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b824cfab41ee06fdea5dca53c4b97d94", "sha256": "e7c6c56de2db7ad05b1cddd2e792c313cb2d9c110fde2a3873d52a26435658bf" }, "downloads": -1, "filename": "saliency-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b824cfab41ee06fdea5dca53c4b97d94", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6094, "upload_time": "2017-07-11T21:59:19", "url": "https://files.pythonhosted.org/packages/99/c3/ef98e6d79e9d2f3bf8bcde5fe62409a1a4fdd55765fb8d9fcb89ee236630/saliency-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "1ad33ace9e0d52d3899224ad08561679", "sha256": "c28abaffcb62e823c824961f7fa01df86dab623929b23b714cec0851da5b5f74" }, "downloads": -1, "filename": "saliency-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1ad33ace9e0d52d3899224ad08561679", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11022, "upload_time": "2017-07-11T22:48:55", "url": "https://files.pythonhosted.org/packages/08/13/063c3c105fc607cdc0bdbe43bfb9047155f4d3e1786e2cc724c071e545e3/saliency-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a11f4c184ad5d179ae6014e736434b67", "sha256": "bbb3d7d571604c88b0534ccfa4ae3d0a74d70872c163399de16299f14846d288" }, "downloads": -1, "filename": "saliency-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a11f4c184ad5d179ae6014e736434b67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6157, "upload_time": "2017-07-11T22:48:57", "url": "https://files.pythonhosted.org/packages/a4/f0/efd563c1f5a309b3f66247f41ebd7d0264f4cf45e07fa8c0347faa8894aa/saliency-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "727207d194498db25142c03d198cce02", "sha256": "d8a4ee2c3184c7b7782cf9a1d2e62179c564b09980561d932ab8aa6ed79f6367" }, "downloads": -1, "filename": "saliency-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "727207d194498db25142c03d198cce02", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17602, "upload_time": "2019-06-20T18:06:37", "url": "https://files.pythonhosted.org/packages/34/e6/70868723ef1bd75de2dcee9c6774f53ef0f3a1635125211d4674d4d9c4f3/saliency-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7748fc9a1862c750c3d6339ed599823f", "sha256": "333dd7d24a527798449d7c2d128143229cdc74bca170eef19afc945d60e3b6c1" }, "downloads": -1, "filename": "saliency-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7748fc9a1862c750c3d6339ed599823f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10213, "upload_time": "2019-06-20T18:06:39", "url": "https://files.pythonhosted.org/packages/84/f3/a5443d5d684a85d1942e4af008b9e0d4b3538d339576c355ef1987ff7ba7/saliency-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "9c17d290203067b311ad1e537f9a5d90", "sha256": "627d4d84d34127cdb183944289b4a91a0d0c5a774f4ba462cda2042b0d2e12c0" }, "downloads": -1, "filename": "saliency-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9c17d290203067b311ad1e537f9a5d90", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26305, "upload_time": "2019-08-13T20:23:23", "url": "https://files.pythonhosted.org/packages/5b/89/1069cfb6c658d15968b7ab4f5c7f114602391b33c4f36e12121d7177714d/saliency-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95a79c73fcbc12d8fd58b3c1f1900e5c", "sha256": "c29b769fcf41696feef0ae58fea3b7ec80faef1da4a699692cba0a414daad97d" }, "downloads": -1, "filename": "saliency-0.0.4.tar.gz", "has_sig": false, "md5_digest": "95a79c73fcbc12d8fd58b3c1f1900e5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16901, "upload_time": "2019-08-13T20:23:24", "url": "https://files.pythonhosted.org/packages/b0/f6/3c22d74723fd49410a121b6ddb75a99536a62aa45ba0035b4689b2d5e7bf/saliency-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "65cd121a40f07478a3c5ba57c1db5af7", "sha256": "981fd77bf799115c4f7b1709cfa0fb0ab5bea4005ad669741c04353fd12a76b8" }, "downloads": -1, "filename": "saliency-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "65cd121a40f07478a3c5ba57c1db5af7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26843, "upload_time": "2019-09-26T17:59:23", "url": "https://files.pythonhosted.org/packages/54/54/0cf1bb5d60f2fda80ceaf19fda6bc02c0a89c78c58b37db417f21755d906/saliency-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26d33efa8ec1311e7520c12845f76baf", "sha256": "d2cae44af399f343034daa79b33bfe90762576dcda33847d862bc534a1a462a6" }, "downloads": -1, "filename": "saliency-0.0.5.tar.gz", "has_sig": false, "md5_digest": "26d33efa8ec1311e7520c12845f76baf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17442, "upload_time": "2019-09-26T17:59:24", "url": "https://files.pythonhosted.org/packages/0d/5d/8f160cddeac7b130f2d8caacfbbaade6415ca35c6c6e5fece77073557d35/saliency-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "65cd121a40f07478a3c5ba57c1db5af7", "sha256": "981fd77bf799115c4f7b1709cfa0fb0ab5bea4005ad669741c04353fd12a76b8" }, "downloads": -1, "filename": "saliency-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "65cd121a40f07478a3c5ba57c1db5af7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26843, "upload_time": "2019-09-26T17:59:23", "url": "https://files.pythonhosted.org/packages/54/54/0cf1bb5d60f2fda80ceaf19fda6bc02c0a89c78c58b37db417f21755d906/saliency-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26d33efa8ec1311e7520c12845f76baf", "sha256": "d2cae44af399f343034daa79b33bfe90762576dcda33847d862bc534a1a462a6" }, "downloads": -1, "filename": "saliency-0.0.5.tar.gz", "has_sig": false, "md5_digest": "26d33efa8ec1311e7520c12845f76baf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17442, "upload_time": "2019-09-26T17:59:24", "url": "https://files.pythonhosted.org/packages/0d/5d/8f160cddeac7b130f2d8caacfbbaade6415ca35c6c6e5fece77073557d35/saliency-0.0.5.tar.gz" } ] }