salesforce / fast-influence-functions

BSD 3-Clause "New" or "Revised" License
83 stars 17 forks source link

Question regarding hvp estimation convergence #19

Open maxidl opened 2 years ago

maxidl commented 2 years ago

Hey, I have a question regarding the convergence of the estimated hvp. While running the estimation, the progressbar provides information on the current norm of the estimate and the difference between the current norm and the norm of the last estimate. Should I expect this norm to converge (or the norm difference to become very small)? Seems like this is not the case in my application. In the paper, you mention J is a sufficiently large integer so that the above quantity converges, does this transfer to this norm converging? In my case, even for very large J (num_samples) and also high B (batch_size) the norm keeps getting larger consistently.

Any hints would be appreciated.

new_estimate_norm = new_estimate[0].norm().item()
last_estimate_norm = last_estimate[0].norm().item()
estimate_norm_diff = new_estimate_norm - last_estimate_norm
pbar.set_description(f"{new_estimate_norm:.2f} | {estimate_norm_diff:.2f}")

See https://github.com/salesforce/fast-influence-functions/blob/6052b409d304e9bde6f5cad08c672ca9d6ee1dcb/influence_utils/nn_influence_utils.py#L187

HanGuo97 commented 2 years ago

Hi, this is a great question.

This function should have a couple of other hyper-parameters, namely damp and scale. I myself have noticed similar issues before, and playing a bit with these values was helpful. For more details and how to properly interpret these values, please see Footnote 2 and Section 4.2 in this paper.