|
pulsatrix
|
Raw-gradient saliency: d(output[target_index])/d(input), computed by seeding ExplainerContext::backward_pass with a one-hot vector at target_index. More...
#include <saliency.hpp>
Public Member Functions | |
| Attribution | explain (ExplainerContext &ctx, const Tensor &input, int64_t target_index, DeviceBackend *backend) const |
| Computes the saliency map for one output index. | |
Raw-gradient saliency: d(output[target_index])/d(input), computed by seeding ExplainerContext::backward_pass with a one-hot vector at target_index.
|
inline |
Computes the saliency map for one output index.
| ctx | Context to run the forward/backward pass through. |
| input | Input to explain. |
| target_index | Which output element's gradient to compute (0-based, flat index into the network's output). |
| backend | Backend to allocate the one-hot seed tensor through (the output's own backend is used instead when this one serves a different device). |