@@ -52,14 +52,30 @@ def get_attribution_map(
5252 convert_to_numpy : bool = True ,
5353 aggregate : Literal ["mean" , "sum" , "max" ] = "mean" ,
5454 transform : Literal ["none" , "abs" ] = "none" ,
55- hybrid_solver = False ,
55+ hybrid_solver : bool = False ,
5656):
57- """Estimate attribution maps.
57+ """Estimate attribution maps using the Jacobian pseudo-inverse.
58+
5859 The function estimates Jacobian matrices for each point in the model,
59- computes the pseudo-inverse (for every sample), applies the `transform`
60- function point-wise, and then aggregates with the `aggregate` function
61- over the sample dimension.
62- The result is a `(num_inputs, num_features)` attribution map.
60+ computes the pseudo-inverse (for every sample) and then aggregates
61+ the resulting matrices to compute an attribution map.
62+
63+ Args:
64+ model: The neural network model for which to compute attributions.
65+ input_data: Input tensor or numpy array to compute attributions for.
66+ double_precision: If ``True``, use double precision for computation.
67+ convert_to_numpy: If ``True``, convert the output to numpy arrays.
68+ aggregate: Method to aggregate attribution values across samples.
69+ Options are ``"mean"``, ``"sum"``, or ``"max"``.
70+ transform: Transformation to apply to attribution values.
71+ Options are ``"none"`` or ``"abs"``.
72+ hybrid_solver: If ``True``, handle multi-objective models differently.
73+
74+ Returns:
75+ A tuple containing:
76+ - jf: The Jacobian matrix of shape (num_samples, output_dim, input_dim)
77+ - jhatg: The pseudo-inverse of the Jacobian matrix
78+ The result is effectively a ``(num_inputs, num_features)`` attribution map.
6379 """
6480 assert aggregate in ["mean" , "sum" , "max" ]
6581
0 commit comments