研究神经网络预测的工具箱。
innvestigate的Python项目详细描述
[在调查神经网络中!(https://github.com/albermax/investigate)[![推特](https://img.shields.io/twitter/url/http://shields.io.svg?style=social)(https://twitter.com/intent/tweet?文本=innvestigate%20neural%20networks!&url=https://github.com/albermax/innvestigate&hashtags=innvestigate,人工智能,机器学习,深度学习,数据科学)
[![Github包版本](https://img.shields.io/badge/version-v1.0.6-green.svg)](https://github.com/albermax/innvestigate)
[![Keras软件包版本](https://img.shields.io/badge/Kerasversion-v2.2.4-green.svg)(https://github.com/albermax/innvestigate)
[![许可证:BSD-2](https://img.shields.io/badge/license-bsd--2-blue.svg)](https://github.com/albermax/innvestigate/blob/master/license)
[![构建状态](https://travis-ci.org/albermax/innvestigate.svg?branch=master)(https://travis-ci.org/albermax/innvestigate)
[![开发-构建状态](https://travis-ci.org/albermax/innvestigate.svg?branch=development)(https://travis-ci.org/albermax/innvestigate)
![ImageNet上的不同解释方法](https://github.com/albermax/innvestigate/raw/master/examples/images/analysis of grid.png)
'35;目录
*[简介]('35;简介)
*[安装]('35;安装)
*[用法和示例]('35;用法和示例)>*[更多信息]文档]('35;更多-文档)
*[贡献]('35;贡献)
*[发布]('35;发布)
'35;'简介
近年来,神经网络在许多领域,例如,对象检测和语音识别等领域进一步发展了最新技术。
尽管neura取得了成功。
网络通常仍被视为黑匣子。为了更好地理解神经网络,人们提出了几种方法,如显著性、去噪网、GuidedBackProp、SmoothGrad、综合梯度、LRP、Patternnet&;归因等。>由于缺少参考实现,比较它们是一项主要工作。
此库通过为许多分析方法提供通用接口和开箱即用的实现来解决这个问题。
我们的目标是使分析神经网络的预测变得容易!如果您使用此代码,请启动存储库并引用以下文章:
**["InVestigate神经网络!"(http://http://arxiv.org/abs/1808/1808.0424260)(http://http://www www.www/www.www/www/www.www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www.org/abs/181808.04260)(http://http://www www.www/www.www/www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.SeSeSeSeSeeeeeeEkin-SeSeekin;PhAsAstian拉帕斯金;Philipp 81808.181818181818181818181818181818181808.08.08.08.08.08.08.08.是的。amp;auml;hne,pieter-jan kindermans**
'35;'35;安装
库基于keras,因此需要受支持的[keras-后端](https://keras.io/backend/)
o(当前仅支持tensorflow后端我们分别测试了Python3.6、TensorFlow1.12和Cuda9.x.x.:<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<需要安装一个AddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEd><<<<<<<<<<<<<<<<<<<>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
The iNNvestigate library contains i以下方法的实现:
**函数:*
**gradient:**输出神经元相对于输入的梯度。
**smootgrad:**[smootgrad](https://arxiv.org/abs/1706.03825)在添加噪声的输入数上平均梯度。
**信号:*
**deconvnet:**[deconvnet](https://arxiv.org/abs/1311.2901)适用梯度计算中的relu而不是relu的梯度。
**guided:**[引导的backprop](https://arxiv.org/abs/1412.6806)在梯度计算中将relu应用于relu的梯度。
**pattern.net:**[patternnet](https://arxiv.org/abs/1705.05598)estiMates输出神经元的输入信号。
**属性:*
**input_t_gradient:**input戥gradient
**deep_taylor[.bounded]:**[deeptaylor](https://www.sciencedirect.com/science/article/pii/s031320316303582?via%3dihub)为每个神经元计算一个根点,该根点靠近输入,但其输出值为0,并使用此差异递归地估计每个神经元的属性。
**pattern.attribution:**[pattern attribution](https://arxiv.org/a b s/1705.05598)应用deep taylor b沿着每个神经元的信号方向寻找根点。id=10.1371/journal.pone.0130140)递归地属性到每个神经元的输入相关性与其对神经元输出的贡献成比例。
***集成梯度:**[集成梯度](https://arxiv.org/abs/1703.01365)集成从输入到参考的路径上的梯度。e.
**deeplift.wrapper:*[deeplift(wrapper around original code,slower)](http://progressions.mlr.press/v70/shrikumar17a.html)基于"有限"梯度计算反向传播。
**杂项:*
**input:**返回输入。
**random:**返回随机高斯noiSE.
**InVestigate背后的目的是使分析方法易于使用,但不是解释潜在的概念和假设。请在使用某种方法时阅读相应的出版物,在发布时请引用相应的论文(以及[Innvestigate论文](https://arxiv.org/abs/1808.04260))。谢谢您!**
所有可用的方法都有一个共同点,即它们试图分析特定神经元相对于神经网络输入的输出。
通常分析输出层中激活最大的神经元。
例如,给定一个keras模型,可以创建一个radient分析器:
``python
import innvestigate
``````
>分析神经网络输入对输出神经元的影响:
``python
analysis=analyzer.analyze(inputs)
```
要分析具有索引i的神经元,可以使用以下方案:
``python
analyzer=innvestigate.create撸analyzer("gradient",
model,
neuron撸selection撸mode="index")
ana analyzer.analyze(inputs,i)
````
让我们看一个使用vgg16的示例([代码](https://github.com/albermax/innvestigate/blob/master/example s/readme_code_snippet.py))和这个图像:
![输入图像](https://github.com/albermax/innvestigate/raw/master/examples/images/readme_example_input.png)
``python
import innvestigate
import innvestigate.utils
import keras.applications.vgg16 as vgg16
重新处理输入
条带softmax层
模型=innvestigate.utils.model_wou_Softmax(模型)
创建分析器
分析器=innvestigate.create_Analyzer("deep_Taylor",模型)
添加批处理轴并预处理
x=预处理(图像[无])
应用分析器w.r.t.最大值激活的输出神经元
a=分析器。分析(x)
[分析图像](https://github.com/albermax/innvestigate/raw/master/examples/images/readme_exampleu analysis.png)
lyzer=innvestigate.create_analyzer("pattern.net",model)
analyzer.fit(x_train)
analyzer.analyze(x_test)
````
脚本和as jupyter笔记本:
**[Innvestigate简介](https://github.com/albermax/Innvestigate/blob/master/examples/notebooks/introduction.ipynb):**演示如何使用**Innvestigate**。
**[比较mnist上的方法](https://github.com/albermax/Innvestigate/blob/master/e示例/notebooks/mnist_compare_methods.ipynb):**显示如何在mnist上训练和比较分析器。
**[比较mnist上的输出神经元](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/mnist_neuron_selection.ipynb):**显示如何分析不同的预测mnist上的类。
**[比较imagenet上的方法](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/imagenet_compare_methods.ipynb):**显示如何比较imagenet上的分析器。
**[比较imagenet上的网络](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/imagenet_compare_networks.ipynb):**演示如何比较imagenet上不同网络的分析。
**[情绪分析](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/momentation_analysis.ipynb)**。
**[使用innvestigate开发](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/introduction廑development.ipynb):**演示如何使用**innvestigate**进行开发。
**[扰动分析](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/mnist廑摄动.ipynb)**。
--
**要使用ImageNet示例,请先下载示例图像([脚本](https://github.com/albermax/innvestigate/blob/master/examples/images/wget_ImageNet_2011_Samples.sh)).*
可以在这里找到:[https://investigate.readthedocs.io/en/latest/](https://investigate.readthedocs.io/en/latest/)
\contribution
[![Github包版本](https://img.shields.io/badge/version-v1.0.6-green.svg)](https://github.com/albermax/innvestigate)
[![Keras软件包版本](https://img.shields.io/badge/Kerasversion-v2.2.4-green.svg)(https://github.com/albermax/innvestigate)
[![许可证:BSD-2](https://img.shields.io/badge/license-bsd--2-blue.svg)](https://github.com/albermax/innvestigate/blob/master/license)
[![构建状态](https://travis-ci.org/albermax/innvestigate.svg?branch=master)(https://travis-ci.org/albermax/innvestigate)
[![开发-构建状态](https://travis-ci.org/albermax/innvestigate.svg?branch=development)(https://travis-ci.org/albermax/innvestigate)
![ImageNet上的不同解释方法](https://github.com/albermax/innvestigate/raw/master/examples/images/analysis of grid.png)
'35;目录
*[简介]('35;简介)
*[安装]('35;安装)
*[用法和示例]('35;用法和示例)>*[更多信息]文档]('35;更多-文档)
*[贡献]('35;贡献)
*[发布]('35;发布)
'35;'简介
近年来,神经网络在许多领域,例如,对象检测和语音识别等领域进一步发展了最新技术。
尽管neura取得了成功。
网络通常仍被视为黑匣子。为了更好地理解神经网络,人们提出了几种方法,如显著性、去噪网、GuidedBackProp、SmoothGrad、综合梯度、LRP、Patternnet&;归因等。>由于缺少参考实现,比较它们是一项主要工作。
此库通过为许多分析方法提供通用接口和开箱即用的实现来解决这个问题。
我们的目标是使分析神经网络的预测变得容易!如果您使用此代码,请启动存储库并引用以下文章:
**["InVestigate神经网络!"(http://http://arxiv.org/abs/1808/1808.0424260)(http://http://www www.www/www.www/www/www.www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www/www.org/abs/181808.04260)(http://http://www www.www/www.www/www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.www.SeSeSeSeSeeeeeeEkin-SeSeekin;PhAsAstian拉帕斯金;Philipp 81808.181818181818181818181818181818181808.08.08.08.08.08.08.08.是的。amp;auml;hne,pieter-jan kindermans**
'35;'35;安装
o(当前仅支持tensorflow后端我们分别测试了Python3.6、TensorFlow1.12和Cuda9.x.x.:<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<需要安装一个AddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddAddEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEdEd><<<<<<<<<<<<<<<<<<<>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
The iNNvestigate library contains i以下方法的实现:
**函数:*
**gradient:**输出神经元相对于输入的梯度。
**smootgrad:**[smootgrad](https://arxiv.org/abs/1706.03825)在添加噪声的输入数上平均梯度。
**信号:*
**deconvnet:**[deconvnet](https://arxiv.org/abs/1311.2901)适用梯度计算中的relu而不是relu的梯度。
**guided:**[引导的backprop](https://arxiv.org/abs/1412.6806)在梯度计算中将relu应用于relu的梯度。
**pattern.net:**[patternnet](https://arxiv.org/abs/1705.05598)estiMates输出神经元的输入信号。
**属性:*
**input_t_gradient:**input戥gradient
**deep_taylor[.bounded]:**[deeptaylor](https://www.sciencedirect.com/science/article/pii/s031320316303582?via%3dihub)为每个神经元计算一个根点,该根点靠近输入,但其输出值为0,并使用此差异递归地估计每个神经元的属性。
**pattern.attribution:**[pattern attribution](https://arxiv.org/a b s/1705.05598)应用deep taylor b沿着每个神经元的信号方向寻找根点。id=10.1371/journal.pone.0130140)递归地属性到每个神经元的输入相关性与其对神经元输出的贡献成比例。
***集成梯度:**[集成梯度](https://arxiv.org/abs/1703.01365)集成从输入到参考的路径上的梯度。e.
**deeplift.wrapper:*[deeplift(wrapper around original code,slower)](http://progressions.mlr.press/v70/shrikumar17a.html)基于"有限"梯度计算反向传播。
**杂项:*
**input:**返回输入。
**random:**返回随机高斯noiSE.
**InVestigate背后的目的是使分析方法易于使用,但不是解释潜在的概念和假设。请在使用某种方法时阅读相应的出版物,在发布时请引用相应的论文(以及[Innvestigate论文](https://arxiv.org/abs/1808.04260))。谢谢您!**
所有可用的方法都有一个共同点,即它们试图分析特定神经元相对于神经网络输入的输出。
通常分析输出层中激活最大的神经元。
例如,给定一个keras模型,可以创建一个radient分析器:
``python
import innvestigate
>分析神经网络输入对输出神经元的影响:
``python
analysis=analyzer.analyze(inputs)
```
要分析具有索引i的神经元,可以使用以下方案:
``python
analyzer=innvestigate.create撸analyzer("gradient",
model,
neuron撸selection撸mode="index")
ana analyzer.analyze(inputs,i)
````
让我们看一个使用vgg16的示例([代码](https://github.com/albermax/innvestigate/blob/master/example s/readme_code_snippet.py))和这个图像:
![输入图像](https://github.com/albermax/innvestigate/raw/master/examples/images/readme_example_input.png)
``python
import innvestigate
import innvestigate.utils
import keras.applications.vgg16 as vgg16
重新处理输入
条带softmax层
模型=innvestigate.utils.model_wou_Softmax(模型)
创建分析器
分析器=innvestigate.create_Analyzer("deep_Taylor",模型)
添加批处理轴并预处理
x=预处理(图像[无])
应用分析器w.r.t.最大值激活的输出神经元
a=分析器。分析(x)
[分析图像](https://github.com/albermax/innvestigate/raw/master/examples/images/readme_exampleu analysis.png)
lyzer=innvestigate.create_analyzer("pattern.net",model)
analyzer.fit(x_train)
analyzer.analyze(x_test)
````
脚本和as jupyter笔记本:
**[Innvestigate简介](https://github.com/albermax/Innvestigate/blob/master/examples/notebooks/introduction.ipynb):**演示如何使用**Innvestigate**。
**[比较mnist上的方法](https://github.com/albermax/Innvestigate/blob/master/e示例/notebooks/mnist_compare_methods.ipynb):**显示如何在mnist上训练和比较分析器。
**[比较mnist上的输出神经元](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/mnist_neuron_selection.ipynb):**显示如何分析不同的预测mnist上的类。
**[比较imagenet上的方法](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/imagenet_compare_methods.ipynb):**显示如何比较imagenet上的分析器。
**[比较imagenet上的网络](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/imagenet_compare_networks.ipynb):**演示如何比较imagenet上不同网络的分析。
**[情绪分析](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/momentation_analysis.ipynb)**。
**[使用innvestigate开发](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/introduction廑development.ipynb):**演示如何使用**innvestigate**进行开发。
**[扰动分析](https://github.com/albermax/innvestigate/blob/master/examples/notebooks/mnist廑摄动.ipynb)**。
--
**要使用ImageNet示例,请先下载示例图像([脚本](https://github.com/albermax/innvestigate/blob/master/examples/images/wget_ImageNet_2011_Samples.sh)).*
可以在这里找到:[https://investigate.readthedocs.io/en/latest/](https://investigate.readthedocs.io/en/latest/)
\contribution