🎯 dnn-locate#
dnn-locate is a Python module for discriminative features localization given a fitted discriminator model, including neural networks. dnn-locate has the following key features:
Adaptiveness. For different instances, dnn-locate is able to provide adaptive discriminative features.
Sparseness. The discriminative features provided by dnn-locate is sparse.
Statistically guaranteed interpretation in R-square (R2). dnn-locate is able to effectively localize the discriminative features with a target R2 of prediction.
You can find more information for dnn-locate:
GitHub repo: https://github.com/statmlben/dnn-inference
Documentation: https://dnn-locate.readthedocs.io
Open Source: MIT license
TRUST (Tanh RelU SofTmax) activation function#
We achieve the (1)-(3) by using the Magic activation: tanh + relu + softmax
from tensorflow.keras import backend as K
def trust(x, tau, axis_=(1,2)):
z = tau*K.softmax(x, axis=axis_)
z = backend.tanh(backend.relu(z))
return z
trust(x) satisfies that: (i) trust(x) <= 1; (ii) Σ trust(x) <= tau, that is, each element if controlled by 1, and the sum of all elements is controlled by tau.
Reference#
If you use this code please star the repository and cite the following paper:
@article{dai2022locate,
title={Data-adaptive discriminative feature localization with statistically guaranteed interpretation},
author={Dai, Ben and Shen, Xiaotong and Chen, Lin Yee and Li, Chunlin and Pan, Wei},
journal={Annals of Applied Statistics},
year={2022},
publisher={Institute of Mathematical Statistics}
}