Skip to content

simple_gradient

allennlp.interpret.saliency_interpreters.simple_gradient

[SOURCE]


SimpleGradient#

@SaliencyInterpreter.register("simple-gradient")
class SimpleGradient(SaliencyInterpreter)

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

saliency_interpret_from_json#

class SimpleGradient(SaliencyInterpreter):
 | ...
 | def saliency_interpret_from_json(self, inputs: JsonDict) -> JsonDict

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.