Gradient

Gradient(self, model, filter_idx=None, avg_func='sum', layer=None, selected_fwd_node=None, pre_nonlinearity=False)

Compute the gradient w.r.t. input

Arguments

  • model: Kipoi model
  • layer": Which output layer to use to make the predictions. If not specified, the final layer will be used.
  • pre_nonlinearity: boolean flag indicating that it should checked whether the selected output is post activation function. If a non-linear activation function is used attempt to use its input.
  • filter_idx: Filter index that should be inspected with gradients. If not set all filters will be used.
  • avg_func: Averaging function to be applied across selected filters (--filter_idx) in layer --layer."
  • selected_fwd_node: If the selected layer has multiple inbound connections in the graph then those can be selected here with an integer index. Not necessarily supported by all models.