In essence, influence functions amount to computing dot product on a gradient space. If we adopt this interpretation, we can think about different measures such as L2 or cosine distance. For instance, computing cosine similarity is explored as RelatIF. To flexibly support various metrics, we implement some primitives like dot and norm, and construct influence computations using these primitives. For the user interface,
if_computer.compute_influence_all(test_log, log_loader, mode="dot") # mode in ["dot", "cosine", "l2"]
In essence, influence functions amount to computing dot product on a gradient space. If we adopt this interpretation, we can think about different measures such as L2 or cosine distance. For instance, computing cosine similarity is explored as RelatIF. To flexibly support various metrics, we implement some primitives like
dot
andnorm
, and construct influence computations using these primitives. For the user interface,