allennlp.interpret.saliency_interpreters.simple_gradient#

SimpleGradient#

SimpleGradient(self, predictor:allennlp.predictors.predictor.Predictor) -> None

Registered as a SaliencyInterpreter with name "simple-gradient".

saliency_interpret_from_json#

SimpleGradient.saliency_interpret_from_json(
    self,
    inputs: Dict[str, Any],
) -> Dict[str, Any]

Interprets the model's prediction for inputs. Gets the gradients of the loss with respect to the input and returns those gradients normalized and sanitized.